Class NeoKeyMenu
-
- All Implemented Interfaces:
public class NeoKeyMenu
An "actionable" menu using the NeoKey. Due to the limited number of buttons, if there are more than 4 items, the menu can be "rotated" to show a subset of the menu items, plus a "next" item. The "next" item will rotate the menu to the next subset of items. A list of 4 or fewer items will always be sent to the display,
The calling application can use the return map to determine which button was pressed and what action to take, executing more than one if desired. This also allows the application to use the keys to "chord" actions that are not necessarily menu items.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interface
NeoKeyMenu.MenuDisplay
Displays menu items.
public class
NeoKeyMenu.MenuItem
Describes a menu item.
public class
NeoKeyMenu.Companion
-
Field Summary
Fields Modifier and Type Field Description private final NeoKeyHandler
neoKey
private final NeoKeyMenu.MenuDisplay
display
public final static NeoKeyMenu.Companion
Companion
-
Constructor Summary
Constructors Constructor Description NeoKeyMenu(NeoKeyHandler neoKey, NeoKeyMenu.MenuDisplay display, List<NeoKeyMenu.MenuItem> items)
-
Method Summary
Modifier and Type Method Description final NeoKeyHandler
getNeoKey()
final NeoKeyMenu.MenuDisplay
getDisplay()
List<Pair<Integer, NeoKeyMenu.MenuItem>>
execute()
Reads the keyboard and maps buttons pressed to actions to be performed. Boolean
firstButton()
Convenience function that executes the action described for the "first" (list-order) button pressed. final Unit
displayMenu()
Sets up the sub-selection of menu items and displays them. -
-
Constructor Detail
-
NeoKeyMenu
NeoKeyMenu(NeoKeyHandler neoKey, NeoKeyMenu.MenuDisplay display, List<NeoKeyMenu.MenuItem> items)
-
-
Method Detail
-
getNeoKey
final NeoKeyHandler getNeoKey()
-
getDisplay
final NeoKeyMenu.MenuDisplay getDisplay()
-
execute
@Synchronized() List<Pair<Integer, NeoKeyMenu.MenuItem>> execute()
Reads the keyboard and maps buttons pressed to actions to be performed.
-
firstButton
@Synchronized() Boolean firstButton()
Convenience function that executes the action described for the "first" (list-order) button pressed. There is no error handling around action calls.
-
displayMenu
@Synchronized() final Unit displayMenu()
Sets up the sub-selection of menu items and displays them.
-
-
-
-