Package | com.yworks.canvas.input |
Class | public class KeyboardInputMode |
Inheritance | KeyboardInputMode AbstractConcurrentInputMode AbstractInputMode flash.events.EventDispatcher |
Subclasses | NavigationInputMode |
IInputMode
that recognizes simple key events and invokes
a registered handler.
Method | Defined By | ||
---|---|---|---|
addHandler(eventRecognizer:Function, handler:Function):void
Adds a given handler to this instance that will be triggered if the
given eventRecognizer recognizes a KeyboardEvent that has been
triggered by the canvas component. | KeyboardInputMode | ||
cancel():void [override]
Releases the mutex if this input mode currently
owns the mutex. | AbstractConcurrentInputMode | ||
clearHandlers(eventRecognizer:Function = null):void
Removes all handlers that have been registered under the given recognizer. | KeyboardInputMode | ||
dispose():void [override]
Disposes this input mode. | KeyboardInputMode | ||
getHandlers(eventRecognizer:Function):Iterator
Returns all handlers registered using the given recognizer. | KeyboardInputMode | ||
Returns an enumerator over all distinct registered recognizers. | KeyboardInputMode | ||
install(context:IInputModeContext):void
Installs this mode into the canvas of the given context. | AbstractInputMode | ||
removeHandler(eventRecognizer:Function, handler:Function):void
Removes a previously registered handler. | KeyboardInputMode | ||
stop():Boolean [override]
Returns true if this input mode doesn't own
the mutex. | AbstractConcurrentInputMode | ||
uninstall(context:IInputModeContext):void
Uninstalls this mode from the canvas. | AbstractInputMode |
Method | Defined By | ||
---|---|---|---|
canRequestMutex():Boolean
Determines whether this instance can request the InputMutex. | AbstractConcurrentInputMode | ||
fireInstalled():void | AbstractInputMode | ||
fireInstalling():void | AbstractInputMode | ||
fireUninstalled():void | AbstractInputMode | ||
fireUninstalling():void | AbstractInputMode | ||
handleEvent(evt:Event):void
Traps key events from the canvas control and checks the list
of recognizers. | KeyboardInputMode | ||
hasMutex():Boolean
Determines whether this instance owns the input mutex. | AbstractConcurrentInputMode | ||
initialize():void
Performs one-time initialization of this instance. | AbstractInputMode | ||
installCore(context:IInputModeContext):void [override]
The implementation of the install() method: installs this mode into
the canvas of the given context. | KeyboardInputMode | ||
invalidate():void
Convenience method for subclass implementations that invalidates
the canvasComponent this mode is currently installed in. | AbstractInputMode | ||
onDisabled():void
Called when the enabled property changes to false. | AbstractConcurrentInputMode | ||
onEnabled():void
Called when the enabled property changes to true. | AbstractConcurrentInputMode | ||
onMutexObtained():void
Called when this instance obtains the InputMutex. | AbstractConcurrentInputMode | ||
onMutexReleased():void
Called when this instance released the InputMutex. | AbstractConcurrentInputMode | ||
Called when the preferredCursor property changes. | AbstractConcurrentInputMode | ||
releaseMutex():void
Releases the mutex that is currently owned by this instance. | AbstractConcurrentInputMode | ||
requestMutex():void
Requests the InputMutex from the current controller. | AbstractConcurrentInputMode | ||
uninstallCore(context:IInputModeContext):void [override]
Implementation of uninstall: Uninstalls this mode from the canvas. | KeyboardInputMode |
addHandler | () | method |
public function addHandler(eventRecognizer:Function, handler:Function):void
Adds a given handler to this instance that will be triggered if the
given eventRecognizer recognizes a KeyboardEvent
that has been
triggered by the canvas component.
Parameters
eventRecognizer:Function — A function with the signature function(event:KeyboardEvent):Boolean
that returns true if it recognizes the event argument.
| |
handler:Function — The handler function to invoke if the recognizer matches an event. The function has the
signature function(event:KeyboardEvent):void .
|
clearHandlers | () | method |
public function clearHandlers(eventRecognizer:Function = null):void
Removes all handlers that have been registered under the given recognizer. If no recognizer is given, all registered handlers will be removed.
Parameters
eventRecognizer:Function (default = null )
|
dispose | () | method |
override public function dispose():void
Disposes this input mode.
Subclasses should remove all listeners that they have registered.
getHandlers | () | method |
public function getHandlers(eventRecognizer:Function):Iterator
Returns all handlers registered using the given recognizer.
Parameters
eventRecognizer:Function |
Iterator |
getRegisteredRecognizers | () | method |
public function getRegisteredRecognizers():Iterator
Returns an enumerator over all distinct registered recognizers.
ReturnsIterator |
handleEvent | () | method |
protected function handleEvent(evt:Event):void
Traps key events from the canvas control and checks the list of recognizers.
If this mode is disabled, it will silently return. If one of the recognizers matches the event, this implementation will request and release an input mutex, effectively cancelling other modes.
Parameters
evt:Event |
installCore | () | method |
override protected function installCore(context:IInputModeContext):void
The implementation of the install()
method: installs this mode into
the canvas of the given context.
Subclasses should override this method and call super.installCore(context)
, first.
One-time initialization should be performed in the initialize
method.
The install
method will call the initialize
method the first
time this mode gets installed.
Parameters
context:IInputModeContext — The context to use for installation.
|
removeHandler | () | method |
public function removeHandler(eventRecognizer:Function, handler:Function):void
Removes a previously registered handler.
Parameters
eventRecognizer:Function — An event recognizer function that had been registered before.
| |
handler:Function — An event handler that had been registered with the event recognizer function before.
|
uninstallCore | () | method |
override protected function uninstallCore(context:IInputModeContext):void
Implementation of uninstall
: Uninstalls this mode from the canvas.
Subclasses should always call super.uninstallCore( context )
as the last
statement.
Parameters
context:IInputModeContext — The context to remove this mode from. This is the same instance that
has been passed to install( IInputModeContext ) .
|