mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 11:23:51 +00:00
Add a hack to support binding the console to a printable key (Fixes #371) and change default console key to morrowind default (GRAVE)
This commit is contained in:
parent
cf355d0fcb
commit
ebab911e44
1 changed files with 8 additions and 1 deletions
|
@ -498,7 +498,14 @@ namespace MWInput
|
||||||
|
|
||||||
void InputManager::keyPressed( const SDL_KeyboardEvent &arg )
|
void InputManager::keyPressed( const SDL_KeyboardEvent &arg )
|
||||||
{
|
{
|
||||||
|
// HACK: to make Morrowind's default keybinding for the console work without printing an extra "^" upon closing
|
||||||
|
// This assumes that SDL_TextInput events always come *after* the key event
|
||||||
|
// (which is somewhat reasonable, and hopefully true for all SDL platforms)
|
||||||
OIS::KeyCode kc = mInputManager->sdl2OISKeyCode(arg.keysym.sym);
|
OIS::KeyCode kc = mInputManager->sdl2OISKeyCode(arg.keysym.sym);
|
||||||
|
if (mInputBinder->getKeyBinding(mInputBinder->getControl(A_Console), ICS::Control::INCREASE)
|
||||||
|
== arg.keysym.sym
|
||||||
|
&& MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Console)
|
||||||
|
SDL_StopTextInput();
|
||||||
|
|
||||||
bool consumed = false;
|
bool consumed = false;
|
||||||
if (kc != OIS::KC_UNASSIGNED)
|
if (kc != OIS::KC_UNASSIGNED)
|
||||||
|
@ -873,7 +880,7 @@ namespace MWInput
|
||||||
defaultKeyBindings[A_ToggleWeapon] = SDL_GetKeyFromScancode(SDL_SCANCODE_F);
|
defaultKeyBindings[A_ToggleWeapon] = SDL_GetKeyFromScancode(SDL_SCANCODE_F);
|
||||||
defaultKeyBindings[A_ToggleSpell] = SDL_GetKeyFromScancode(SDL_SCANCODE_R);
|
defaultKeyBindings[A_ToggleSpell] = SDL_GetKeyFromScancode(SDL_SCANCODE_R);
|
||||||
defaultKeyBindings[A_QuickKeysMenu] = SDL_GetKeyFromScancode(SDL_SCANCODE_F1);
|
defaultKeyBindings[A_QuickKeysMenu] = SDL_GetKeyFromScancode(SDL_SCANCODE_F1);
|
||||||
defaultKeyBindings[A_Console] = SDL_GetKeyFromScancode(SDL_SCANCODE_F2);
|
defaultKeyBindings[A_Console] = SDL_GetKeyFromScancode(SDL_SCANCODE_GRAVE);
|
||||||
defaultKeyBindings[A_Run] = SDL_GetKeyFromScancode(SDL_SCANCODE_LSHIFT);
|
defaultKeyBindings[A_Run] = SDL_GetKeyFromScancode(SDL_SCANCODE_LSHIFT);
|
||||||
defaultKeyBindings[A_Sneak] = SDL_GetKeyFromScancode(SDL_SCANCODE_LCTRL);
|
defaultKeyBindings[A_Sneak] = SDL_GetKeyFromScancode(SDL_SCANCODE_LCTRL);
|
||||||
defaultKeyBindings[A_AutoMove] = SDL_GetKeyFromScancode(SDL_SCANCODE_Q);
|
defaultKeyBindings[A_AutoMove] = SDL_GetKeyFromScancode(SDL_SCANCODE_Q);
|
||||||
|
|
Loading…
Reference in a new issue