Module Duplex.UIKey
UIKey receives messages from a MIDI keyboard.
You can create one of these components when you have a control-map which specify a parameter with a type of "keyboard"
This type of UIComponent is a bit different since it does not have the ability to be displayed externally - instead, it is visualized by a WidgetKeyboard (a custom viewbuilder widget) in the virtual control surface
Supported events
on_press
on_release
on_hold
Supported parameter types
<Param type="keyboard">
Changes
0.98
- First release
Functions
__init (app, map) | Initialize the UIKey class |
test (msg) | Perform a test of the incoming value |
do_press (msg) | A key was pressed |
do_release (msg) | A key was released |
do_hold (msg) | A key was held |
set_pos (x, y) | Set the position - |
draw () | Update the appearance - inherited from UIComponent |
add_listeners () |
Add event listeners
|
remove_listeners () | Remove previously attached event listeners |
Fields
self.on_press | external event handlers |
Functions
- __init (app, map)
-
Initialize the UIKey class
Parameters:
- app (Duplex.Application)
- map [opt] (table) mapping properties
- test (msg)
-
Perform a test of the incoming value
Parameters:
- msg (Duplex.Message)
Returns:
-
(bool), true when message was considered valid
See also:
- do_press (msg)
-
A key was pressed
Parameters:
- msg (Duplex.Message)
Returns:
-
self or nil
- do_release (msg)
-
A key was released
Parameters:
- msg (Duplex.Message)
Returns:
-
self or nil
- do_hold (msg)
-
A key was held
Parameters:
- msg (Duplex.Message)
- set_pos (x, y)
-
Set the position -
Parameters:
- x
- y
See also:
- draw ()
-
Update the appearance - inherited from UIComponent
See also:
- add_listeners ()
-
Add event listeners
DEVICE_EVENT.BUTTON_PRESSED DEVICE_EVENT.BUTTON_RELEASED DEVICE_EVENT.BUTTON_HELD
See also:
- remove_listeners ()
-
Remove previously attached event listeners
See also: