-
Notifications
You must be signed in to change notification settings - Fork 0
Tutorial EzLang Keyboard Selection
Keyboard selection, unlike mouse selection, requires the configuration of a property. You need to configure the 'selection_order' property of each widget that should be selectable through keyboard. This selection order is global over the active screen or popup. The 'down arrow' button on the keyboard cycles down through the selection order (1 > 2 > 3, etc.). The 'up arrow' button on the keyboard cycles up (3 > 2 > 1, etc.). If the highest or lowest widget is reached, the selection cycles back around.
For example, if you have a menu layout and you want to select buttons from top-to-bottom, you would use:
- Layout:
mode: box
orientation: vertical
- Button:
text: Option 1
auto_scale_height: true
selection_order: 1
- Button:
text: Option 2
auto_scale_height: true
selection_order: 5
- Button:
text: Option 3
auto_scale_height: true
selection_order: 10
Note that we did not use consecutive numbers. Instead we increased the order by 5 each time, so we can leave some space for possible future widgets.
If we have multiple layouts, we do not reset the selection order. The order is global. So if we have two layouts:
- Layout:
mode: box
- Layout:
mode: box
orientation: vertical
- Button:
text: Left Option 1
auto_scale_height: true
selection_order: 1
- Button:
text: Left Option 2
auto_scale_height: true
selection_order: 5
- Button:
text: Left Option 3
auto_scale_height: true
selection_order: 10
- Layout:
mode: box
orientation: vertical
- Button:
text: Right Option 1
auto_scale_height: true
selection_order: 15
- Button:
text: Right Option 2
auto_scale_height: true
selection_order: 20
- Button:
text: Right Option 3
auto_scale_height: true
selection_order: 25
This concludes our overview of EzLang. All the features have been covered. You can use the Reference section to find all possible properties of each widget and layout. You can also look at the Examples section for inspiration on how to put these features to use.
Next we'll continue with the Scheduler. Where EzLang is how you manage your initial UI, the Scheduler is how you manage your UI at runtime. Let's take a look.
The general tutorial continues with: Scheduler.
Tutorial
Tutorial-Project-StructureMinimal example
EzLang
EzLang basics
EzLang Templates
Ezlang Layout modes
EzLang Box mode layouts
EzLang Stack mode layouts
EzLang Table mode layouts
EzLang Float mode layouts
EzLang Tab mode layouts
EzLang Screen mode layouts
EzLang Layout Scrolling
EzLang Layout Views
EzLang Widget overview
EzLang Label
EzLang Text Input
EzLang Button
EzLang Checkbox
EzLang Radio button
EzLang Dropdown
EzLang Slider
EzLang Canvas
EzLang Property Binding
EzLang Sizing
EzLang Size hints
EzLang Auto scaling
EzLang Maths Sizing
EzLang Manual Sizing
EzLang Positioning
EzLang Layout Mode Positioning
EzLang Position Hints
EzLang Position Maths
EzLang Manual Position
EzLang Adjusting Position
EzLang Keyboard Selection
Scheduler
Widget States and the State Tree
The Scheduler Object
Managing callbacks
Callback Structure
Callback Configs
Callback: On keyboard enter
Callback: On Left Mouse Click
Callback: On Press
Callback: On Select
Callback: On Deselect
Callback: On Right Mouse Click
Callback: On Hover
Callback: On Drag
Callback: On Scroll Up
Callback: On Scroll Down
Callback: On Value Change
Callback: Custom Key Binds
Callback: Global Key Binds
Callback: Property Binds
Tasks
Scheduled Single Exectution Tasks
Scheduled Recurring Tasks
Threaded Tasks
Custom Properties
Modals
Programmatic Widgets
Updating widgets
Managing selection
Default global (key)binds
Performance
Examples
Layout: Box Mode NestedLayout: Box Mode Size Hints
Layout: Stack Mode
Layout: Table Mode Dynamic
Layout: Table Mode Static
Layout: Float Mode Manual
Layout: Float Mode Position hints
Layout: Screen Mode
Layout: Tab Mode
Layout: Scrolling
Layout: Views
Widget: Label
Widget: Text input
Widget: Button
Widget: Checkbox
Widget: Radio Button
Widget: Dropdown
Widget: Slider
Widget: Progress Bar
Widget: Canvas
Scheduler: Schedule Once
Scheduler: Schedule Once Callback
Scheduler: Schedule Recurring
Scheduler: Schedule Recurring Callback
Scheduler: Threaded Task State Tree
Scheduler: Threaded Task Custom Property
Scheduler: Create Widgets
Scheduler: Modal Popup
Reference
WidgetsCommon Properties
Label
Text Input
Button
Checkbox
Radio button
Dropdown
Slider
Canvas
Scheduler
Schedule once
Schedule Recurring
Schedule Threaded
Cancel Task
Cancel Recurring Task
Create Widget
Remove Widget
Select Widget
Deselect Widget
Update Widget
Force Redraw
Open Modal
Dismiss Modal
Bind Global Key
Remove Global Key
Clear Global Keys
Bind Property
Create Custom Properties
Get Property
Get Property Mut
Overwrite Callback Config
Update Callback Config
Exit