Make Catalog browsers focusable with shortcuts
- Category and scenario list views can now be focused with ctrl+a/ctrl+s. - Bind all keys with ctrl modifier - Add "shortcut" concept to views which currently hooks to hot keys. - In a catalog app by using a "shortcut" then takes the key event as a hot key, as it consumes resulting behaviour is to focus. - Move view initInternal away from constructor call to require user to call init() which is not in a View interface - Relates #826
This commit is contained in:
@@ -38,6 +38,7 @@ class TerminalUiSnippets {
|
||||
void sample() {
|
||||
TerminalUI ui = builder.build();
|
||||
BoxView view = new BoxView();
|
||||
ui.configure(view);
|
||||
view.setDrawFunction((screen, rect) -> {
|
||||
screen.writerBuilder()
|
||||
.build()
|
||||
@@ -59,6 +60,7 @@ class TerminalUiSnippets {
|
||||
void sample() {
|
||||
TerminalUI ui = new TerminalUI(terminal);
|
||||
BoxView view = new BoxView();
|
||||
ui.configure(view);
|
||||
ui.setRoot(view, true);
|
||||
EventLoop eventLoop = ui.getEventLoop();
|
||||
eventLoop.keyEvents()
|
||||
|
||||
Reference in New Issue
Block a user