From c4903d92675a4c971d35190b749edb0ab14574f1 Mon Sep 17 00:00:00 2001 From: Keith Bauer Date: Sun, 4 Nov 2018 13:12:28 +1300 Subject: [PATCH] Cocoa: Fix half of all key events for Caps Lock This adds reporting of those Caps Lock key events that cause the lock state to change. The full fix involving IOHID is being worked on in #1368. Related to #1368. Closes #1373. --- README.md | 1 + src/cocoa_window.m | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index ba34f9af..26aa7419 100644 --- a/README.md +++ b/README.md @@ -283,6 +283,7 @@ information on what to include when reporting a bug. - [EGL] Added support for `EGL_KHR_get_all_proc_addresses` (#871) - [EGL] Added support for `EGL_KHR_context_flush_control` - [EGL] Bugfix: The test for `EGL_RGB_BUFFER` was invalid +- [Cocoa] Bugfix: caps lock was not generating key events ## Contact diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 217588f7..db9935ce 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -235,6 +235,8 @@ static NSUInteger translateKeyToModifierFlag(int key) case GLFW_KEY_LEFT_SUPER: case GLFW_KEY_RIGHT_SUPER: return NSEventModifierFlagCommand; + case GLFW_KEY_CAPS_LOCK: + return NSEventModifierFlagCapsLock; } return 0;