lgblgblgb / xemu

Emulations (running on Linux/Unix/Windows/macOS, utilizing SDL2) of some - mainly - 8 bit machines, including the Commodore LCD, Commodore 65, and the MEGA65 as well.
https://github.com/lgblgblgb/xemu/wiki
GNU General Public License v2.0
207 stars 32 forks source link

MEGA65: Turkish keybinds do not work #371

Closed emir4169 closed 1 year ago

emir4169 commented 1 year ago

Describe the bug When i type " in my keyboard, it comes out as left arrow in MEGA65 Used version of the project Latest (for when this issue was made)

To Reproduce Steps to reproduce the behavior. As steps as required, do not try to squeeze everything into one step.

  1. be turkish
  2. use turkish keyboard
  3. try to type "PRINT "HELLO"" bug encountered

Expected behavior Writes "

Screenshots image

Computer/Device (please complete the following information):

Additional context The remaining extra turkish keys can be used for rebindable functions (including multiple keys at once!)

lgblgblgb commented 1 year ago

@emir4169 This is perfectly normal (though indeed, very annoying). Xemu uses scancodes based on US layout. Thus, if you have national keyboard layout, you need a custom keymap file yourself. Unfortunately there is no way around this is how SDL2 works (what Xemu uses). To be more specific: Xemu uses positional keymapping, ie tries to mimic keys as would be on a real MEGA65. For example " is of course shift-2. Other than SDL2, you can think about this, that the ROM (of MEGA65) scans the keyboard matrix and want to check if shift is pressed and 2 is pressed to have " then. With custom keymap file you can remap keys but only keys. What it means, that if you want to remap " it's not possible at all, since " is not a key. It's shifted 2 for real, so you move key 2 then, and " will move with it, as it's only a secondary function of key 2 (but not a key alone).