Packagecom.yworks.canvas.input
Classpublic class EventRecognizers
InheritanceEventRecognizers Inheritance Object

This class provides some event recognizer functions used by IInputModes in order to recognize mouse or keyboard events.

An event recognizer function takes an Event as the only parameter and returns a Boolean that indicates whether the given event was recognized.



Public Constants
 ConstantDefined By
  ALWAYS : Function
[static] An EventRecognizer that always returns true.
EventRecognizers
  BACKSPACE_PRESSED : Function
[static] Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with keyCode == Keyboard.BACKSPACE
EventRecognizers
  CANVAS_MOUSE_CLICKED : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_CLICK.
EventRecognizers
  CANVAS_MOUSE_DOUBLE_CLICKED : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DOUBLE_CLICK
EventRecognizers
  CANVAS_MOUSE_DOWN : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DOWN.
EventRecognizers
  CANVAS_MOUSE_DRAGGED : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DRAG when the event occured inside the canvas bounds.
EventRecognizers
  CANVAS_MOUSE_MOVED_OR_DRAGGED : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DRAG or CanvasMouseEvent.CANVAS_MOUSE_MOVE when the event occured inside the canvas bounds.
EventRecognizers
  CANVAS_MOUSE_UP : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_UP.
EventRecognizers
  CTRL_A_PRESSED : Function
[static] Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 97 and ctrl key pressed.
EventRecognizers
  CTRL_C_PRESSED : Function
[static] Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 99 and ctrl key pressed.
EventRecognizers
  CTRL_G_PRESSED : Function
[static] Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 103 and ctrl key pressed.
EventRecognizers
  CTRL_PRESSED : Function
[static] Returns true if the passed event is a KeyboardEvent of type KeyboardEvent.KEY_DOWN and the event's keyCode property is Keyboard.CONTROL.
EventRecognizers
  CTRL_RELEASED : Function
[static] Returns true if the passed event is a KeyboardEvent of type KeyboardEvent.KEY_UP and the event's keyCode property is Keyboard.CONTROL.
EventRecognizers
  CTRL_U_PRESSED : Function
[static] Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 117 and ctrl key pressed.
EventRecognizers
  CTRL_V_PRESSED : Function
[static] Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 118 and ctrl key pressed.
EventRecognizers
  CTRL_X_PRESSED : Function
[static] Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 120 and ctrl key pressed.
EventRecognizers
  CTRL_Y_PRESSED : Function
[static] Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 121 and ctrl key pressed.
EventRecognizers
  CTRL_Z_PRESSED : Function
[static] Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 122 and ctrl key pressed.
EventRecognizers
  DELETE_PRESSED : Function
[static] Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with keyCode == Keyboard.DELETE
EventRecognizers
  ESCAPE_PRESSED : Function
[static] Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with keyCode == Keyboard.ESCAPE
EventRecognizers
  F2_PRESSED : Function
[static] Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with keyCode == Keyboard.F2
EventRecognizers
  MODIFIER_ALT : Function
[static] Returns true if the passed event is a KeyboardEvent, MouseEvent or CanvasMouseEvent and the event's altKey property is true.
EventRecognizers
  MODIFIER_CTRL : Function
[static] Returns true if the passed event is a KeyboardEvent, MouseEvent or CanvasMouseEvent and the event's ctrlKey property is true.
EventRecognizers
  MODIFIER_SHIFT : Function
[static] Returns true if the passed event is a KeyboardEvent, MouseEvent or CanvasMouseEvent and the event's shiftKey property is true.
EventRecognizers
  MOUSE_ALT_DOWN : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DOWN when alt was pressed.
EventRecognizers
  MOUSE_CLICKED : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_CLICK when no modifier key was pressed.
EventRecognizers
  MOUSE_CTRL_DOWN : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DOWN when ctrl was pressed.
EventRecognizers
  MOUSE_DOUBLE_CLICKED : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_CLICK when no modifier key was pressed and the mouse button was pressed twice.
EventRecognizers
  MOUSE_DOWN : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DOWN when no modifier key was pressed.
EventRecognizers
  MOUSE_DOWN_NO_CONDITION : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DOWN, no matter which modifier keys were pressed.
