From e6cb3979f1b3e34815ba01732bbee512ec16427f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gianguido=20Sor=C3=A0?= Date: Wed, 2 Nov 2022 18:20:18 +0100 Subject: [PATCH] chore: delete kbdmenu file kbd menu now in preferences --- services/status/src/kbdmenu.rs | 60 ---------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 services/status/src/kbdmenu.rs diff --git a/services/status/src/kbdmenu.rs b/services/status/src/kbdmenu.rs deleted file mode 100644 index bf2872a4e..000000000 --- a/services/status/src/kbdmenu.rs +++ /dev/null @@ -1,60 +0,0 @@ -use gam::*; -use num_traits::*; -use keyboard::KeyMap; - -use crate::StatusOpcode; - -pub fn create_kbd_menu(status_conn: xous::CID, kbd_mgr: xous::SID) -> MenuMatic { - let mut menu_items = Vec::::new(); - - // what the Rust: I have a into trait for usize on KeyMap. I want to go to a u32 in a single line of code. - // you would think you could do... `KeyMap::Qwerty.into::() as u32`. But no, you can't. Into doesn't - // take a generic. But if I just did .into() with a u32 Rust isn't careless enough to assume I want to go to a usize - // then a u32. But I really don't want to implement a second set of into() traits just for u32. So ugh, now I - // create a typed binding and then cast that binding to a u32 to work around this. idk. - let code: usize = KeyMap::Qwerty.into(); - menu_items.push(MenuItem { - name: xous_ipc::String::from_str("QWERTY"), - action_conn: Some(status_conn), - action_opcode: StatusOpcode::SetKeyboard.to_u32().unwrap(), - action_payload: MenuPayload::Scalar([code as u32, 0, 0, 0]), - close_on_select: true, - }); - let code: usize = KeyMap::Azerty.into(); - menu_items.push(MenuItem { - name: xous_ipc::String::from_str("AZERTY"), - action_conn: Some(status_conn), - action_opcode: StatusOpcode::SetKeyboard.to_u32().unwrap(), - action_payload: MenuPayload::Scalar([code as u32, 0, 0, 0]), - close_on_select: true, - }); - let code: usize = KeyMap::Qwertz.into(); - menu_items.push(MenuItem { - name: xous_ipc::String::from_str("QWERTZ"), - action_conn: Some(status_conn), - action_opcode: StatusOpcode::SetKeyboard.to_u32().unwrap(), - action_payload: MenuPayload::Scalar([code as u32, 0, 0, 0]), - close_on_select: true, - }); - let code: usize = KeyMap::Dvorak.into(); - menu_items.push(MenuItem { - name: xous_ipc::String::from_str("Dvorak"), - action_conn: Some(status_conn), - action_opcode: StatusOpcode::SetKeyboard.to_u32().unwrap(), - action_payload: MenuPayload::Scalar([code as u32, 0, 0, 0]), - close_on_select: true, - }); - #[cfg(feature="tts")] - { - let code: usize = KeyMap::Braille.into(); - menu_items.push(MenuItem { - name: xous_ipc::String::from_str("Braille"), - action_conn: Some(status_conn), - action_opcode: StatusOpcode::SetKeyboard.to_u32().unwrap(), - action_payload: MenuPayload::Scalar([code as u32, 0, 0, 0]), - close_on_select: true, - }); - } - - menu_matic(menu_items, gam::KBD_MENU_NAME, Some(kbd_mgr)).expect("couldn't create MenuMatic manager") -}