jsgroth / jgenesis

Sega Genesis / Sega CD / SNES / Master System / Game Gear emulator
MIT License
84 stars 4 forks source link

Problem with the inputs; key input is strictly specific #139

Open Blackgrowl opened 2 days ago

Blackgrowl commented 2 days ago

Hello, I've setup my Save States to be going from F1 to F8, to load I set it up so it's Left Shift + Fx. Only one problem; sometimes, I also use the Right Shift, but sadly it seems that jgenesis' inputting is strict, it has to be the Left Shift or else.

Is there any way I can make it use either Left or Right Shift?

Picture for reference if needed: image

jsgroth commented 1 day ago

This happens because keyboard mapping currently uses the SDL keycode directly, and SDL gives different keycodes to Left Shift and Right Shift because they're different physical keys on the keyboard. I agree that this is very unintuitive for modifier keys (Shift/Ctrl/Alt) - I can change it so that the emulator doesn't distinguish between left and right shift, and they're both just treated as Shift (and same for Ctrl and Alt mappings).

As a temporary workaround you could use Input Mapping #​2 to create a second mapping of Right Shift + Fx for each of these hotkeys so that either left or right shift will trigger the hotkey, but I do plan to fix this so that won't be necessary forever.

Blackgrowl commented 1 day ago

This happens because keyboard mapping currently uses the SDL keycode directly, and SDL gives different keycodes to Left Shift and Right Shift because they're different physical keys on the keyboard. I agree that this is very unintuitive for modifier keys (Shift/Ctrl/Alt) - I can change it so that the emulator doesn't distinguish between left and right shift, and they're both just treated as Shift (and same for Ctrl and Alt mappings).

As a temporary workaround you could use Input Mapping #​2 to create a second mapping of Right Shift + Fx for each of these hotkeys so that either left or right shift will trigger the hotkey, but I do plan to fix this so that won't be necessary forever.

Thank you, glad to know you will be fixing it. The temporary solution will serve for now, I really love this emulator and I hope to see it improve more and more over the years.