Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Commands.DefaultBindingHelper Class Reference

Generate default bindings. More...

Inheritance diagram for Dragengine.Commands.DefaultBindingHelper:

Public Member Functions

Constructors
DefaultBindingHelper new ()
 Create default binding helper using BaseGameApp.
DefaultBindingHelper new (BindingManager bindingManager, CommandManager commandManager)
 Create default binding helper for binding manager.
General
BindingManager getBindingManager ()
 Binding manager to update once finished.
CommandManager getCommandManager ()
 Command manager to use for bindings.
void reset ()
 Remove all bindings.
void updateBindingManager (bool clear)
 Update binding manager with found bindings.
bool mouseBindWheel (int wheel, String command)
 Bind command to mouse wheel.
bool mouseBindWheel (int wheel, String up, String down)
 Bind commands to mouse wheel.
bool mouseBindLMR (String left, String middle, String right)
 Bind command to left, right and middle mouse buttons.
bool mouseBindAux (int number, String command)
 Bind command to auxiliary mouse button.
Keyboard Input Device
bool hasKeyboard ()
 Keyboard device is present.
InputDevice getKeyboard ()
 First keyboard device or null.
void keyboardClear ()
 Remove all keyboard bindings.
bool keyboardBindKeyCode (int keyCode, String command)
 Bind command to keyboard key matching key code.
bool keyboardBindKeyCode (int keyCode, InputEventKeyLocation location, String command)
 Bind command to keyboard key matching key code.
bool keyboardBindCharacter (int character, String command)
 Bind command to keyboard key matching character.
bool keyboardBindCharacter (int character, InputEventKeyLocation location, String command)
 Bind command to keyboard key matching character.
Gamepad Binding
bool hasGamepad ()
 Gamepad device is present.
InputDevice getGamepad ()
 First gamepad device or null.
void gamepadClear ()
 Remove all gamepad bindings.
bool gamepadBindStick (int stick, String horizontal, String vertical)
 Bind command to gamepad stick.
bool gamepadBindStick (InputDevice gamepad, int stick, String horizontal, String vertical)
 Bind command to gamepad stick.
bool gamepadBindStick (int stick, String left, String right, String up, String down)
 Bind command to gamepad stick.
bool gamepadBindStick (InputDevice gamepad, int stick, String left, String right, String up, String down)
 Bind command to gamepad stick.
bool gamepadBindHat (int hat, String horizontal, String vertical)
 Bind command to gamepad hat or directional pad.
bool gamepadBindHat (InputDevice gamepad, int hat, String horizontal, String vertical)
 Bind command to gamepad hat or directional pad.
bool gamepadBindHat (int hat, String left, String right, String up, String down)
 Bind command to gamepad hat or directional pad.
bool gamepadBindHat (InputDevice gamepad, int hat, String left, String right, String up, String down)
 Bind command to gamepad hat or directional pad.
bool gamepadBindTrigger (int trigger, String command)
 Bind command to gamepad trigger.
bool gamepadBindTrigger (InputDevice gamepad, int trigger, String command)
 Bind command to gamepad trigger.
bool gamepadBindTrigger (int trigger, String pull, String release)
 Bind command to gamepad trigger.
bool gamepadBindTrigger (InputDevice gamepad, int trigger, String pull, String release)
 Bind command to gamepad trigger.
bool gamepadBindButton (int button, String command)
 Bind command to gamepad button.
bool gamepadBindButton (InputDevice gamepad, int button, String command)
 Bind command to gamepad button.
bool gamepadBindButton (int button, InputDeviceButtonType type, String command)
 Bind command to gamepad button.
bool gamepadBindButton (InputDevice gamepad, int button, InputDeviceButtonType type, String command)
 Bind command to gamepad button.
bool gamepadBindAxis (int axis, String command)
 Bind command to gamepad axis.
bool gamepadBindAxis (InputDevice gamepad, int axis, String command)
 Bind command to gamepad axis.
VR Controller Binding
bool hasVRHand (bool rightHand)
 One or more VR hand controller device is present.
InputDevice getVRHand (bool rightHand)
 First VR hand controller device or null.
Array getAllVRHands (bool rightHand)
 All VR hand controller devices as Array of InputDevice.
bool bindButton (InputDevice device, int button, String command)
 Bind command to button on device.
bool bindButton (InputDevice device, InputDeviceButtonType type, int button, String command)
 Bind command to button on device.
