Skip to content

Commit

Permalink
tools: fix show-stylus to handle vendor styli
Browse files Browse the repository at this point in the history
This only fixes the stylus id part of it, VIDs are still unhandled.

Fixes: 884d423 ("Support styli from vendors other than Wacom")
  • Loading branch information
whot committed Oct 18, 2024
1 parent 34bd864 commit 42b970c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tools/show-stylus.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,15 @@ def load_data_files():
config = configparser.ConfigParser()
config.read(path)
for stylus_id in config.sections():
sid = int(stylus_id, 16)
styli[sid] = config[stylus_id].get("Group", sid)
ids = stylus_id.split(":")
if len(ids) > 1:
vid, sid = map(lambda x: int(x, 16), ids)
else:
vid = 0x56a
sid = int(ids[0], 16)
# FIXME: vendor should be used here, let's do that when we figure out
# who needs it.
styli[sid] = config[stylus_id].get("Group", stylus_id)

return styli

Expand Down

0 comments on commit 42b970c

Please sign in to comment.