Class Index | File Index

Classes


Class PaintMouseKeys

The MouseKeys action.
Defined in: mousekeys.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
<private> <inner>  
Holds the current mouse movement acceleration, taken from the configuration.
<private> <inner>  
Holds a reference to the DOM element representing the pointer on top of the canvas element.
<private> <inner>  
Holds the current mouse movement speed in pixels.
Method Summary
Method Attributes Method Name and Description
 
Handles action removal.
<private> <inner>  
dispatch(type, ev)
Dispatch a synthetic event to the buffer canvas element.
 
keydown(ev)
The keydown event handler.
 
The keypress event handler.
<inner>  
Track the virtual pointer coordinates, by updating the position of the pointer element.
Class Detail
PaintMouseKeys(app)
Parameters:
{Painter} app
Reference to the main paint application object.
Field Detail
<private> <inner> {Number} accel
Holds the current mouse movement acceleration, taken from the configuration.
See:
PainterConfig.mousekeys_accel The mouse keys acceleration setting.

<private> <inner> {Element} pointer
Holds a reference to the DOM element representing the pointer on top of the canvas element.

<private> <inner> {Number} speed
Holds the current mouse movement speed in pixels.
Method Detail
actionRemove()
Handles action removal. This will remove the pointer DOM element and the canvas event listener.

<private> <inner> dispatch(type, ev)
Dispatch a synthetic event to the buffer canvas element.
Parameters:
{String} type
The mouse event type to dispatch.
{Event} ev
The original DOM Event object.

{Boolean} keydown(ev)
The keydown event handler.

This method requires a DOM Event object which has the ev.kobj_ object reference from the keyboard shortcuts configuration. The kobj_ object must have the param property. Support for the "Toggle" parameter is implemented. This parameter essentially means that a mouse event will be generated, either mousedown or mouseup. By alternating these two events, this method allows the user to start and stop the drawing operation at any moment using the keyboard shortcut they have configured.

Irrespective of the key the user pressed, this method does always reset the speed and acceleration of the pointer movement.

Parameters:
{Event} ev
The DOM Event object.
Returns:
{Boolean} True if the keyboard shortcut was recognized, or false if not.
See:
PainterConfig.keys The keyboard shortcuts configuration object.

{Boolean} keypress(ev)
The keypress event handler.

This method requires a DOM Event object with a ev.kobj_ object reference to the keyboard shortcut configuration. The keyboard shortcut configuration object must have the param property.

This event handler implements support for the following param values: "SouthWest", "South", "SouthEast", "West", "East", "NorthWest", "North" and "NorthEast", All of these values indicate the movement direction. This method generates synthetic movemove events based on the direction desired, effectively emulating the use of a real pointing device.

Parameters:
{Event} ev
The DOM Event object.
Returns:
{Boolean} True if the keyboard shortcut was recognized, or false if not.
See:
PainterConfig.keys The keyboard shortcuts configuration object.

<inner> pointerMousemove(ev)
Track the virtual pointer coordinates, by updating the position of the pointer element. This allows the keyboard users to see where they moved the virtual pointer.
Parameters:
{Event} ev
The DOM Event object.

Documentation generated by JsDoc Toolkit 2.1.0 on Wed Apr 22 2009 15:41:21 GMT+0300 (EEST)