EventRecognizers
  MOUSE_MOVE : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_MOVE.
EventRecognizers
  MOUSE_SHIFT_DOWN : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DOWN when shift was pressed.
EventRecognizers
  MOUSE_SINGLE_CLICKED : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_CLICK when no modifier key was pressed and the mouse button was pressed only once.
EventRecognizers
  MOUSE_UP : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_UP when no modifier key was pressed.
EventRecognizers
  MOUSE_UP_NO_CONDITION : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_UP, no matter which modifier keys were pressed.
EventRecognizers
  NEVER : Function
[static] An EventRecognizer that always returns false.
EventRecognizers
  NO_MODIFIER_PRESSED : Function
[static] Recognizes CanvasMouseEvents of any type when no modifier key was pressed.
EventRecognizers
  SHIFT_CLICKED : Function
[static] Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_CLICK when the shift key is pressed.
EventRecognizers
  SHIFT_PRESSED : Function
[static] Returns true if the passed event is a KeyboardEvent of type KeyboardEvent.KEY_DOWN and the event's keyCode property is Keyboard.SHIFT.
EventRecognizers
  SHIFT_RELEASED : Function
[static] Returns true if the passed event is a KeyboardEvent of type KeyboardEvent.KEY_UP and the event's keyCode property is Keyboard.CONTROL.
EventRecognizers
  SPACE_PRESSED : Function
[static] Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with keyCode == Keyboard.SPACE
EventRecognizers
  SPACE_RELEASED : Function
[static] Recognizes KeyboardEvents of type KeyboardEvent.KEY_UP with charCode == Keyboard.SPACE
EventRecognizers
Constant Detail
ALWAYSConstant
public static const ALWAYS:Function

An EventRecognizer that always returns true.

BACKSPACE_PRESSEDConstant 
public static const BACKSPACE_PRESSED:Function

Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with keyCode == Keyboard.BACKSPACE

CANVAS_MOUSE_CLICKEDConstant 
public static const CANVAS_MOUSE_CLICKED:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_CLICK.

CANVAS_MOUSE_DOUBLE_CLICKEDConstant 
public static const CANVAS_MOUSE_DOUBLE_CLICKED:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DOUBLE_CLICK

CANVAS_MOUSE_DOWNConstant 
public static const CANVAS_MOUSE_DOWN:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DOWN.

CANVAS_MOUSE_DRAGGEDConstant 
public static const CANVAS_MOUSE_DRAGGED:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DRAG when the event occured inside the canvas bounds.

CANVAS_MOUSE_MOVED_OR_DRAGGEDConstant 
public static const CANVAS_MOUSE_MOVED_OR_DRAGGED:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DRAG or CanvasMouseEvent.CANVAS_MOUSE_MOVE when the event occured inside the canvas bounds.

CANVAS_MOUSE_UPConstant 
public static const CANVAS_MOUSE_UP:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_UP.

CTRL_A_PRESSEDConstant 
public static const CTRL_A_PRESSED:Function

Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 97 and ctrl key pressed.

CTRL_C_PRESSEDConstant 
public static const CTRL_C_PRESSED:Function

Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 99 and ctrl key pressed.

CTRL_G_PRESSEDConstant 
public static const CTRL_G_PRESSED:Function

Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 103 and ctrl key pressed.

CTRL_PRESSEDConstant 
public static const CTRL_PRESSED:Function

Returns true if the passed event is a KeyboardEvent of type KeyboardEvent.KEY_DOWN and the event's keyCode property is Keyboard.CONTROL.

CTRL_RELEASEDConstant 
public static const CTRL_RELEASED:Function

Returns true if the passed event is a KeyboardEvent of type KeyboardEvent.KEY_UP and the event's keyCode property is Keyboard.CONTROL.

CTRL_U_PRESSEDConstant 
public static const CTRL_U_PRESSED:Function

Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 117 and ctrl key pressed.

CTRL_V_PRESSEDConstant 
public static const CTRL_V_PRESSED:Function

Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 118 and ctrl key pressed.

CTRL_X_PRESSEDConstant 
public static const CTRL_X_PRESSED:Function

Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 120 and ctrl key pressed.

CTRL_Y_PRESSEDConstant 
public static const CTRL_Y_PRESSED:Function

Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 121 and ctrl key pressed.

