mirror of https://github.com/OpenTTD/OpenTTD
(svn r130) Change: hotkey for console is Backquote (the key left to '1', regardless of keyboard layout
parent
ce0f8a7bcd
commit
27e9f5888e
|
@ -108,7 +108,7 @@ static void IConsoleWndProc(Window *w, WindowEvent *e)
|
||||||
|
|
||||||
case WE_KEYPRESS:
|
case WE_KEYPRESS:
|
||||||
e->keypress.cont=false;
|
e->keypress.cont=false;
|
||||||
if (e->keypress.keycode == WKC_TAB)
|
if (e->keypress.keycode == WKC_BACKQUOTE)
|
||||||
{
|
{
|
||||||
IConsoleSwitch();
|
IConsoleSwitch();
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -73,7 +73,7 @@ static void SelectGameWndProc(Window *w, WindowEvent *e) {
|
||||||
}
|
}
|
||||||
case WE_KEYPRESS:
|
case WE_KEYPRESS:
|
||||||
switch(e->keypress.keycode) {
|
switch(e->keypress.keycode) {
|
||||||
case WKC_TAB: IConsoleSwitch(); break;
|
case WKC_BACKQUOTE: IConsoleSwitch(); break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
5
sdl.c
5
sdl.c
|
@ -344,8 +344,6 @@ static const VkMapping _vk_mapping[] = {
|
||||||
AM(SDLK_a,SDLK_z,'A','Z'),
|
AM(SDLK_a,SDLK_z,'A','Z'),
|
||||||
AM(SDLK_0,SDLK_9,'0','9'),
|
AM(SDLK_0,SDLK_9,'0','9'),
|
||||||
|
|
||||||
AS(SDLK_AMPERSAND, WKC_AMPERSAND), // mainly for french keyboards
|
|
||||||
|
|
||||||
AS(SDLK_ESCAPE, WKC_ESC),
|
AS(SDLK_ESCAPE, WKC_ESC),
|
||||||
AS(SDLK_BACKSPACE, WKC_BACKSPACE),
|
AS(SDLK_BACKSPACE, WKC_BACKSPACE),
|
||||||
|
|
||||||
|
@ -386,6 +384,9 @@ static uint32 ConvertSdlKeyIntoMy(SDL_keysym *sym)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check scancode for BACKQUOTE key, because we want the key left of "1", not anything else (on non-US keyboards)
|
||||||
|
if (sym->scancode == 49) key |= WKC_BACKQUOTE;
|
||||||
|
|
||||||
// META are the command keys on mac
|
// META are the command keys on mac
|
||||||
if (sym->mod & KMOD_META) key |= WKC_META;
|
if (sym->mod & KMOD_META) key |= WKC_META;
|
||||||
if (sym->mod & KMOD_SHIFT) key |= WKC_SHIFT;
|
if (sym->mod & KMOD_SHIFT) key |= WKC_SHIFT;
|
||||||
|
|
6
window.h
6
window.h
|
@ -124,8 +124,10 @@ enum WindowKeyCodes {
|
||||||
WKC_F11 = 43,
|
WKC_F11 = 43,
|
||||||
WKC_F12 = 44,
|
WKC_F12 = 44,
|
||||||
|
|
||||||
// Required for french keyboard
|
// backquote is the key left of "1"
|
||||||
WKC_AMPERSAND = 45,
|
// we only store this key here, no matter what character is really mapped to it
|
||||||
|
// on a particular keyboard. (US keyboard: ` and ~ ; German keyboard: ^ and °)
|
||||||
|
WKC_BACKQUOTE = 45,
|
||||||
|
|
||||||
// 0-9 are mapped to 48-57
|
// 0-9 are mapped to 48-57
|
||||||
// A-Z are mapped to 65-90
|
// A-Z are mapped to 65-90
|
||||||
|
|
Loading…
Reference in New Issue