Expand all

ve.ui.Trigger

Constructor

new ve.ui.Trigger([e], [allowInvalidPrimary]) #

Key trigger.

Parameters:

Name Type Attributes Description
e jQuery.Event | string optional

Event or string to create trigger from

allowInvalidPrimary boolean optional

Allow invalid primary keys

Source:
Key trigger.

Properties

keyAliasesstatic #

Properties:

Name Type Description
Aliases Object

for modifier or primary key names.

Source:

modifierKeysstatic #

Properties:

Name Type Description
Symbolic Array.<string>

modifier key names. The order of this array affects the canonical order of a trigger string.

Source:

platformMappingstatic #

Properties:

Name Type Description
Mappings Object

to use when rendering string for a specific platform.

Source:

platformStringJoinersstatic #

Properties:

Name Type Description
Symbol Object

to use when concatenating keys in a sequence.

Source:

primaryKeyMapstatic #

Properties:

Name Type Description
Mapping Object

of key codes and symbolic key names.

Source:

primaryKeysstatic #

Properties:

Name Type Description
Symbolic Array.<string>

primary key names.

Source:

translatableKeysstatic #

Properties:

Name Type Description
Special Array.<string>

keys which have i18n messages

Source:

Methods

getMessage(explode) → {Array.<string>|string} #

Get a trigger message.

This is similar to #toString but the resulting string will be formatted in a way that makes it appear more native for the platform, and special keys will be translated.

Parameters:

Name Type Description
explode boolean

Whether to return the message split up into some reasonable sequence of inputs required

Source:

Returns:

Seprate key messages, or a joined string

Type
Array.<string> | string
Get a trigger message.

isComplete() → {boolean} #

Check if trigger is complete.

For a trigger to be complete, there must be a valid primary key.

Source:

Returns:

Trigger is complete

Type
boolean
Check if trigger is complete.

toString() → {string} #

Get a trigger string.

Trigger strings are canonical representations of triggers made up of the symbolic names of all active modifier keys and the primary key joined together with a '+' sign.

To normalize a trigger string simply create a new trigger from a string and then run this method.

An incomplete trigger will return an empty string.

Source:

Returns:

Canonical trigger string

Type
string
Get a trigger string.