Skip to content

Commit

Permalink
add no-modifier version of deviceinputtochar to lua input event
Browse files Browse the repository at this point in the history
with no route existing to go in the other direction in terms of input to char, this seemed the best option
(need this now because ctrl+buttons appears to give nonsense output)
  • Loading branch information
poco0317 committed Nov 12, 2021
1 parent 9c38e4e commit d2fced8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Etterna/Screen/Others/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ Screen::PassInputToLua(const InputEventPlus& input)
wctomb(s, INPUTMAN->DeviceInputToChar(input.DeviceI, true));
LuaHelpers::Push(L, std::string(1, s[0]));
lua_setfield(L, -2, "char");
char snm[MB_LEN_MAX];
wctomb(snm, INPUTMAN->DeviceInputToChar(input.DeviceI, false));
LuaHelpers::Push(L, std::string(1, snm[0]));
lua_setfield(L, -2, "charNoModifiers");
LuaHelpers::Push(
L, GameButtonToString(INPUTMAPPER->GetInputScheme(), input.MenuI));
lua_setfield(L, -2, "GameButton");
Expand Down

0 comments on commit d2fced8

Please sign in to comment.