From b04e57f5a4e6bff04ebcff3bca10125296c4e893 Mon Sep 17 00:00:00 2001 From: bunnie Date: Wed, 3 Mar 2021 22:09:45 +0800 Subject: [PATCH] prepare for a merg --- services/ime-frontend/src/main.rs | 25 ++++++++++++++----------- xtask/src/main.rs | 4 ++-- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/services/ime-frontend/src/main.rs b/services/ime-frontend/src/main.rs index ce9e85647..6695b62b3 100644 --- a/services/ime-frontend/src/main.rs +++ b/services/ime-frontend/src/main.rs @@ -12,9 +12,20 @@ use graphics_server::Gid; use heapless::Vec; use heapless::consts::U32; +/* +what else do we need: + - current string that is being built up + - cursor position in string, so we can do insertion/deletion + */ +fn draw_canvas(gam_conn: xous::CID, canvas: Gid, pred_conn: xous::CID, newkeys: [char; 4]) { -fn draw_canvas(gam_conn: xous::CID, canvas: Gid, pred_conn: xous::CID) { - + // this is just reference to remind me how to decode the key array + for &k in newkeys.iter() { + if k != '\u{0000}' { + key_queue.push(k).unwrap(); + if debug1{info!("IMEF: got key '{}'", k);} + } + } } @@ -81,16 +92,8 @@ fn xmain() -> ! { }; } else if let Ok(opcode) = keyboard::api::Opcode::try_from(&envelope.body) { match opcode { - - //// TODO: replace the code below with something that calls the draw api - keyboard::api::Opcode::KeyboardEvent(keys) => { - for &k in keys.iter() { - if k != '\u{0000}' { - key_queue.push(k).unwrap(); - if debug1{info!("IMEF: got key '{}'", k);} - } - } + draw_canvas(gam_conn, canvas, prediction_conn, keys); }, _ => error!("IMEF: received KBD event opcode that wasn't expected"), } diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 40eae4b8f..475afea9e 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -39,8 +39,8 @@ fn try_main() -> Result<(), DynError> { let hw_pkgs = [ "gam", //"shell", - "ime-frontend", - "ime-plugin-shell", + //"ime-frontend", + //"ime-plugin-shell", "graphics-server", "ticktimer-server", "log-server",