Expand all

ve.ce.KeyDownHandlerFactory

Extends

Constructor

new ve.ce.KeyDownHandlerFactory() #

Key down handler factory.

Methods

executeHandlersForKey(key, selectionName, surface, e) → {boolean} #

Execute the handlers for a specific key

Parameters:

Name Type Description
key number

Key code

selectionName string

Selection type name

surface ve.ce.Surface
e jQuery.Event

Key down event

Source:

Returns:

Some handlers acted

Type
boolean
Execute the handlers for a specific key

lookupHandlersForKey(key, selectionName) → {Array.<function()>} #

Get the handler for a specific key

Parameters:

Name Type Description
key number

Key code

selectionName string

Selection type name

Source:

Returns:

Matched handlers

Type
Array.<function()>
Get the handler for a specific key

register(constructor, [name]) #

Register a constructor with the factory.

function MyClass() {};
OO.initClass( MyClass );
MyClass.static.name = 'hello';
// Register class with the factory, available via the symbolic name "hello"
factory.register( MyClass );

See https://doc.wikimedia.org/oojs/master/OO.Factory.html

Parameters:

Name Type Attributes Description
constructor function

Constructor to use when creating object

name string optional

Symbolic name to use for #create(). This parameter may be omitted in favour of letting the constructor decide its own name, through constructor.static.name.

Source:

Throws:

If a parameter is invalid

Type
Error
Register a constructor with the factory.