Libraries.Game.DesktopInput Documentation

This class automatically handles input and notifies event listeners for Games running on Desktop platforms (e.g. Windows, Mac). Most users shouldn't need access to this class. For users who want to test input themselves at specific times, use an InputMonitor instea

Inherits from: Libraries.Game.GameInput, Libraries.Language.Object

Summary

Actions Summary Table

ActionsDescription
AddControlActivationListener(Libraries.Interface.Events.ControlActivationListener listener)
AddInputTable(Libraries.Game.InputTable table)This action adds an InputTable to the GameInput.
AddKeyboardListener(Libraries.Interface.Events.KeyboardListener listener)This action will add a KeyboardListener to the DesktopInput.
AddMenuChangeListener(Libraries.Interface.Events.MenuChangeListener listener)
AddMouseListener(Libraries.Interface.Events.MouseListener listener)This action adds a MouseListener directly to the GameInput.
AddMouseMovementListener(Libraries.Interface.Events.MouseMovementListener listener)This action adds a MouseMovementListener directly to the GameInput.
AddMouseWheelListener(Libraries.Interface.Events.MouseWheelListener listener)This action adds a MouseWheelListener directly to the GameInput.
AddResizeListener(Libraries.Interface.Events.ResizeListener listener)This action will add a ResizeListener to the GameInput.
AddSelectionListener(Libraries.Interface.Events.SelectionListener listener)This action will add a SelectionListener to the GameInput.
AddTabChangeListener(Libraries.Interface.Events.TabChangeListener listener)
AddTextChangeListener(Libraries.Interface.Events.TextChangeListener listener)This action will add a TextChangeListener to the GameInput.
AddTextInputListener(Libraries.Interface.Events.TextInputListener listener)This action will add a TextInputListener to the DesktopInput.
AddTouchListener(Libraries.Interface.Events.TouchListener listener)This action adds a TouchListener directly to the GameInput.
AddTreeChangeListener(Libraries.Interface.Events.TreeChangeListener listener)
AddTreeTableChangeListener(Libraries.Interface.Events.TreeTableChangeListener listener)
AddWindowFocusListener(Libraries.Interface.Events.WindowFocusListener listener)
Compare(Libraries.Language.Object object)This action compares two object hash codes and returns an integer.
Equals(Libraries.Language.Object object)This action determines if two objects are equal based on their hash code values.
GetClickCount(Libraries.Interface.Item item)This action returns how many times the particular item has been clicked with the mouse in a short period of time, as used to determine things like double click events.
GetDefaultInputTable()This action returns the InputTable that the GameInput is using to automatically trigger Behaviors for certain input value
GetHashCode()This action gets the hash code for an object.
GetInputTable(text key)This action retrieves an InputTable with the matching identifier from the GameInput (if there is one).
GetKeyPressCount(integer keyCode)This action returns how many times a particular key on the keyboard (as represented by its key code, found in the KeyboardEvent class) has been pressed in a short period of time.
NotifyControlActivationListeners(Libraries.Interface.Events.ControlActivationEvent event)
NotifyMenuChangeListeners(Libraries.Interface.Events.MenuChangeEvent event)
NotifySelectionListeners(Libraries.Interface.Events.SelectionEvent event)This action will notify all SelectionListeners which have been added to the GameInput of the given SelectionEvent.
NotifyTabChangeListeners(Libraries.Interface.Events.TabChangeEvent event)
NotifyTextChangeListeners(Libraries.Interface.Events.TextChangeEvent event)This action will notify all TextChangeListeners which have been added to the GameInput of the given TextChangeEvent.
NotifyTreeChangeListeners(Libraries.Interface.Events.TreeChangeEvent event)
NotifyTreeTableChangeListeners(Libraries.Interface.Events.TreeTableChangeEvent event)
NotifyWindowFocusListeners(Libraries.Interface.Events.WindowFocusEvent event)
ProcessInputEvents()This action will identify all input events that have occurred and notify all relevant event listeners.
RemoveControlActivationListener(Libraries.Interface.Events.ControlActivationListener listener)
RemoveInputTable(text key)This action removes the InputTable with the matching identifier from the GameInput (if there is one).
RemoveKeyboardListener(Libraries.Interface.Events.KeyboardListener listener)This action will remove a KeyboardListener from the DesktopInput.
RemoveMenuChangeListener(Libraries.Interface.Events.MenuChangeListener listener)
RemoveMouseListener(Libraries.Interface.Events.MouseListener listener)This action removes a MouseListener from the GameInput.
RemoveMouseMovementListener(Libraries.Interface.Events.MouseMovementListener listener)This action removes a MouseMovementListener from the GameInput.
RemoveMouseWheelListener(Libraries.Interface.Events.MouseWheelListener listener)This action removes a MouseWheelListener from the GameInput.
RemoveResizeListener(Libraries.Interface.Events.ResizeListener listener)This action will remove a ResizeListener from the GameInput.
RemoveSelectionListener(Libraries.Interface.Events.SelectionListener listener)This action will remove a SelectionListener from the GameInput.
RemoveTabChangeListener(Libraries.Interface.Events.TabChangeListener listener)
RemoveTextChangeListener(Libraries.Interface.Events.TextChangeListener listener)This action will remove a TextChangeListener from the GameInput.
RemoveTextInputListener(Libraries.Interface.Events.TextInputListener listener)This action will remove a TextInputListener from the DesktopInput.
RemoveTouchListener(Libraries.Interface.Events.TouchListener listener)This action removes a TouchListener from the GameInput.
RemoveTreeChangeListener(Libraries.Interface.Events.TreeChangeListener listener)
RemoveTreeTableChangeListener(Libraries.Interface.Events.TreeTableChangeListener listener)
RemoveWindowFocusListener(Libraries.Interface.Events.WindowFocusListener listener)
SetDefaultInputTable(Libraries.Game.InputTable inputTable)This action sets the InputTable to be used by this GameInput.
SetLayers(Libraries.Containers.Array<Libraries.Game.Layer> array)This action sets a reference to the layers stored in the Game class that the GameInput needs to test input on.

