Interrupt / systemshock

Shockolate - A minimalist and cross platform System Shock source port.
GNU General Public License v3.0
807 stars 65 forks source link

Alt modifier key doesn't work #209

Closed donnierussellii closed 5 years ago

donnierussellii commented 5 years ago

Code for handling Alt modifier (Option on Mac) is missing/faulty in kbcook.c

donnierussellii commented 5 years ago

As comments in the source suggested, I tried using SDL_TEXTINPUT in sdl_events.c to get the proper key for any keyboard layout. Events for CTRL'd and ALT'd keys don't go through, though. The event isn't triggered at all, in spite of example code provided here: https://stackoverflow.com/questions/41570751/how-to-correctly-handle-control-key-combinations-in-sdl2

Anyway, printable char keys that aren't modified with ctrl or alt will be correct.

donnierussellii commented 5 years ago

Now using text input events for printable char keys, so they should follow localized keyboards. Also enabled ALT modifier. If ALT'd key is a problem, it can be rebound to a different combination.

Changes in my PR #206 as part of user definable hotkey implementation.