Make adding more printable keys slightly easier

When adding keys after `GLFW_KEY_UNDERSCORE`, one now needs to change a `#define` right below the last printable key instead of changing it elsewhere in the code.
This commit now also marks `GLFW_KEY_PLUS` and `GLFW_KEY_UNDERSCORE` as printable characters.
This commit is contained in:
Luflosi
2019-09-01 11:24:14 +02:00
parent def0c55df3
commit b3b830bb5f
4 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -298,7 +298,7 @@ def update_encoding():
for k in sorted(keys, key=lambda k: getattr(defines, k)):
val = getattr(defines, k)
name = symbolic_name(k)
if val <= defines.GLFW_KEY_LAST and name != 'LAST' and val != defines.GLFW_KEY_UNKNOWN:
if val <= defines.GLFW_KEY_LAST and name not in ('LAST', 'LAST_PRINTABLE') and val != defines.GLFW_KEY_UNKNOWN:
if name not in ans:
ans[name] = encode(i)
i += 1