Skip to content

Commit b3c265b

Browse files
Merge pull request livecode#5899 from runrevmark/bugfix-17657
[[ Bug 17657 ]] Fetch key codes of modifier keys in keysDown
2 parents 540d457 + 9140920 commit b3c265b

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

docs/notes/bugfix-17657.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Make sure modifier keys are recognised in keysDown()

engine/src/mac-core.mm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,11 @@ bool MCMacPlatformMapKeyCode(uint32_t p_mac_keycode, uint32_t p_modifier_flags,
14291429
else
14301430
r_keycode = keysyms[p_mac_keycode];
14311431

1432-
// r_keycode = s_mac_keycode_map[p_mac_keycode];
1432+
/* The keysyms and shift_keysyms arrays don't have entries for everything. If
1433+
* we get 0 here we fall back to the underlying list's entries. This means
1434+
* that modifier keys are correctly handled */
1435+
if (r_keycode == 0)
1436+
r_keycode = s_mac_keycode_map[p_mac_keycode];
14331437

14341438
return true;
14351439
}

0 commit comments

Comments
 (0)