Skip to content

Commit

Permalink
Replace KeyPressed in LuaMenuController by KeyPressedSC (#268)
Browse files Browse the repository at this point in the history
KeyPressedSC executes luaInputReceiver->KeyPressedSC, which will try normal execute of KeyPress and KeyPressSC for lua functions
  • Loading branch information
FIr3baL authored May 7, 2022
1 parent 1e5705e commit 7ff404a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions rts/Menu/LuaMenuController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ bool CLuaMenuController::Draw()
}


int CLuaMenuController::KeyReleased(int k)
int CLuaMenuController::KeyReleasedSC(int keyScanCode, int keySym)
{
luaInputReceiver->KeyReleased(k);
luaInputReceiver->KeyReleasedSC(keyScanCode, keySym);
return 0;
}

int CLuaMenuController::KeyPressed(int k, bool isRepeat)
int CLuaMenuController::KeyPressedSC(int keyScanCode, int keySym, bool isRepeat)
{
luaInputReceiver->KeyPressed(k, isRepeat);
luaInputReceiver->KeyPressedSC(keyScanCode, keySym, isRepeat);
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions rts/Menu/LuaMenuController.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class CLuaMenuController : public CGameController

static bool ActivateInstance(const std::string& msg);

int KeyReleased(int k) override;
int KeyPressed(int k, bool isRepeat) override;
int KeyPressedSC(int keyScanCode, int keySym, bool isRepeat);
int KeyReleasedSC(int keyScanCode, int keySym);
int TextInput(const std::string& utf8Text) override;
int TextEditing(const std::string& utf8, unsigned int start, unsigned int length) override;

Expand Down

0 comments on commit 7ff404a

Please sign in to comment.