diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-04-03 02:21:43 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-04-03 02:21:43 +0200 |
commit | f7a14756eef9277175ded1fd10901b307fafb291 (patch) | |
tree | eef1bc9ea0a0478cf5eac5ef2d82f2c6eed10edb | |
parent | 637d092f808c695e920d5955f6f56460ea847cd6 (diff) |
Add f16-f22 keys
-rw-r--r-- | include/mgl/window/key.h | 7 | ||||
-rw-r--r-- | src/window/key.c | 14 | ||||
-rw-r--r-- | src/window/window.c | 7 |
3 files changed, 28 insertions, 0 deletions
diff --git a/include/mgl/window/key.h b/include/mgl/window/key.h index 8a51c00..722a80a 100644 --- a/include/mgl/window/key.h +++ b/include/mgl/window/key.h @@ -122,6 +122,13 @@ typedef enum { MGL_KEY_AUDIO_FORWARD, MGL_KEY_DEAD_ACUTE, MGL_KEY_APOSTROPHE, + MGL_KEY_F16, + MGL_KEY_F17, + MGL_KEY_F18, + MGL_KEY_F19, + MGL_KEY_F20, + MGL_KEY_F21, + MGL_KEY_F22, /* This should always be the last key */ __MGL_NUM_KEYS__ diff --git a/src/window/key.c b/src/window/key.c index 34084b3..b68270a 100644 --- a/src/window/key.c +++ b/src/window/key.c @@ -120,6 +120,13 @@ const char* mgl_key_to_string(mgl_key key) { case MGL_KEY_AUDIO_FORWARD: return "Audio Forward"; case MGL_KEY_DEAD_ACUTE: return "ยด"; case MGL_KEY_APOSTROPHE: return "'"; + case MGL_KEY_F16: return "F16"; + case MGL_KEY_F17: return "F17"; + case MGL_KEY_F18: return "F18"; + case MGL_KEY_F19: return "F19"; + case MGL_KEY_F20: return "F20"; + case MGL_KEY_F21: return "F21"; + case MGL_KEY_F22: return "F22"; case __MGL_NUM_KEYS__: return ""; } return ""; @@ -192,6 +199,13 @@ uint64_t mgl_key_to_x11_keysym(mgl_key key) { case MGL_KEY_AUDIO_FORWARD: return XF86XK_AudioForward; case MGL_KEY_DEAD_ACUTE: return XK_dead_acute; case MGL_KEY_APOSTROPHE: return XK_apostrophe; + case MGL_KEY_F16: return XK_F16; + case MGL_KEY_F17: return XK_F17; + case MGL_KEY_F18: return XK_F18; + case MGL_KEY_F19: return XK_F19; + case MGL_KEY_F20: return XK_F20; + case MGL_KEY_F21: return XK_F21; + case MGL_KEY_F22: return XK_F22; default: return XK_VoidSymbol; } return XK_VoidSymbol; diff --git a/src/window/window.c b/src/window/window.c index bce68fc..e7f737d 100644 --- a/src/window/window.c +++ b/src/window/window.c @@ -1163,6 +1163,13 @@ static mgl_key x11_keysym_to_mgl_key(KeySym key_sym) { case XF86XK_AudioForward: return MGL_KEY_AUDIO_FORWARD; case XK_dead_acute: return MGL_KEY_DEAD_ACUTE; case XK_apostrophe: return MGL_KEY_APOSTROPHE; + case XK_F16: return MGL_KEY_F16; + case XK_F17: return MGL_KEY_F17; + case XK_F18: return MGL_KEY_F18; + case XK_F19: return MGL_KEY_F19; + case XK_F20: return MGL_KEY_F20; + case XK_F21: return MGL_KEY_F21; + case XK_F22: return MGL_KEY_F22; } return MGL_KEY_UNKNOWN; } |