InputHandler

Converts and redirects inputs as events.

Constructors

this
this()

CTOR. Detects joysticks upon construction. IMPORTANT: Only a single instance of this class!

Destructor

~this
~this()
Undocumented in source.

Members

Aliases

CodeTreeSet
alias CodeTreeSet = TreeMap!(InputBinding, void)
Undocumented in source.
InputBindingLookupTree
alias InputBindingLookupTree = TreeMap!(BindingCode, CodeTreeSet)
Undocumented in source.
JoyInfoMap
alias JoyInfoMap = TreeMap!(int, JoyInfo)
Undocumented in source.
JoyMap
alias JoyMap = TreeMap!(int, SDL_Joystick*)
Undocumented in source.

Enums

StatusFlags
enum StatusFlags
Undocumented in source.

Functions

addBinding
void addBinding(BindingCode bc, InputBinding ib)

Adds a single inputbinding to the inputhandler.

detectJoys
void detectJoys()

Detects all connected joysticks.

expectAnyKeyEvent
void expectAnyKeyEvent()

Enables an anykey event for once.

recordEvent
void recordEvent(InputBinding code, bool delConflKeys, bool delConflCodes, bool cancelOnSysEsc, bool allowMouseEvents)

Initializes event recording.

removeBinding
void removeBinding(BindingCode bc, InputBinding ib)

Removes a single inputbinding from the inputhandler.

removeJoy
void removeJoy(int i)

Removes info related to disconnected joysticks.

replaceLookupTree
InputBindingLookupTree replaceLookupTree(InputBindingLookupTree newTree)

Replaces the keycode lookup tree. Returns a copy of the current one as a backup.

startTextInput
void startTextInput(TextInputListener listener, bool reportTextEditingEvents, Box textEditingArea)

Starts text input handling.

stopTextInput
void stopTextInput()

Stops text input handling.

test
void test()

Tests for input.

Static functions

getSysEscKey
BindingCode getSysEscKey()

Returns a default SysEsc binding.

Static variables

anykeyCode
uint anykeyCode;

Code that is emmitted on an any key event.

sysescCode
uint sysescCode;

Code that is emmitted on a system escape key (keyboard Esc key, joystick start button, etc) event.

Structs

JoyInfo
struct JoyInfo

Contains data related to joysticks.

Variables

inputListener
InputListener inputListener;

Passes all codes from keybindings to this interface. Multiple listeners at once are removed from newer versions to reduce overhead. Functionality can be restored with an event hub.

inputLookup
InputBindingLookupTree inputLookup;

The main input lookup tree.

joyInfo
JoyInfoMap joyInfo;

Contains info related to each joystick

joysticks
JoyMap joysticks;

Contains pointers related to joystick handling

mouseListener
MouseListener mouseListener;

Passes all mouse events to this interface. Multiple listeners at once are removed from newer versions to reduce overhead. Functionality can be restored with an event hub.

recordedCode
InputBinding recordedCode;

The currently recorded code.

statusFlags
uint statusFlags;

Contains info about the current status of the Input Handler. See the enum StatusFlags for more info.

systemEventListener
SystemEventListener systemEventListener;

Passes all system events to this interface. Multiple listeners at once are removed from newer versions to reduce overhead. Functionality can be restored with an event hub.

textInputListener
TextInputListener textInputListener;

Passes all text input events to this interface. Only a single listener should get text input at once.

Meta