Skip to content

Commit

Permalink
Be more lenient when adding uppercase key names
Browse files Browse the repository at this point in the history
  • Loading branch information
boppreh committed Feb 25, 2018
1 parent f5bf61c commit 6f9961f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions keyboard/_winkeyboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,10 +402,12 @@ def _setup_name_tables():
# Get key names from ToUnicode, GetKeyNameText, MapVirtualKeyW and official virtual keys.
names = list(get_event_names(*entry))
if names:
to_name[entry] = names
# Also map lowercased key names, but only after the properly cased ones.
lowercase_names = [name.lower() for name in names]
to_name[entry] = names + lowercase_names
# Remember the "id" of the name, as the first techniques
# have better results and therefore priority.
for i, name in enumerate(map(normalize_name, names)):
for i, name in enumerate(map(normalize_name, names + lowercase_names)):
from_name[name].append((i, entry))

# TODO: single quotes on US INTL is returning the dead key (?), and therefore
Expand Down

0 comments on commit 6f9961f

Please sign in to comment.