gamelib.input

module ‘gamelib.input’

Source file: prog/tools/dargbox/gamelib/input.cpp

Usage:

let { get_button_state, get_mouse_pos, get_joystick_axis } = require("gamelib.input")

or:

from "gamelib.input" import *
//'gamelib.input' exports:
{
  function get_button_state(arg0): integer_or_float or string -> _undocumented_
  function get_mouse_pos()
  function get_joystick_axis(arg0): integer_or_float -> _undocumented_
}
function get_button_state(arg0)
Arguments:
  • arg0 (integer_or_float or string()) – autodoc from typemask/paramscheck

nparamscheck:2

typecheck mask: any_type, integer_or_float or string

function get_mouse_pos()
function get_joystick_axis(arg0)
Arguments:
  • arg0 (integer_or_float()) – autodoc from typemask/paramscheck

nparamscheck:2

typecheck mask: any_type, integer_or_float

/;

dag::ConstSpan<FastStrMapT<darg::Hotkeys::EncodedKey>::Entry> buttonsRawSlice = btn_name_map.getMapRaw(); Sqrat::Table buttonNames(vm); Sqrat::Table buttonIds(vm); for (auto &e : buttonsRawSlice) {

buttonIds.SetValue(e.name, e.id); buttonNames.SetValue(e.id, e.name);

} buttonIds.FreezeSelf(); buttonNames.FreezeSelf(); exports.SetValue(“buttonIds”, buttonIds); exports.SetValue(“buttonNames”, buttonNames);

module_mgr->addNativeModule(“gamelib.input”, exports);

}

} // namespace input

} // namespace gamelib