OverviewSingleDeprecated

jsx3.gui

class HotKey

Object
->jsx3.lang.Object
  ->jsx3.gui.HotKey

All Implemented Interfaces:

jsx3.util.EventDispatcher

class HotKey
extends jsx3.lang.Object
Encapsulates a keydown event listener that is invoked by a certain combination of keys pressed simultaneously.

Since:

3.2

See Also:

jsx3.gui.Interactive.registerHotKey(), jsx3.gui.Form.doKeyBinding()

Field Summary
static String
WAS_INVOKED
Event type published just after a hot key is invoked.
Method Summary
void
Destroys this hot key.
int
Returns the keycode that this hot key responds to.
Object
invoke(objThis : Object, arrArgs : Array<Object>)
Invokes this hot key by executing its callback function.
boolean
Returns whether this hot key had been destoyed.
boolean
Returns whether this hot key is enabled.
boolean
isMatch(objEvent : jsx3.gui.Event)
Returns whether this hot key should be invoked for the keydown event objEvent.
static int
Converts the string representation of a keyboard key to an integer keycode.
void
setEnabled(bEnabled : boolean)
Sets whether this hot key is enabled.
String
static jsx3.gui.HotKey
valueOf(strKey : String, fctCallback : Function)
Methods Inherited From jsx3.util.EventDispatcher
publish, subscribe, unsubscribe, unsubscribeAll
Methods Inherited From jsx3.lang.Object
clone, equals, eval, getClass, getInstanceOf, getInstanceOfClass, getInstanceOfPackage, instanceOf, isInstanceOf, isSubclassOf, jsxmix, jsxsuper, jsxsupermix, setInstanceOf
Field Detail

WAS_INVOKED

static final String WAS_INVOKED
Event type published just after a hot key is invoked.
Method Detail

destroy

void destroy()
Destroys this hot key. Once a hot key is destroyed it cannot be invoked again.

getKeyCode

int getKeyCode()
Returns the keycode that this hot key responds to.

Returns:

 

invoke

Object invoke(objThis : Object, arrArgs : Array<Object>)
Invokes this hot key by executing its callback function. This hot key also publishes a WAS_INVOKED event through the event dispatcher interface.

Parameters:

objThis
arrArgs

Returns:

this method returns whatever value was returned by the hot key callback function.  

isDestroyed

boolean isDestroyed()
Returns whether this hot key had been destoyed.

Returns:

 

isEnabled

boolean isEnabled()
Returns whether this hot key is enabled.

Returns:

 

isMatch

boolean isMatch(objEvent : jsx3.gui.Event)
Returns whether this hot key should be invoked for the keydown event objEvent.

Parameters:

objEvent

Returns:

 

keyDownCharToCode

static int keyDownCharToCode(strChar : String)
Converts the string representation of a keyboard key to an integer keycode. This keycode will match the keycode value of a jsx3.gui.Event of type keydown.

The following string representations are supported:

Parameters:

strCharthe string representation of a key.

Returns:

the keycode.  

setEnabled

void setEnabled(bEnabled : boolean)
Sets whether this hot key is enabled. Hot keys may be turned off temporarily by sending false to this method.

Parameters:

bEnabled

toString

String toString()

Returns:

 

Overrides:

toString in jsx3.lang.Object

valueOf

static jsx3.gui.HotKey valueOf(strKey : String, fctCallback : Function)

Parameters:

strKey
fctCallback

Returns: