diff options
-rw-r--r-- | src/edit.rs | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/edit.rs b/src/edit.rs index 0e62267..d640db2 100644 --- a/src/edit.rs +++ b/src/edit.rs @@ -84,15 +84,27 @@ slint::slint! { if (event.text == "q") { user-quit(); } - if (event.text == " ") { + if (event.text == "h") { + debug("select prev"); + master.select-prev(); + } + else if (event.text == "l") { + debug("select next"); + master.select-next(); + } + else if (event.text == " ") { if (event.modifiers.shift) { debug("select prev"); - color-vbox.select-prev(); + master.select-prev(); } else { debug("select next"); - color-vbox.select-next(); + master.select-next(); } } + else if (event.text == "j" || event.text == "k") { + debug("select other row"); + master.select-other-row(); + } if (event.modifiers.control) { //debug("control was pressed during this event"); } @@ -105,6 +117,7 @@ slint::slint! { callback select-prev(); callback select-next(); + callback select-other-row(); select-prev () => { Aux.selected = Aux.selected == 0 ? 15 : Aux.selected - 1; @@ -116,6 +129,11 @@ slint::slint! { debug ("selected next, now", Aux.selected); } + select-other-row () => { + Aux.selected = mod (Aux.selected + 8, 16); + debug ("selected row above/below, now", Aux.selected); + } + status := HorizontalBox { width : 100%; |