Skip to content

Commit

Permalink
Map pad delete to ALLEGRO_KEY_PAD_DELETE and the weird ISO section ke…
Browse files Browse the repository at this point in the history
…y 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.
  • Loading branch information
SiegeLordEx authored and SiegeLord committed Nov 21, 2024
1 parent 5c51d67 commit e652daf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/macosx/keybd.m
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit e652daf

Please sign in to comment.