From e652daf9c75f81bb1da94084a04fe2b0ed7abed4 Mon Sep 17 00:00:00 2001 From: Pavel Sountsov Date: Sun, 10 Nov 2024 13:59:13 -0800 Subject: [PATCH] Map pad delete to ALLEGRO_KEY_PAD_DELETE and the weird ISO section key to ALLEGRO_KEY_BACKSLASH2 on MacOS. The first is uncontroversial. The second is unclear, but perhaps a decent choice? https://discussions.apple.com/thread/8133633?sortBy=rank says that the Usage ID of that key is 0x64. https://github.com/tmk/tmk_keyboard/wiki/USB:-HID-Usage-Table#note-9 says that that usage maps to the international backslash key. Not having a physical keyboard, I cannot confirm one way or another. One snag is that there's https://keyshorts.com/blogs/blog/37615873-how-to-identify-macbook-keyboard-localization#norwegian which has both the section key (in the top left) and the internaltional tab key (to the right of left shift). I don't know what the expectation for those keys, or what they code would do for them. Not having a physical keyboard, I cannot confirm one way or another. Still, perhaps this is a better situation than before, where the key was unmapped entirely. Fixes #1523. --- src/macosx/keybd.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/macosx/keybd.m b/src/macosx/keybd.m index 74df9c32f..11e05e19f 100644 --- a/src/macosx/keybd.m +++ b/src/macosx/keybd.m @@ -155,7 +155,7 @@ static void _handle_key_release(ALLEGRO_DISPLAY* dpy, int modifiers, int scancod { /* 0x00 */ ALLEGRO_KEY_A, ALLEGRO_KEY_S, ALLEGRO_KEY_D, ALLEGRO_KEY_F, /* 0x04 */ ALLEGRO_KEY_H, ALLEGRO_KEY_G, ALLEGRO_KEY_Z, ALLEGRO_KEY_X, - /* 0x08 */ ALLEGRO_KEY_C, ALLEGRO_KEY_V, 0, ALLEGRO_KEY_B, + /* 0x08 */ ALLEGRO_KEY_C, ALLEGRO_KEY_V, ALLEGRO_KEY_BACKSLASH2, ALLEGRO_KEY_B, /* 0x0c */ ALLEGRO_KEY_Q, ALLEGRO_KEY_W, ALLEGRO_KEY_E, ALLEGRO_KEY_R, /* 0x10 */ ALLEGRO_KEY_Y, ALLEGRO_KEY_T, ALLEGRO_KEY_1, ALLEGRO_KEY_2, /* 0x14 */ ALLEGRO_KEY_3, ALLEGRO_KEY_4, ALLEGRO_KEY_6, ALLEGRO_KEY_5, @@ -169,7 +169,7 @@ static void _handle_key_release(ALLEGRO_DISPLAY* dpy, int modifiers, int scancod /* 0x34 */ ALLEGRO_KEY_ENTER, ALLEGRO_KEY_ESCAPE, 0, ALLEGRO_KEY_COMMAND, /* 0x38 */ ALLEGRO_KEY_LSHIFT, ALLEGRO_KEY_CAPSLOCK, ALLEGRO_KEY_ALT, ALLEGRO_KEY_LEFT, /* 0x3c */ ALLEGRO_KEY_RIGHT, ALLEGRO_KEY_DOWN, ALLEGRO_KEY_UP, 0, - /* 0x40 */ 0, ALLEGRO_KEY_FULLSTOP, 0, ALLEGRO_KEY_PAD_ASTERISK, + /* 0x40 */ 0, ALLEGRO_KEY_PAD_DELETE, 0, ALLEGRO_KEY_PAD_ASTERISK, /* 0x44 */ 0, ALLEGRO_KEY_PAD_PLUS, 0, ALLEGRO_KEY_NUMLOCK, /* 0x48 */ 0, 0, 0, ALLEGRO_KEY_PAD_SLASH, /* 0x4c */ ALLEGRO_KEY_PAD_ENTER,0, ALLEGRO_KEY_PAD_MINUS, 0,