diff --git a/binding-mri/input-binding.cpp b/binding-mri/input-binding.cpp index 024b0f9..671459e 100644 --- a/binding-mri/input-binding.cpp +++ b/binding-mri/input-binding.cpp @@ -127,7 +127,10 @@ static buttonCodes[] = { { "MOUSELEFT", Input::MouseLeft }, { "MOUSEMIDDLE", Input::MouseMiddle }, - { "MOUSERIGHT", Input::MouseRight } + { "MOUSERIGHT", Input::MouseRight }, + + { "LCTRL", Input::LCTRL }, + { "RCTRL", Input::RCTRL }, }; static elementsN(buttonCodes); diff --git a/scripts/Game_Player.rb b/scripts/Game_Player.rb index 3fad81a..60d50d5 100644 --- a/scripts/Game_Player.rb +++ b/scripts/Game_Player.rb @@ -36,10 +36,10 @@ class Game_Player < Game_Character return false end # If debug mode is ON and ctrl key was pressed - #if $debug and Input.press?(Input::CTRL) - # # Passable - # return true - #end + if Window_Settings.DebugIsEnabled and Input.press?(Input::LCTRL) + # Passable + return true + end super end #-------------------------------------------------------------------------- diff --git a/src/input.cpp b/src/input.cpp index d80525b..8cfdc88 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -234,7 +234,9 @@ static const KbBindingData staticKbBindings[] ={ { SDL_SCANCODE_F6, Input::F6 }, { SDL_SCANCODE_F7, Input::F7 }, { SDL_SCANCODE_F8, Input::F8 }, - { SDL_SCANCODE_F9, Input::F9 } + { SDL_SCANCODE_F9, Input::F9 }, + { SDL_SCANCODE_LCTRL, Input:LCTRL }, + { SDL_SCANCODE_RCTRL, Input:RCTRL } }; static elementsN(staticKbBindings); @@ -302,20 +304,17 @@ struct InputPrivate { bool triedExit; - struct - { + struct{ int active; Input::ButtonCode previous; } dir4Data; - struct - { + struct{ int active; } dir8Data; - InputPrivate(const RGSSThreadData &rtData) - { + InputPrivate(const RGSSThreadData &rtData){ initStaticKbBindings(); initMsBindings(); @@ -548,10 +547,8 @@ struct InputPrivate { if (dir4Data.previous != Input::None){ /* Check if prev still pressed */ - if (getState(dir4Data.previous).pressed) - { - for (size_t i = 0; i < 3; ++i) - { + if (getState(dir4Data.previous).pressed){ + for (size_t i = 0; i < 3; ++i){ Input::ButtonCode other = otherDirs[(dir4Data.previous/2)-1][i]; @@ -577,8 +574,7 @@ struct InputPrivate { dir4Data.previous = Input::None; } - void updateDir8() - { + void updateDir8(){ static const int combos[4][4] = { { 2, 1, 3, 0 }, { 1, 4, 0, 7 },