File Duplex/UIKey.lua
Functions
UIKey:__init (display) | Initialize the UIKey class |
UIKey:add_listeners () | Add event listeners (press, release, hold) |
UIKey:do_hold (msg) | A key was held |
UIKey:do_press (msg) | A key was pressed |
UIKey:do_release (msg) | A key was released |
UIKey:draw () | Update the control's apperance |
UIKey:remove_listeners () | Remove previously attached event listeners |
UIKey:test (msg) | Perform a test of the incoming value: if we pass any note (keyboard mode), the incoming pitch is remembered else, pitch is assigned when the UIKey is first created (and the containing application will then apply it's own transpose) |
UIKey:translate_pitch (msg) | Translate_pitch, used for determining the correct pitch |
UIKey:update_keys () | Force complete refresh when used as keyboard - a bit of a hack (the display will reset the "refresh_requested" property) |
Functions
- UIKey:__init (display)
-
Initialize the UIKey class
Parameters:
-
display
: (Duplex.Display)
-
- UIKey:add_listeners ()
- Add event listeners (press, release, hold)
- UIKey:do_hold (msg)
-
A key was held
Parameters:
-
msg
: (Duplex.Message)
Return value:
- boolean, true when message was handled
-
- UIKey:do_press (msg)
-
A key was pressed
Parameters:
-
msg
: (Duplex.Message)
Return value:
- boolean, true when message was handled
-
- UIKey:do_release (msg)
-
A key was released
Parameters:
-
msg
: (Duplex.Message)
Return value:
- boolean, true when message was handled
-
- UIKey:draw ()
- Update the control's apperance
- UIKey:remove_listeners ()
-
Remove previously attached event listeners
See also:
- UIKey:test (msg)
-
Perform a test of the incoming value: if we pass any note (keyboard mode), the incoming pitch is remembered else, pitch is assigned when the UIKey is first created (and the containing application will then apply it's own transpose)
Parameters:
-
msg
: (Duplex.Message)
Return value:
- (Boolean), true when message was considered valid
-
- UIKey:translate_pitch (msg)
-
Translate_pitch, used for determining the correct pitch
Parameters:
-
msg
: (Message)
Return value:
- pitch (Number)
-
- UIKey:update_keys ()
- Force complete refresh when used as keyboard - a bit of a hack (the display will reset the "refresh_requested" property)