Add bindings to select the next menu element

pull/3235/head
Zackhasacat 1 month ago
parent 6491bb4910
commit a29be8909d

@ -214,6 +214,12 @@ namespace MWLua
input->setGamepadGuiCursorEnabled(v);
MWBase::Environment::get().getWindowManager()->setCursorActive(v);
};
api["_selectNextMenuElement"] = []() {
MWBase::Environment::get().getWindowManager()->injectKeyPress(MyGUI::KeyCode::Period, 0, false);
};
api["_selectPrevMenuElement"] = []() {
MWBase::Environment::get().getWindowManager()->injectKeyPress(MyGUI::KeyCode::Slash, 0, false);
};
api["getMouseMoveX"] = [input]() { return input->getMouseMoveX(); };
api["getMouseMoveY"] = [input]() { return input->getMouseMoveY(); };
api["getAxisValue"] = [input](int axis) {

@ -25,5 +25,17 @@ return {
setGamepadCursorActive = function(state)
input._setGamepadCursorActive(state)
end,
--- Sends an event to the interface to select the next menu element
-- @function [parent=#GamepadControls] selectNextMenuElement
selectNextMenuElement = function(state)
input._selectNextMenuElement()
end,
--- Sends an event to the interface to select the next menu element
-- @function [parent=#GamepadControls] selectPrevMenuElement
selectPrevMenuElement = function(state)
input._selectPrevMenuElement()
end,
}
}

Loading…
Cancel
Save