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:
Properties
keyAliasesstatic
#
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
#
primaryKeysstatic
#
translatableKeysstatic
#
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 | Attributes | Default | Description |
---|---|---|---|---|
explode |
boolean |
optional |
false | 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
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
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