Spec for extended keyboard protocol

This commit is contained in:
Kovid Goyal
2017-02-10 11:34:38 +05:30
parent b6c0eb0909
commit 48a2a395c4
5 changed files with 237 additions and 6 deletions

View File

@@ -109,3 +109,13 @@ def interpret_text_event(codepoint, mods):
def get_shortcut(keymap, mods, key, scancode):
key = get_localized_key(key, scancode)
return keymap.get((mods & 0b1111, key))
def key_integer_map():
ans = {}
for k in dir(defines):
if k.startswith('GLFW_KEY_'):
val = getattr(defines, k)
if val < defines.GLFW_KEY_LAST and val != defines.GLFW_KEY_UNKNOWN:
ans[k[9:]] = val
return ans