Actions Documentation

AddControlActivationListener(Libraries.Interface.Events.ControlActivationListener listener)

Parameters

AddInputTable(Libraries.Game.InputTable table)

This action adds an InputTable to the GameInput. If at any point during the Game the currently focused Item has an input group that matches the identifier of the table, the table will be used to trigger Behavior

Parameters

AddKeyboardListener(Libraries.Interface.Events.KeyboardListener listener)

This action will add a KeyboardListener to the DesktopInput. The DesktopInput will notify the KeyboardListener if keys are pressed on the keyboard. This action is automatically called by the Game class when neede

Parameters

AddMenuChangeListener(Libraries.Interface.Events.MenuChangeListener listener)

Parameters

AddMouseListener(Libraries.Interface.Events.MouseListener listener)

This action adds a MouseListener directly to the GameInput. When the GameInput receives a mouse event, it will first check if any of the items added to the layers of the Game can handle the event - if none do, then all MouseListeners which are added directly to the GameInput will receive the even

Parameters

AddMouseMovementListener(Libraries.Interface.Events.MouseMovementListener listener)

This action adds a MouseMovementListener directly to the GameInput. When the GameInput receives a mouse event, it will first check if any of the items added to the layers of the Game can handle the event - if none do, then all MouseMovementListeners which are added directly to the GameInput will receive the even

Parameters

AddMouseWheelListener(Libraries.Interface.Events.MouseWheelListener listener)

This action adds a MouseWheelListener directly to the GameInput. When the GameInput receives a mouse event, it will first check if any of the items added to the layers of the Game can handle the event - if none do, then all MouseWheelListeners which are added directly to the GameInput will receive the even

Parameters

AddResizeListener(Libraries.Interface.Events.ResizeListener listener)

This action will add a ResizeListener to the GameInput. The GameInput will notify the ResizeListener when the size of the game space changes, e.g. the window changes size or goes fullscree

Parameters

AddSelectionListener(Libraries.Interface.Events.SelectionListener listener)

This action will add a SelectionListener to the GameInput. The GameInput will notify the SelectionListener whenever a selection changes.

Parameters

AddTabChangeListener(Libraries.Interface.Events.TabChangeListener listener)

Parameters

AddTextChangeListener(Libraries.Interface.Events.TextChangeListener listener)

This action will add a TextChangeListener to the GameInput. The GameInput will notify the TextChangeListener whenever text changes, such as in a TextBox.

Parameters

AddTextInputListener(Libraries.Interface.Events.TextInputListener listener)

This action will add a TextInputListener to the DesktopInput. The DesktopInput will notify the TextInputListener when the user provides text input to the game via the keyboar

Parameters

AddTouchListener(Libraries.Interface.Events.TouchListener listener)

This action adds a TouchListener directly to the GameInput. Note that touch isn't supported on desktop platforms - if the Game is running on a desktop platform, this action will be ignore

Parameters

AddTreeChangeListener(Libraries.Interface.Events.TreeChangeListener listener)

Parameters

AddTreeTableChangeListener(Libraries.Interface.Events.TreeTableChangeListener listener)

Parameters

AddWindowFocusListener(Libraries.Interface.Events.WindowFocusListener listener)

Parameters

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Example Code

Object o
        Object t
        integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smalle

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Example Code

