aboutsummaryrefslogtreecommitdiff
path: root/src/window/key.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/window/key.c')
-rw-r--r--src/window/key.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/window/key.c b/src/window/key.c
index 7528a15..0ac0be6 100644
--- a/src/window/key.c
+++ b/src/window/key.c
@@ -29,22 +29,22 @@ const char* mgl_key_to_string(mgl_key key) {
case MGL_KEY_X: return "X";
case MGL_KEY_Y: return "Y";
case MGL_KEY_Z: return "Z";
- case MGL_KEY_NUM0: return "Num0";
- case MGL_KEY_NUM1: return "Num1";
- case MGL_KEY_NUM2: return "Num2";
- case MGL_KEY_NUM3: return "Num3";
- case MGL_KEY_NUM4: return "Num4";
- case MGL_KEY_NUM5: return "Num5";
- case MGL_KEY_NUM6: return "Num6";
- case MGL_KEY_NUM7: return "Num7";
- case MGL_KEY_NUM8: return "Num8";
- case MGL_KEY_NUM9: return "Num9";
+ case MGL_KEY_NUM0: return "0";
+ case MGL_KEY_NUM1: return "1";
+ case MGL_KEY_NUM2: return "2";
+ case MGL_KEY_NUM3: return "3";
+ case MGL_KEY_NUM4: return "4";
+ case MGL_KEY_NUM5: return "5";
+ case MGL_KEY_NUM6: return "6";
+ case MGL_KEY_NUM7: return "7";
+ case MGL_KEY_NUM8: return "8";
+ case MGL_KEY_NUM9: return "9";
case MGL_KEY_ESCAPE: return "Escape";
- case MGL_KEY_LCONTROL: return "Left control";
+ case MGL_KEY_LCONTROL: return "Left ctrl";
case MGL_KEY_LSHIFT: return "Left shift";
case MGL_KEY_LALT: return "Left alt";
case MGL_KEY_LSYSTEM: return "Left system";
- case MGL_KEY_RCONTROL: return "Right control";
+ case MGL_KEY_RCONTROL: return "Right ctrl";
case MGL_KEY_RSHIFT: return "Right shift";
case MGL_KEY_RALT: return "Right alt";
case MGL_KEY_RSYSTEM: return "Right system";
@@ -60,7 +60,7 @@ const char* mgl_key_to_string(mgl_key key) {
case MGL_KEY_TILDE: return "~";
case MGL_KEY_EQUAL: return "=";
case MGL_KEY_HYPHEN: return "-";
- case MGL_KEY_SPACE: return " ";
+ case MGL_KEY_SPACE: return "Space";
case MGL_KEY_ENTER: return "Enter";
case MGL_KEY_BACKSPACE: return "Backspace";
case MGL_KEY_TAB: return "Tab";
@@ -108,3 +108,7 @@ const char* mgl_key_to_string(mgl_key key) {
}
return 0;
}
+
+bool mgl_key_is_modifier(mgl_key key) {
+ return key >= MGL_KEY_LCONTROL && key <= MGL_KEY_RSYSTEM;
+}