bool bindTrigger (InputDevice device, InputDeviceAxisType type, int trigger, String name)
 Bind command to trigger.
bool bindTrigger (InputDevice device, InputDeviceAxisType type, int trigger, String pull, String release)
 Bind command to trigger.
bool bindStick (InputDevice device, InputDeviceAxisType type, int stick, String horizontal, String vertical, bool inverse)
 Bind command to joystick.
bool bindStick (InputDevice device, InputDeviceAxisType type, int stick, String horizontal, String vertical, bool inverseHorizontal, bool inverseVertical)
 Bind command to joystick.
bool bindStick (InputDevice device, InputDeviceAxisType type, int stick, String left, String right, String up, String down, bool inverse)
 Bind command to joystick.
bool bindStick (InputDevice device, InputDeviceAxisType type, int stick, String left, String right, String up, String down, bool inverseHorizontal, bool inverseVertical)
 Bind command to joystick.
void removeAllDeviceBindings (InputDevice device)
 Remove all bindings for device.

Public Attributes

Array pAxisBindings
BindingManager pBindingManager
CommandManager pCommandManager
InputDevice pMouse

Detailed Description

Generate default bindings.

Helper for games running for the first time requiring a useful initial binding configuration the user can then adjust. The problem with initial binding configuration is that the user does not tap the keys for bindings but the game has to add some reasonable bindings for input devices it has little knowledge about. This class provides a simple way to achieve this goal. It uses the buttonMatchingKeyCode and buttonMatchingKeyChar methods to find suitable bindings.

Upon creating an instance of DefaultBindingHelper the present input devices are examine for typical candidates. The first found mouse, keyboard and gamepad type input device is stored. The user can then query the devices for some parameters for example how many buttons and axes a gamepad has if present. For each device the user can then add a binding using key code and/or key char. The first key matching the parameters is added. If required the user can examine the return value to learn if the binding has been assigned or not. This can be used to try a fallback assignment or trying a different layout altogether.

All changes are recorded in the DefaultBindingHelper instance. Once suitable the user can apply the changes to the binding manager.

Member Function Documentation

◆ bindButton() [1/2]

bool Dragengine.Commands.DefaultBindingHelper.bindButton ( InputDevice device,
InputDeviceButtonType type,
int button,
String command )

Bind command to button on device.

Version
1.7
Parameters
deviceDevice containing axis.
buttonIndex of button to bind.
commandName of command to bind.
Returns
true if button is present on device and bound to command.

References keyboardBindCharacter().

◆ bindButton() [2/2]

bool Dragengine.Commands.DefaultBindingHelper.bindButton ( InputDevice device,
int button,
String command )

Bind command to button on device.

Parameters
deviceDevice containing axis.
buttonIndex of button to bind.
commandName of command to bind.
Returns
true if button is present on device and bound to command.

Referenced by gamepadBindHat(), gamepadBindTrigger(), and removeAllDeviceBindings().

◆ bindStick() [1/4]

bool Dragengine.Commands.DefaultBindingHelper.bindStick ( InputDevice device,
InputDeviceAxisType type,
int stick,
String horizontal,
String vertical,
bool inverse )

Bind command to joystick.

Version
1.6
Parameters
typeType of stick
stickNumber of stick of given type.
horizontalName of command to bind to horizontal movement or null.
verticalName of command to bind to vertical movement or null.
inverseTrue to invert both axes.
Returns
true if device is present and all commands have been bound.

References gamepadClear(), getGamepad(), and removeAllDeviceBindings().

Referenced by bindStick(), and removeAllDeviceBindings().

◆ bindStick() [2/4]

bool Dragengine.Commands.DefaultBindingHelper.bindStick ( InputDevice device,
InputDeviceAxisType type,
int stick,
String horizontal,
String vertical,
bool inverseHorizontal,
bool inverseVertical )

Bind command to joystick.

Version
1.34
Parameters
typeType of stick
stickNumber of stick of given type.
horizontalName of command to bind to horizontal movement or null.
verticalName of command to bind to vertical movement or null.
inverseHorizontalTrue to invert horizontal axis.
inverseVerticalTrue to invert vertical axis.
Returns
true if device is present and all commands have been bound.

◆ bindStick() [3/4]

bool Dragengine.Commands.DefaultBindingHelper.bindStick ( InputDevice device,
InputDeviceAxisType type,
int stick,
String left,
String right,
String up,
String down,
bool inverse )

Bind command to joystick.

