From c0d56d86d0a1ec171929ca3994a0fa7c94ce5f42 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Mon, 25 Mar 2024 15:42:44 +0100 Subject: [PATCH] Adds some def lookup --- src/dispatch.rs | 6 ++++++ src/kb_macro.rs | 8 ++++++++ src/layout.rs | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/src/dispatch.rs b/src/dispatch.rs index 866bd5b..7465491 100644 --- a/src/dispatch.rs +++ b/src/dispatch.rs @@ -46,6 +46,12 @@ pub(crate) async fn keydispatch_press(pressed_key: &KeypadKey, sender: &ChannelT (false, false, true, &KeypadKey::B3) => mk!(M_BIGDOWN), (false, false, true, &KeypadKey::B2) => mk!(M_BIGLEFT), (false, false, true, &KeypadKey::B4) => mk!(M_BIGRIGHT), + (false, false, false, &KeypadKey::A2) => mk!(M_PREV_PAR), + (false, false, false, &KeypadKey::A4) => mk!(M_NEXT_PAR), + (false, false, true, &KeypadKey::A2) => mk!(M_PREV_FN), + (false, false, true, &KeypadKey::A4) => mk!(M_NEXT_FN), + (false, false, false, &KeypadKey::C2) => mk!(M_PREV_DEF), + (false, false, false, &KeypadKey::C4) => mk!(M_NEXT_DEF), (_, _, _, _) => (), } // Return diff --git a/src/kb_macro.rs b/src/kb_macro.rs index e076102..2131215 100644 --- a/src/kb_macro.rs +++ b/src/kb_macro.rs @@ -34,6 +34,14 @@ pub const M_UP: KBMacro = KBM!(k); pub const M_DOWN: KBMacro = KBM!(j); pub const M_LEFT: KBMacro = KBM!(h); pub const M_RIGHT: KBMacro = KBM!(l); + +pub const M_PREV_FN: KBMacro = KBM!(lbrak, f); +pub const M_NEXT_FN: KBMacro = KBM!(rbrak, f); +pub const M_PREV_DEF: KBMacro = KBM!(lbrak, d); +pub const M_NEXT_DEF: KBMacro = KBM!(rbrak, d); +pub const M_PREV_PAR: KBMacro = KBM!(lbrak, p); +pub const M_NEXT_PAR: KBMacro = KBM!(rbrak, p); + // pub const M_NO: KBMacro = KBM!(no); // pub const M_BTE: KBMacro = KBM!(b, i, t, e); // pub const M_BLLY: KBMacro = KBM!(b, i, l, no, l, y); diff --git a/src/layout.rs b/src/layout.rs index 849427c..9523a66 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -151,6 +151,8 @@ pub(crate) const fn translate(symbol: &Layout) -> KeyboardReport { Layout::pow => todo!(), Layout::star => todo!(), Layout::no => KR!(0,0,0,0,0,0;0), + Layout::lbrak => KR!(KeyCode::Kb5,0,0,0,0,0;64), + Layout::rbrak => KR!(KeyCode::Minus,0,0,0,0,0;64), } } @@ -235,4 +237,6 @@ pub(crate) enum Layout { pow, star, no, + lbrak, + rbrak, }