EVENT

Description

Mid-level event abstraction manager.

This engine serves the HControl classes, so usually the existence of it is not obvious. The main interface to use it is the methods in HControl.

mouseDown( e, isLeftButton )

Mid-level mouse button press manager. Gets called on the onMouseDown event. Delegates the following calls to the high-level event receivers of all enabled controls registered, depending on the events they registered:

  • mouseDown
  • startDrag


coordCacheFlush( elemId )

Flushes the position cache by elemId, if no elemId is specified, everything is flushed.


mouseWheel( e )

Mid-level mouse scroll wheel event manager. Delegates mouseWheel calls to the high-level event receivers of all controls registered for that event.


mouseMove( e )

Mid-level mouse movement manager. Gets called on the onMouseMove event. Delegates the following calls to the high-level event receivers of all enabled controls registered, depending on the events they registered:

  • drag
  • mouseMove
  • endHover
  • startHover


resize( e )

Receiver of the onResize event. Delegates calls to the high-level event receivers of all controls registered for the event.


contextMenu( e )

Alternative right button detection, wrapper for the mouseDown method

doubleClick( e )

Mid-level double-click manager. Gets called on the onDoubleClick event. Delegates the following call to the high-level event receivers of all enabled controls registered, depending on the events they registered:

  • doubleClick


mouseUp( e )

Mid-level mouse button release manager. Gets called on the onMouseUp event. Delegates the following calls to the high-level event receivers of all enabled controls registered, depending on the events they registered:

  • mouseUp
  • endHover
  • drop
  • endDrag


focus( ctrl )

Mid-level focus manager. Gets called on the onMouseOver event. Starts listening for onMouseOut to blur. Delegates focus calls to the high-level event receivers of all enabled controls registered.


keyDown( e )

Mid-level key press manager. Gets called on the onKeyDown event. Delegates keyDown calls to the high-level event receivers of all controls registered for that event.


keyPress( e )

Using keyPress as an alias for the keyDown event

start( )

Starts event listening.


flushMouseMove( x, y )

Processes dragging calculations, triggered by mouseMove.


blur( ctrl )

Mid-level blur (focus lost) manager. Gets called on the onMouseOut event. Starts listening for onMouseOver to (re)focus. Delegates blur calls to the high-level event receivers of all enabled controls registered.


unreg( ctrl )

Unregisters the ctrl object event listeners


startDroppable( )

Initializes the members used by the drop -related events. This method is called from within EVENT and is never called, if enableDroppableChecks is false.


keyUp( e )

Mid-level key release manager. Gets called on the onKeyUp event. Delegates keyUp calls to the high-level event receivers of all controls registered for that event. Also delegates the textEnter calls to all controls registered for that event.


click( e, isLeftButton )

Mid-level mouse click manager. Gets called on the onClick event. Delegates click calls to the high-level event receivers of all controls registered for that event.


startDragging( ctrl, isLeftButton )

Description

Starts dragging the control given.

Call this method to start dragging another component.

Parameters

ctrl An object that uses the HControl API, becomes new drag target.


changeActiveControl( ctrl )

Changes active ctrl. The previous active ctrl gets the lostActiveStatus pseudo-event, The new active ctrl gets the gainedActiveStatus pseudo-event


reg( ctrl, focusOptions )

Registers the ctrl object by event listener flags in focusOptions.


Other Singleton Members

shiftKeyDown = 7

The index in the status array for the state of the Shift modifier key.


ctrlKeyDown = 6

The index in the status array for the state of the Ctrl modifier key.


keysDown = 4

The index in the status array for the list of keycodes of all the keys currently held down in the order of occurrence (first pressed comes first, last pressed last).


crsrY = 3

The index in the status array for the mouse cursor y coordinate.


button2 = 1

The index in the status array for the right mouse button.


focusTrace = false


altKeyDown = 5

The index in the status array for the state of the Alt modifier key.


prevActiveCtrl = null


enableDroppableChecks = true

A flag to disable, if your applications don't need drop events. Setting this to false when not needed improves overall performance, because the drop events need constant calculation of the mouse cursor location against all possible drop targets.


metaKeyDown = 8

The index in the status array for the state of the Meta modifier key.


cmdKeyDown = 9

The index in the status array for the state of the Command modifier key.


button1 = 0

The index in the status array for the left mouse button.


status = [false, false, -1, -1, [], false, false, false, false, false]

Description

Array that keeps the last known global event status type.

The format is an array with an index per "interesting" event value.

Indexes

EVENT.status[ EVENT.button1 ] The state of the left mouse button. false when not pressed true when pressed.

EVENT.status[ EVENT.button2 ] The state of the right mouse button. false when not pressed true when pressed.

EVENT.status[ EVENT.crsrX ] The x-coordinate of the mouse cursor.

EVENT.status[ EVENT.crsrY ] The y-coordinate of the mouse cursor.

EVENT.status[ EVENT.keysDown ] A list of keycodes of all the keys currently held down in the order of occurrence (first pressed comes first, last pressed last).

EVENT.status[ EVENT.altKeyDown ] The boolean status of the Alt modifier key being held down.

EVENT.status[ EVENT.ctrlKeyDown ] The boolean status of the Ctrl modifier key being held down.

EVENT.status[ EVENT.shiftKeyDown ] The boolean status of the Shift modifier key being held down.

EVENT.status[ EVENT.metaKeyDown ] The boolean status of the Meta modifier key being held down.

EVENT.status[ EVENT.cmdKeyDown ] The boolean status of any of the system-specific Command, Menu or Start modifier keys being held down.


crsrX = 2

The index in the status array for the mouse cursor x coordinate.