mirror of
https://github.com/johndoe6345789/SDL3CPlusPlus.git
synced 2026-04-30 00:24:59 +00:00
feat: Implement gamepad support and audio control enhancements in input and audio services
This commit is contained in:
@@ -219,6 +219,20 @@ void GuiScriptService::UpdateGuiInput(const GuiInputSnapshot& input) {
|
||||
lua_pushnumber(L, input.wheel);
|
||||
lua_call(L, 2, 0);
|
||||
|
||||
lua_getfield(L, stateIndex, "setGamepad");
|
||||
if (lua_isfunction(L, -1)) {
|
||||
lua_pushvalue(L, stateIndex);
|
||||
lua_pushboolean(L, input.gamepadConnected);
|
||||
lua_pushnumber(L, input.gamepadLeftX);
|
||||
lua_pushnumber(L, input.gamepadLeftY);
|
||||
lua_pushnumber(L, input.gamepadRightX);
|
||||
lua_pushnumber(L, input.gamepadRightY);
|
||||
lua_pushboolean(L, input.gamepadTogglePressed);
|
||||
lua_call(L, 7, 0);
|
||||
} else {
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
|
||||
if (!input.textInput.empty()) {
|
||||
lua_getfield(L, stateIndex, "addTextInput");
|
||||
lua_pushvalue(L, stateIndex);
|
||||
|
||||
Reference in New Issue
Block a user