Merge branch 'add_glfw_key_last_printable' of https://github.com/Luflosi/kitty

This commit is contained in:
Kovid Goyal 2019-09-01 17:52:39 +05:30
commit 3bf1d73b07
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 6 additions and 2 deletions

2
glfw/glfw3.h vendored
View File

@ -394,6 +394,8 @@ extern "C" {
#define GLFW_KEY_PLUS 163
#define GLFW_KEY_UNDERSCORE 164
#define GLFW_KEY_LAST_PRINTABLE GLFW_KEY_UNDERSCORE
/* Function keys */
#define GLFW_KEY_ESCAPE 256
#define GLFW_KEY_ENTER 257

2
glfw/input.c vendored
View File

@ -691,7 +691,7 @@ GLFWAPI const char* glfwGetKeyName(int key, int scancode)
{
if (key != GLFW_KEY_KP_EQUAL &&
(key < GLFW_KEY_KP_0 || key > GLFW_KEY_KP_ADD) &&
(key < GLFW_KEY_APOSTROPHE || key > GLFW_KEY_WORLD_2))
(key < GLFW_KEY_APOSTROPHE || key > GLFW_KEY_LAST_PRINTABLE))
{
return NULL;
}

2
kitty/glfw-wrapper.h generated
View File

@ -151,6 +151,8 @@
#define GLFW_KEY_PLUS 163
#define GLFW_KEY_UNDERSCORE 164
#define GLFW_KEY_LAST_PRINTABLE GLFW_KEY_UNDERSCORE
/* Function keys */
#define GLFW_KEY_ESCAPE 256
#define GLFW_KEY_ENTER 257

2
kitty/key_encoding.py generated
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