CTRL_Z_PRESSEDConstant 
public static const CTRL_Z_PRESSED:Function

Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with charCode == 122 and ctrl key pressed.

DELETE_PRESSEDConstant 
public static const DELETE_PRESSED:Function

Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with keyCode == Keyboard.DELETE

ESCAPE_PRESSEDConstant 
public static const ESCAPE_PRESSED:Function

Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with keyCode == Keyboard.ESCAPE

F2_PRESSEDConstant 
public static const F2_PRESSED:Function

Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with keyCode == Keyboard.F2

MODIFIER_ALTConstant 
public static const MODIFIER_ALT:Function

Returns true if the passed event is a KeyboardEvent, MouseEvent or CanvasMouseEvent and the event's altKey property is true.

MODIFIER_CTRLConstant 
public static const MODIFIER_CTRL:Function

Returns true if the passed event is a KeyboardEvent, MouseEvent or CanvasMouseEvent and the event's ctrlKey property is true.

MODIFIER_SHIFTConstant 
public static const MODIFIER_SHIFT:Function

Returns true if the passed event is a KeyboardEvent, MouseEvent or CanvasMouseEvent and the event's shiftKey property is true.

MOUSE_ALT_DOWNConstant 
public static const MOUSE_ALT_DOWN:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DOWN when alt was pressed.

MOUSE_CLICKEDConstant 
public static const MOUSE_CLICKED:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_CLICK when no modifier key was pressed.

MOUSE_CTRL_DOWNConstant 
public static const MOUSE_CTRL_DOWN:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DOWN when ctrl was pressed.

MOUSE_DOUBLE_CLICKEDConstant 
public static const MOUSE_DOUBLE_CLICKED:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_CLICK when no modifier key was pressed and the mouse button was pressed twice.

MOUSE_DOWNConstant 
public static const MOUSE_DOWN:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DOWN when no modifier key was pressed.

MOUSE_DOWN_NO_CONDITIONConstant 
public static const MOUSE_DOWN_NO_CONDITION:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DOWN, no matter which modifier keys were pressed.

MOUSE_MOVEConstant 
public static const MOUSE_MOVE:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_MOVE.

MOUSE_SHIFT_DOWNConstant 
public static const MOUSE_SHIFT_DOWN:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_DOWN when shift was pressed.

MOUSE_SINGLE_CLICKEDConstant 
public static const MOUSE_SINGLE_CLICKED:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_CLICK when no modifier key was pressed and the mouse button was pressed only once.

MOUSE_UPConstant 
public static const MOUSE_UP:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_UP when no modifier key was pressed.

MOUSE_UP_NO_CONDITIONConstant 
public static const MOUSE_UP_NO_CONDITION:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_UP, no matter which modifier keys were pressed.

NEVERConstant 
public static const NEVER:Function

An EventRecognizer that always returns false.

NO_MODIFIER_PRESSEDConstant 
public static const NO_MODIFIER_PRESSED:Function

Recognizes CanvasMouseEvents of any type when no modifier key was pressed.

SHIFT_CLICKEDConstant 
public static const SHIFT_CLICKED:Function

Recognizes CanvasMouseEvents of type CanvasMouseEvent.CANVAS_MOUSE_CLICK when the shift key is pressed.

SHIFT_PRESSEDConstant 
public static const SHIFT_PRESSED:Function

Returns true if the passed event is a KeyboardEvent of type KeyboardEvent.KEY_DOWN and the event's keyCode property is Keyboard.SHIFT.

SHIFT_RELEASEDConstant 
public static const SHIFT_RELEASED:Function

Returns true if the passed event is a KeyboardEvent of type KeyboardEvent.KEY_UP and the event's keyCode property is Keyboard.CONTROL.

SPACE_PRESSEDConstant 
public static const SPACE_PRESSED:Function

Recognizes KeyboardEvents of type KeyboardEvent.KEY_DOWN with keyCode == Keyboard.SPACE

SPACE_RELEASEDConstant 
public static const SPACE_RELEASED:Function

Recognizes KeyboardEvents of type KeyboardEvent.KEY_UP with charCode == Keyboard.SPACE