Opened 10 years ago

Closed 4 years ago

Last modified 4 years ago

#2850 closed defect (fixed)

SDL2: Hotkey behavior differences with non-QWERTY keyboard layouts

Reported by: historic_bruno Owned by: wraitii
Priority: Should Have Milestone: Alpha 24
Component: Core engine Keywords:
Cc: Patch:

Description

Most noticeable with AZERTY keyboards, the default hotkeys for e.g. idle workers no longer work in SDL2. Thinking about it, the best solution may be to have our hotkeys work on the physical position of the keys, not their visible value, but really that needs a whole new way to configure hotkeys.

A workaround is to simply redefine these hotkeys for non-QWERTY keyboards, but note what works for SDL1 (probably Linux) may not work for SDL2 (Windows and OS X).

Change History (3)

comment:1 by fcxSanya, 9 years ago

I experience the opposite behavior with Russian layout: if the game is linked with SDL1.2 (tested on Ubuntu with Alpha 18 from PPA) hotkeys stop working when I switch to Russian layout, while with SDL2 (on both Ubuntu and Windows) hotkeys are working fine.

comment:2 by wraitii, 4 years ago

Owner: set to wraitii
Resolution: fixed
Status: newclosed

In 24215:

Let players remap hotkeys in-game, fix default hotkeys being qwerty-specific.

  • Provide a "Hotkey" screen to let players remap hotkeys in-game using a convenient setup.
  • Make all .cfg hotkeys refer to scancodes (i.e. position on the keyboard), so that default hotkeys now translate correctly for AZERTY, QWERTZ and other layouts.
  • 'BackSpace' is now an alias for 'Delete', and works for killing units. This fixes #1917, as macs don't have a proper delete key and would need to use Fn+Del otherwise. This shifts "timewarp" to Shift+BackSpace.

Functionally, this switches hotkeys to scancodes, as that makes more sense (they are combinations of key positions, not actual text output).
SDL includes are cleaned and key names are reused.

Fixes #2850, Fixes #2604, Refs #1810, Fixes #1917.

Follows work in rP19624.

Various diffs tested by: Angen, Stan, Freagarach

Comments by: Nescio

Differential Revision: https://code.wildfiregames.com/D2814

comment:3 by Stan, 4 years ago

Milestone: BacklogAlpha 24
Note: See TracTickets for help on using tickets.