mirror of https://github.com/libsdl-org/SDL.git
Handle Colemak swapping of CapsLock and Backspace
Fixes https://github.com/libsdl-org/SDL/issues/7853
This commit is contained in:
parent
c709385856
commit
66cb2153cc
|
|
@ -108,6 +108,18 @@ void WIN_UpdateKeymap(SDL_bool send_event)
|
|||
if (scancode == SDL_SCANCODE_UNKNOWN ||
|
||||
scancode == SDL_SCANCODE_DELETE ||
|
||||
(SDL_GetDefaultKeyFromScancode(scancode, SDL_KMOD_NONE) & SDLK_SCANCODE_MASK)) {
|
||||
|
||||
/* The Colemak mapping swaps Backspace and CapsLock */
|
||||
if (mods[m] == SDL_KMOD_NONE &&
|
||||
(scancode == SDL_SCANCODE_CAPSLOCK ||
|
||||
scancode == SDL_SCANCODE_BACKSPACE)) {
|
||||
vk = LOBYTE(MapVirtualKey(i, MAPVK_VSC_TO_VK));
|
||||
if (vk == VK_CAPITAL) {
|
||||
SDL_SetKeymapEntry(keymap, scancode, mods[m], SDLK_CAPSLOCK);
|
||||
} else if (vk == VK_BACK) {
|
||||
SDL_SetKeymapEntry(keymap, scancode, mods[m], SDLK_BACKSPACE);
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue