macOS: Fix macos_option_as_alt not working when caps lock is engaged

Fixes #7836
This commit is contained in:
Kovid Goyal 2024-09-09 10:18:04 +05:30
parent ae26bf7a62
commit c166589150
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 0 deletions

View file

@ -81,6 +81,8 @@ Detailed list of changes
- macOS: Fix shortcuts that become entries in the global menubar being reported as removed shortcuts in the debug output
- macOS: Fix :opt:`macos_option_as_alt` not working when :kbd:`caps lock` is engaged (:iss:`7836`)
0.36.2 [2024-09-06]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -898,6 +898,7 @@ static GLFWwindow *apple_preserve_common_context = NULL;
static int
filter_option(int key UNUSED, int mods, unsigned int native_key UNUSED, unsigned long flags) {
mods &= ~(GLFW_MOD_NUM_LOCK | GLFW_MOD_CAPS_LOCK);
if ((mods == GLFW_MOD_ALT) || (mods == (GLFW_MOD_ALT | GLFW_MOD_SHIFT))) {
if (OPT(macos_option_as_alt) == 3) return 1;
if (cocoa_alt_option_key_pressed(flags)) return 1;