GuiInputCtrl

consoledoc.h

A control that locks the mouse and reports all keyboard input events to script.

More...

GuiInputCtrl

bool

If true, onAxisEvent callbacks will be sent for SI_AXIS Move events (Default false).

bool

If true, break events for all devices will generate callbacks (Default false).

bool

If true, Make events will be sent for modifier keys (Default false).

Callbacks

void
onInputEvent(string device, string action, bool state)

Callback that occurs when an input is triggered on this control.

void
onAxisEvent(string device, string action, float axisValue)

Callback that occurs when an axis event is triggered on this control.

Detailed Description

A control that locks the mouse and reports all keyboard input events to script.

This is useful for implementing custom keyboard handling code, and most commonly used in Torque for a menu that allows a user to remap their in-game controls

new GuiInputCtrl(OptRemapInputCtrl)
{
   lockMouse = "0";
   position = "0 0";
   extent = "64 64";
   minExtent = "8 8";
   horizSizing = "center";
   vertSizing = "bottom";
   profile = "GuiInputCtrlProfile";
   visible = "1";
   active = "1";
   tooltipProfile = "GuiToolTipProfile";
   hovertime = "1000";
   isContainer = "0";
   canSave = "1";
   canSaveDynamicFields = "0";
};

GuiInputCtrl

bool sendAxisEvents 

If true, onAxisEvent callbacks will be sent for SI_AXIS Move events (Default false).

bool sendBreakEvents 

If true, break events for all devices will generate callbacks (Default false).

bool sendModifierEvents 

If true, Make events will be sent for modifier keys (Default false).

Callbacks

onInputEvent(string device, string action, bool state)

Callback that occurs when an input is triggered on this control.

Parameters:

device

The device type triggering the input, such as keyboard, mouse, etc

action

The actual event occuring, such as a key or button

state

True if the action is being pressed, false if it is being release

onAxisEvent(string device, string action, float axisValue)

Callback that occurs when an axis event is triggered on this control.

Parameters:

device

The device type triggering the input, such as mouse, joystick, gamepad, etc

action

The ActionMap code for the axis

axisValue

The current value of the axis