Event Modifier Specification
This section details the specifications of each Event Modifier in the following items.
- Modifier name:
The string asmodtype
parameter in the event modifier definition when defining modifiers inmapper.device()
. - The events generated by default
- Options specific to the modifier:
The structure of a table specified asmodparam
parameter in the event modifier definition when defining modifiers inmapper.device()
.
raw Modifier
This is the default modifier that doesn't make any changes to the event.
Name (modtype)
raw
Default Events
Event | Description |
---|---|
change | This event is triggered every time the value of the Device Unit changes.The Event Value is directly set as the value of the Device Unit. |
Options (modparam)
There are currently no modparam
available for the raw
modifiers.
button Modifier
This modifier is intended for application to Device Units that can be represented by binary values, such as buttons. This modifier can also be employed to enable binary functionality for Device Unit that inherently possess continuous quantities like analog axes.
Name (modtype)
button
Default Events
Event | Description |
---|---|
down | This event is triggered when the Device Unit value changes from OFF to ON. By default, 0 is considered OFF, and 1 is considered ON. |
up | This event is triggered when the Device Unit value changes from ON to OFF. By default, 0 is considered OFF, and 1 is considered ON. |
Options (modparam)
Key | Type | Description |
---|---|---|
polarity | string | When negative is specified, it interprets ON/OFF inversely; the default is positive . |
max_threshold | number | Specify this when treating a Device Unit with continuous values like a binary button. Interpreted as ON when the specified value is exceeded. |
min_threshold | number | Specify this when treating a Device Unit with continuous values like a binary button. Interpreted as OFF when the specified value is undercut. |
longpress | number | Specify the value in milliseconds, it triggers a longpressed event when the button is held down for the specified duration |
doubleclick | number | Specify the value in milliseconds. If double-clicked within the specified time, the doubleclicked event is triggered. If there's no second click within the specified time after the initial click, the singleclicked event is triggered. |
click_timing | string | Specify the timing for determining clicks as up or down .The default is down . |
repeat_interval | number | Specify the value in milliseconds. It triggers a down events repeatedly at specified time intervals while the button is held down. |
repeat_delay | number | Specify the time, in milliseconds, before the repeat operation begins after pressing the button. This setting is effective only when repeat_interval is specified.The default is 0 . |
follow_down | number | Specify the value in milliseconds. It trigers a follow_down event once the specified time has passed since the occurrence of a down event. |
follow_up | number | Specify the value in milliseconds. It trigers a follow_up event once the specified time has passed since the occurrence of a up event. |
incdec Modifier
This modifier is intended for application to Device Units that operate on relative values.
Name (modtype)
incdec
Default Events
Event | Description |
---|---|
increment | This event is triggerd when change is positive. The Event Value represents the absolute value of the Device Unit. |
decrement | This event is triggerd when change is negative. The Event Value represents the absolute value of the Device Unit. |
Options (modparam)
Key | Type | Description |
---|---|---|
pulse_mode | boolean | When true is specified, it operates in pulse mode. The default is false .Pulse mode generates two events, corresponding to push and release, like a button, based on the number of times the change amount is set in the increment or decrement event values.Instead of the increment event, it triggers the increment_pulse event, and for the decrement event, it triggers the decrement_pulse event. The Event Value sets 1 for push simulation and 0 for release simulation. |
pulse_duration | number | When in pulse mode, specify the duration of the simulated press in milliseconds. The default is 30 . |
pulse_interval | number | When in pulse mode, specify the minimum time in milliseconds between the simulated release and the next simulated press. The default is 30 . |
max_hold_num | number | Specifies the maximum number of pulse generations to hold. Setting this value too high might lead to continued event generation long after the Device Unit's change has stopped. Adjust this value based on the desired real-time responsiveness. The default is 4 . |