Version
1.6
Parameters
typeType of stick.
stickNumber of stick of given type.
leftName of command to bind to left movement or null.
rightName of command to bind to right movement or null.
upName of command to bind to up movement or null.
downName of command to bind to down movement or null.
inverseTrue to invert both axes.
Returns
true if device is present and all commands have been bound.

References gamepadBindStick().

◆ bindStick() [4/4]

bool Dragengine.Commands.DefaultBindingHelper.bindStick ( InputDevice device,
InputDeviceAxisType type,
int stick,
String left,
String right,
String up,
String down,
bool inverseHorizontal,
bool inverseVertical )

Bind command to joystick.

Version
1.34
Parameters
typeType of stick.
stickNumber of stick of given type.
leftName of command to bind to left movement or null.
rightName of command to bind to right movement or null.
upName of command to bind to up movement or null.
downName of command to bind to down movement or null.
inverseHorizonalTrue to invert horizontal axis.
inverseVerticalTrue to invert vertical axis.
Returns
true if device is present and all commands have been bound.

References bindStick(), and gamepadBindStick().

◆ bindTrigger() [1/2]

bool Dragengine.Commands.DefaultBindingHelper.bindTrigger ( InputDevice device,
InputDeviceAxisType type,
int trigger,
String name )

Bind command to trigger.

Version
1.6
Parameters
Devicedevice.
typeType of trigger.
triggerNumber of trigger of given type.
nameName of command to bind to horizontal movement or null.
Returns
true if controller is present and command has been bound.

References pCommandManager.

Referenced by gamepadBindHat(), gamepadBindHat(), and removeAllDeviceBindings().

◆ bindTrigger() [2/2]

bool Dragengine.Commands.DefaultBindingHelper.bindTrigger ( InputDevice device,
InputDeviceAxisType type,
int trigger,
String pull,
String release )

Bind command to trigger.

Version
1.6
Parameters
Devicedevice.
typeType of trigger.
triggerNumber of trigger of given type.
pullName of command to bind to pull movement or null.
releaseName of command to bind to release movement or null.
Returns
true if device is present and all commands have been bound.

References hasGamepad().

◆ gamepadBindAxis() [1/2]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindAxis ( InputDevice gamepad,
int axis,
String command )

Bind command to gamepad axis.

Version
1.35
Parameters
axisNumber of axis starting with 0 for the first.
commandName of command to bind to horizontal movement or null.
Returns
true if gamepads are present and all commands have been bound.

References pCommandManager.

◆ gamepadBindAxis() [2/2]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindAxis ( int axis,
String command )

Bind command to gamepad axis.

Version
1.35
Parameters
axisNumber of axis starting with 0 for the first.
commandName of command to bind to horizontal movement or null.
Returns
true if gamepads are present and all commands have been bound.

References keyboardBindKeyCode().

Referenced by removeAllDeviceBindings().

