# HG changeset patch # User koda # Date 1363546672 -3600 # Node ID 55539c550c33e640156ad9344b7ebc690c3796d7 # Parent b3756c3f65e5033a6ed9b35489510e0efe0ccbb9 use SDL keycode for shortcuts (doesn't fix layout issues) diff -r b3756c3f65e5 -r 55539c550c33 hedgewars/SDLh.pas --- a/hedgewars/SDLh.pas Sun Mar 17 18:42:28 2013 +0100 +++ b/hedgewars/SDLh.pas Sun Mar 17 19:57:52 2013 +0100 @@ -316,6 +316,8 @@ SDLK_BACKSPACE = 8; SDLK_RETURN = 13; SDLK_ESCAPE = 27; + SDLK_q = 113; + SDLK_w = 119; SDLK_DELETE = 127; SDLK_UP = 273; SDLK_DOWN = 274; diff -r b3756c3f65e5 -r 55539c550c33 hedgewars/uInputHandler.pas --- a/hedgewars/uInputHandler.pas Sun Mar 17 18:42:28 2013 +0100 +++ b/hedgewars/uInputHandler.pas Sun Mar 17 19:57:52 2013 +0100 @@ -58,7 +58,6 @@ RCTRL = $4000; var tkbd: array[0..cKbdMaxIndex] of boolean; - quitKeyCode, closeKeyCode: Byte; KeyNames: array [0..cKeyMaxIndex] of string[15]; CurrentBinds: TBinds; ControllerNumControllers: Integer; @@ -138,7 +137,7 @@ and (CurrentHedgehog^.BotLevel = 0); // ctrl/cmd + q to close engine and frontend -if(KeyDown and (code = quitKeyCode)) then +if(KeyDown and (code = SDLK_q)) then begin {$IFDEF DARWIN} if tkbd[KeyNameToCode('left_meta')] or tkbd[KeyNameToCode('right_meta')] then @@ -149,7 +148,7 @@ end; // ctrl/cmd + w to close engine -if(KeyDown and (code = closeKeyCode)) then +if(KeyDown and (code = SDLK_w)) then begin {$IFDEF DARWIN} // on OS X it this is expected behaviour @@ -159,7 +158,7 @@ if tkbd[KeyNameToCode('left_ctrl')] or tkbd[KeyNameToCode('right_ctrl')] then if ((CurrentBinds[KeyNameToCode('left_ctrl')] = '') or (CurrentBinds[KeyNameToCode('right_ctrl')] = '')) and - (CurrentBinds[closeKeyCode] = '') then + (CurrentBinds[SDLK_w] = '') then {$ENDIF} ParseCommand('forcequit', true); end; @@ -242,8 +241,6 @@ end; end; -quitKeyCode:= KeyNameToCode(_S'q'); -closeKeyCode:= KeyNameToCode(_S'w'); // get the size of keyboard array SDL_GetKeyState(@k);