use Libraries.Language.Object
        use Libraries.Language.Types.Text
        Object o
        Text t
        boolean result = o:Equals(

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

GetClickCount(Libraries.Interface.Item item)

This action returns how many times the particular item has been clicked with the mouse in a short period of time, as used to determine things like double click events. For desktop platforms, the period of time measured is based on the multiple click timer in the DesktopConfiguration. On platforms which don't support the mouse, this will always return 0.

Parameters

Return

integer: How many times the provided item has been recently clicked with the mous

GetDefaultInputTable()

This action returns the InputTable that the GameInput is using to automatically trigger Behaviors for certain input value

Return

Libraries.Game.InputTable:

GetHashCode()

This action gets the hash code for an object.

Example Code

Object o
        integer hash = o:GetHashCode

Return

integer: The integer hash code of the object.

GetInputTable(text key)

This action retrieves an InputTable with the matching identifier from the GameInput (if there is one). If there is no InputTable with this identifier, the action will return undefine

Parameters

Return

Libraries.Game.InputTable:

GetKeyPressCount(integer keyCode)

This action returns how many times a particular key on the keyboard (as represented by its key code, found in the KeyboardEvent class) has been pressed in a short period of time. For desktop platforms, this period of time is measured based on the multiple key press timer in the DesktopConfiguration. On platforms that don't support multiple key press events, this will always return 0.

Parameters

Return

integer: How many times the given key has recently been presse

NotifyControlActivationListeners(Libraries.Interface.Events.ControlActivationEvent event)

Parameters

NotifyMenuChangeListeners(Libraries.Interface.Events.MenuChangeEvent event)

Parameters

NotifySelectionListeners(Libraries.Interface.Events.SelectionEvent event)

This action will notify all SelectionListeners which have been added to the GameInput of the given SelectionEvent.

Parameters

NotifyTabChangeListeners(Libraries.Interface.Events.TabChangeEvent event)

Parameters

NotifyTextChangeListeners(Libraries.Interface.Events.TextChangeEvent event)

This action will notify all TextChangeListeners which have been added to the GameInput of the given TextChangeEvent.

Parameters

NotifyTreeChangeListeners(Libraries.Interface.Events.TreeChangeEvent event)

Parameters

NotifyTreeTableChangeListeners(Libraries.Interface.Events.TreeTableChangeEvent event)

Parameters

NotifyWindowFocusListeners(Libraries.Interface.Events.WindowFocusEvent event)

Parameters

ProcessInputEvents()

This action will identify all input events that have occurred and notify all relevant event listeners. For certain kinds of input, e.g. mouse or touch input, only listeners that were added to the active panel will be notified. This action is called automatically by the Game class, so most users will never need to use this action directl

RemoveControlActivationListener(Libraries.Interface.Events.ControlActivationListener listener)

Parameters

RemoveInputTable(text key)

This action removes the InputTable with the matching identifier from the GameInput (if there is one). If the InputTable is found, it will be returned - otherwise, the action returns undefine

Parameters

Return

Libraries.Game.InputTable:

RemoveKeyboardListener(Libraries.Interface.Events.KeyboardListener listener)

This action will remove a KeyboardListener from the DesktopInput. The DesktopInput will no longer notify the given KeyboardListener of KeyboardEvents. This action is automatically called by the Game class when neede

Parameters

RemoveMenuChangeListener(Libraries.Interface.Events.MenuChangeListener listener)

Parameters

RemoveMouseListener(Libraries.Interface.Events.MouseListener listener)

This action removes a MouseListener from the GameInput. It will no longer receive mouse events directly from the GameInpu

Parameters

RemoveMouseMovementListener(Libraries.Interface.Events.MouseMovementListener listener)

This action removes a MouseMovementListener from the GameInput. The listener will no longer receive events from the GameInpu

Parameters

RemoveMouseWheelListener(Libraries.Interface.Events.MouseWheelListener listener)

This action removes a MouseWheelListener from the GameInput. The listener will no longer receive events from the GameInpu

Parameters

RemoveResizeListener(Libraries.Interface.Events.ResizeListener listener)

This action will remove a ResizeListener from the GameInput. The GameInput will no longer notify the given ResizeListener of ResizeEvent

Parameters

RemoveSelectionListener(Libraries.Interface.Events.SelectionListener listener)

This action will remove a SelectionListener from the GameInput. The GameInput will no longer notify the given SelectionListener of selection changes.

Parameters

RemoveTabChangeListener(Libraries.Interface.Events.TabChangeListener listener)

Parameters

RemoveTextChangeListener(Libraries.Interface.Events.TextChangeListener listener)

This action will remove a TextChangeListener from the GameInput. The GameInput will no longer notify the given TextChangeListener of text changes.

Parameters

RemoveTextInputListener(Libraries.Interface.Events.TextInputListener listener)

This action will remove a TextInputListener from the DesktopInput. The DesktopInput will no longer notify the given TextInputListener of TextInputEvent

Parameters

RemoveTouchListener(Libraries.Interface.Events.TouchListener listener)

This action removes a TouchListener from the GameInput. Note that touch isn't supported on desktop platforms - if the Game is running on a desktop platform, this action will be ignore

Parameters

RemoveTreeChangeListener(Libraries.Interface.Events.TreeChangeListener listener)

Parameters

RemoveTreeTableChangeListener(Libraries.Interface.Events.TreeTableChangeListener listener)

Parameters

RemoveWindowFocusListener(Libraries.Interface.Events.WindowFocusListener listener)

Parameters

SetDefaultInputTable(Libraries.Game.InputTable inputTable)

This action sets the InputTable to be used by this GameInput. When the Game receives input, the GameInput will automatically trigger Behaviors from the InputTabl

Parameters

SetLayers(Libraries.Containers.Array<Libraries.Game.Layer> array)

This action sets a reference to the layers stored in the Game class that the GameInput needs to test input on. This action is automatically called by the Game, and should never be used by users directl

Parameters