◆ gamepadBindButton() [1/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindButton ( InputDevice gamepad,
int button,
InputDeviceButtonType type,
String command )

Bind command to gamepad button.

Version
1.35
Parameters
buttonNumber of button starting with 0 for the first.
typeType of button.
commandName of command to bind to button or null.
Returns
true if gamepad is present and command has been bound.

◆ gamepadBindButton() [2/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindButton ( InputDevice gamepad,
int button,
String command )

Bind command to gamepad button.

Version
1.35
Parameters
buttonNumber of button starting with 0 for the first.
commandName of command to bind to button or null.
Returns
true if gamepad is present and command has been bound.

References keyboardBindKeyCode().

◆ gamepadBindButton() [3/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindButton ( int button,
InputDeviceButtonType type,
String command )

Bind command to gamepad button.

Parameters
buttonNumber of button starting with 0 for the first.
typeType of button.
commandName of command to bind to button or null.
Returns
true if gamepad is present and command has been bound.

References pCommandManager.

◆ gamepadBindButton() [4/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindButton ( int button,
String command )

Bind command to gamepad button.

Parameters
buttonNumber of button starting with 0 for the first.
commandName of command to bind to button or null.
Returns
true if gamepad is present and command has been bound.

References removeAllDeviceBindings().

Referenced by removeAllDeviceBindings().

◆ gamepadBindHat() [1/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindHat ( InputDevice gamepad,
int hat,
String horizontal,
String vertical )

Bind command to gamepad hat or directional pad.

Version
1.35
Parameters
hatNumber of hat starting with 0 for the first.
horizontalName of command to bind to left/right press or null.
verticalName of command to bind to up/down press or null.
Returns
true if gamepad is present and all commands have been bound.

References bindTrigger(), mouseBindWheel(), and pMouse.

◆ gamepadBindHat() [2/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindHat ( InputDevice gamepad,
int hat,
String left,
String right,
String up,
String down )

Bind command to gamepad hat or directional pad.

Parameters
hatNumber of hat starting with 0 for the first.
leftName of command to bind to left press or null.
rightName of command to bind to right press or null.
upName of command to bind to up press or null.
downName of command to bind to down press or null.
Returns
true if gamepad is present and all commands have been bound.

References bindButton(), and pMouse.

◆ gamepadBindHat() [3/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindHat ( int hat,
String horizontal,
String vertical )

Bind command to gamepad hat or directional pad.

Parameters
hatNumber of hat starting with 0 for the first.
horizontalName of command to bind to left/right press or null.
verticalName of command to bind to up/down press or null.
Returns
true if gamepad is present and all commands have been bound.

References bindTrigger(), mouseBindWheel(), and pMouse.

Referenced by removeAllDeviceBindings().

◆ gamepadBindHat() [4/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindHat ( int hat,
String left,
String right,
String up,
String down )

Bind command to gamepad hat or directional pad.

Parameters
hatNumber of hat starting with 0 for the first.
leftName of command to bind to left press or null.
rightName of command to bind to right press or null.
upName of command to bind to up press or null.
downName of command to bind to down press or null.
Returns
true if gamepad is present and all commands have been bound.

References mouseBindLMR(), and pMouse.

◆ gamepadBindStick() [1/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindStick ( InputDevice gamepad,
int stick,
String horizontal,
String vertical )

Bind command to gamepad stick.

Version
1.35
Parameters
stickNumber of stick starting with 0 for the first.
horizontalName of command to bind to horizontal movement or null.
verticalName of command to bind to vertical movement or null.
Returns
true all commands have been bound.

References pCommandManager, and pMouse.

◆ gamepadBindStick() [2/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindStick ( InputDevice gamepad,
int stick,
String left,
String right,
String up,
String down )

Bind command to gamepad stick.

Version
1.35
Parameters
stickNumber of stick starting with 0 for the first.
leftName of command to bind to left movement or null.
rightName of command to bind to right movement or null.
upName of command to bind to up movement or null.
downName of command to bind to down movement or null.
Returns
true if gamepad is present and all commands have been bound.

◆ gamepadBindStick() [3/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindStick ( int stick,
String horizontal,
String vertical )

Bind command to gamepad stick.

Parameters
stickNumber of stick starting with 0 for the first.
horizontalName of command to bind to horizontal movement or null.
verticalName of command to bind to vertical movement or null.
Returns
true if gamepad is present and all commands have been bound.

References pMouse.

Referenced by bindStick(), bindStick(), and removeAllDeviceBindings().

◆ gamepadBindStick() [4/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindStick ( int stick,
String left,
String right,
String up,
String down )

Bind command to gamepad stick.

Parameters
stickNumber of stick starting with 0 for the first.
leftName of command to bind to left movement or null.
rightName of command to bind to right movement or null.
upName of command to bind to up movement or null.
downName of command to bind to down movement or null.
Returns
true if gamepad is present and all commands have been bound.

References pCommandManager, and pMouse.

◆ gamepadBindTrigger() [1/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindTrigger ( InputDevice gamepad,
int trigger,
String command )

Bind command to gamepad trigger.

Version
1.35
Parameters
triggerNumber of trigger starting with 0 for the first.
commandName of command to bind to horizontal movement or null.
Returns
true if gamepad is present and all commands have been bound.

References bindButton(), mouseBindAux(), and pMouse.

◆ gamepadBindTrigger() [2/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindTrigger ( InputDevice gamepad,
int trigger,
String pull,
String release )

Bind command to gamepad trigger.

Version
1.35
Parameters
triggerNumber of trigger starting with 0 for the first.
pullName of command to bind to pull or null.
releaseName of command to bind to release or null.
Returns
true if gamepad is present and all commands have been bound.

References getKeyboard(), and keyboardClear().

◆ gamepadBindTrigger() [3/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindTrigger ( int trigger,
String command )

Bind command to gamepad trigger.

Version
1.20
Parameters
triggerNumber of trigger starting with 0 for the first.
commandName of command to bind to horizontal movement or null.
Returns
true if gamepad is present and all commands have been bound.

Referenced by removeAllDeviceBindings().

◆ gamepadBindTrigger() [4/4]

bool Dragengine.Commands.DefaultBindingHelper.gamepadBindTrigger ( int trigger,
String pull,
String release )

Bind command to gamepad trigger.

Version
1.20
Parameters
triggerNumber of trigger starting with 0 for the first.
pullName of command to bind to pull or null.
releaseName of command to bind to release or null.
Returns
true if gamepad is present and all commands have been bound.

References hasKeyboard().

◆ gamepadClear()

void Dragengine.Commands.DefaultBindingHelper.gamepadClear ( )

Remove all gamepad bindings.

Referenced by bindStick().

◆ getAllVRHands()

Array Dragengine.Commands.DefaultBindingHelper.getAllVRHands ( bool rightHand)

All VR hand controller devices as Array of InputDevice.

Version
1.10
Parameters
rightHandTrue for right hand controller otherwise left hand controller.

References pCommandManager.

Referenced by removeAllDeviceBindings().

◆ getBindingManager()

BindingManager Dragengine.Commands.DefaultBindingHelper.getBindingManager ( )

Binding manager to update once finished.

References pBindingManager, and pCommandManager.

Referenced by updateBindingManager().

◆ getCommandManager()

CommandManager Dragengine.Commands.DefaultBindingHelper.getCommandManager ( )

Command manager to use for bindings.

References pAxisBindings.

Referenced by updateBindingManager().

◆ getGamepad()

InputDevice Dragengine.Commands.DefaultBindingHelper.getGamepad ( )

First gamepad device or null.

Referenced by bindStick().

◆ getKeyboard()

InputDevice Dragengine.Commands.DefaultBindingHelper.getKeyboard ( )

First keyboard device or null.

References updateBindingManager().

Referenced by gamepadBindTrigger().

◆ getVRHand()

InputDevice Dragengine.Commands.DefaultBindingHelper.getVRHand ( bool rightHand)

First VR hand controller device or null.

Version
1.6
Parameters
rightHandTrue for right hand controller otherwise left hand controller.

References keyboardBindCharacter().

Referenced by removeAllDeviceBindings().

◆ hasGamepad()

bool Dragengine.Commands.DefaultBindingHelper.hasGamepad ( )

Gamepad device is present.

References pMouse, and removeAllDeviceBindings().

Referenced by bindTrigger().

◆ hasKeyboard()

bool Dragengine.Commands.DefaultBindingHelper.hasKeyboard ( )

Keyboard device is present.

References pMouse, and updateBindingManager().

Referenced by gamepadBindTrigger().

◆ hasVRHand()

bool Dragengine.Commands.DefaultBindingHelper.hasVRHand ( bool rightHand)

One or more VR hand controller device is present.

Version
1.6
Parameters
rightHandTrue to check right hand controller otherwise left hand controller.

Referenced by removeAllDeviceBindings().

◆ keyboardBindCharacter() [1/2]

bool Dragengine.Commands.DefaultBindingHelper.keyboardBindCharacter ( int character,
InputEventKeyLocation location,
String command )

Bind command to keyboard key matching character.

Version
1.7

Tries to find key matching character. If found binding is added. Supports distinguishing between duplicate keys in different locations like left and right shift key.

Parameters
characterCharacter to find.
locationKey location.
commandName of command to bind.
Returns
true if matching key is present and bound to command.

References pMouse.

◆ keyboardBindCharacter() [2/2]

bool Dragengine.Commands.DefaultBindingHelper.keyboardBindCharacter ( int character,
String command )

Bind command to keyboard key matching character.

Tries to find key matching character. If found binding is added.

Parameters
characterCharacter to find.
commandName of command to bind.
Returns
true if matching key is present and bound to command.

References pMouse.

Referenced by bindButton(), and getVRHand().

◆ keyboardBindKeyCode() [1/2]

bool Dragengine.Commands.DefaultBindingHelper.keyboardBindKeyCode ( int keyCode,
InputEventKeyLocation location,
String command )

Bind command to keyboard key matching key code.

Version
1.7

Tries to find key matching key code. If found binding is added. Supports distinguishing between duplicate keys in different locations like left and right shift key.

Parameters
keyCodeKey code to find.
locationKey location.
commandName of command to bind.
Returns
true if matching button is present and bound to command.

References pBindingManager.

◆ keyboardBindKeyCode() [2/2]

bool Dragengine.Commands.DefaultBindingHelper.keyboardBindKeyCode ( int keyCode,
String command )

Bind command to keyboard key matching key code.

Tries to find key matching key code. If found binding is added.

Parameters
keyCodeKey code to find.
commandName of command to bind.
Returns
true if matching button is present and bound to command.

References pAxisBindings, pBindingManager, and updateBindingManager().

Referenced by gamepadBindAxis(), and gamepadBindButton().

◆ keyboardClear()

void Dragengine.Commands.DefaultBindingHelper.keyboardClear ( )

Remove all keyboard bindings.

References updateBindingManager().

Referenced by gamepadBindTrigger().

◆ mouseBindAux()

bool Dragengine.Commands.DefaultBindingHelper.mouseBindAux ( int number,
String command )

Bind command to auxiliary mouse button.

These are buttons 4 upwards if present. Typically 4 is "browse forward" and 5 is "browse backward" but gaming mice can have any number of additional buttons with different usage. Auxiliary buttons are usually not present and tend to be unsuitable for an initial binding configuration.

Parameters
numberNumber of auxiliary button starting with 0 for the first.
commandName of command to bind to mouse button or null.
Returns
true if mouse is present and command has been bound.

References pBindingManager.

Referenced by gamepadBindTrigger().

◆ mouseBindLMR()

bool Dragengine.Commands.DefaultBindingHelper.mouseBindLMR ( String left,
String middle,
String right )

Bind command to left, right and middle mouse buttons.

Parameters
leftName of command to bind to left mouse button or null.
middleName of command to bind to middle mouse button or null.
rightName of command to bind to right mouse button or null.
Returns
true if mouse is present and all commands have been bound.

References pAxisBindings, and pBindingManager.

Referenced by gamepadBindHat().

◆ mouseBindWheel() [1/2]

bool Dragengine.Commands.DefaultBindingHelper.mouseBindWheel ( int wheel,
String command )

Bind command to mouse wheel.

Parameters
wheelNumber of wheel starting with 0 for the first wheel.
commandName of command to bind to mouse wheel or null.
Returns
true if mouse is present and command has been bound.

References pAxisBindings, and reset().

Referenced by gamepadBindHat(), and gamepadBindHat().

◆ mouseBindWheel() [2/2]

bool Dragengine.Commands.DefaultBindingHelper.mouseBindWheel ( int wheel,
String up,
String down )

Bind commands to mouse wheel.

Parameters
wheelNumber of wheel starting with 0 for the first wheel.
upName of command to bind to up mouse wheel movement or null.
downName of command to bind to down mouse wheel movement or null.
Returns
true if mouse is present and all commands have been bound.

References pBindingManager, and updateBindingManager().

◆ new() [1/2]

DefaultBindingHelper Dragengine.Commands.DefaultBindingHelper.new ( )

Create default binding helper using BaseGameApp.

Stores the first mouse, keyboard and gamepad device found for quick access.

Parameters
bindingManagerBinding manager to update once finished.
commandManagerCommand manager to use for bindings.

References new().

Referenced by new(), and new().

◆ new() [2/2]

DefaultBindingHelper Dragengine.Commands.DefaultBindingHelper.new ( BindingManager bindingManager,
CommandManager commandManager )

Create default binding helper for binding manager.

Stores the first mouse, keyboard and gamepad device found for quick access.

Parameters
bindingManagerBinding manager to update once finished.
commandManagerCommand manager to use for bindings.

References new().

◆ removeAllDeviceBindings()

◆ reset()

void Dragengine.Commands.DefaultBindingHelper.reset ( )

Remove all bindings.

Referenced by mouseBindWheel().

◆ updateBindingManager()

void Dragengine.Commands.DefaultBindingHelper.updateBindingManager ( bool clear)

Update binding manager with found bindings.

Parameters
clearRemoves first all bindings from binding manager. Set to false to add and overwrite found bindings leaving other bindings intact.

References getBindingManager(), getCommandManager(), pBindingManager, and pCommandManager.

Referenced by getKeyboard(), hasKeyboard(), keyboardBindKeyCode(), keyboardClear(), and mouseBindWheel().

Member Data Documentation

◆ pAxisBindings

Array Dragengine.Commands.DefaultBindingHelper.pAxisBindings

◆ pBindingManager

◆ pCommandManager

◆ pMouse


The documentation for this class was generated from the following file: