Hello there, the question says it but let me elaborate. I'm working on a menu for button remapping but different keyboard layouts are currently killing me.

Example: Scancode 125 (KEY_BRACERIGHT) on english keyboards corresponds to the } -key But on for example a german keyboard it corresponds to the ´ -key.

This does affect all keys that are not numbers or the basic latin letters (A-Z, a-z and 0-9). So umlauts, punctuation characters, accents, etc are affected.

What i'm not looking for:

  • char(scancode) as it just returns the ascii sign related to the scancode value. so 125 becomes } .
  • OS.get_scancode_string is also not what i'm looking for as it only returns the english name of the key based on the english keyboard layout.
  • InputEventKey.unicode is affected by modifiers like shift or alt and therefore also not a viable option.

What i'm looking for:

I want a way to get the ´-sign when i'm pressing the key with the scancode 125 and using a german keyboard layout. I want a way to get the }-sign when i'm pressing the key with the scancode 125 and using an english keyboard layout. I want a way to get the corresponding sign when i'm pressing the key with the scancode 125 and using another keyboard layout.

I hope someone can help me. Deccir

9 months later
a year later