PaulStoffregen / PS2Keyboard

PS/2 Keyboard Library for Arduino
http://www.pjrc.com/teensy/td_libs_PS2Keyboard.html
147 stars 57 forks source link

Wrong handling of altgr keymaps #38

Closed slviajero closed 2 years ago

slviajero commented 2 years ago

There seems to be a bug in the library in handling of altgr on systems that use progmem. The altgr part of the keymap doesn't work in German.

Looking at the code in line 489 the reason is clear:

' } else if ((state & ALTGR) && keymap->uses_altgr) {'

tries to access keymap->usess_altgr in PROGMEM without properly accessing it through the function pgm_read_byte(). The code line should read

' } else if ((state & ALTGR) && pgm_read_byte(keymap->uses_altgr) ) {'

instead. This works flawlessly.

PaulStoffregen commented 2 years ago

fixed https://github.com/PaulStoffregen/PS2Keyboard/commit/1cb0eee31b57711f86e0da251999b712abb607c1