()
| 76 | use no_std_compat::prelude::v1::*; |
| 77 | #[test] |
| 78 | fn test_unicode_keyboard_linux() { |
| 79 | use crate::key_codes::KeyCode::*; |
| 80 | let ub = UnicodeKeyboard {}; |
| 81 | let mut keyboard = Keyboard::new(KeyOutCatcher::new()); |
| 82 | keyboard.add_handler(Box::new(ub)); |
| 83 | keyboard.output.state().unicode_mode = UnicodeSendMode::Linux; |
| 84 | //no output on press |
| 85 | keyboard.add_keypress(0x00E4u32, 0); |
| 86 | keyboard.handle_keys().unwrap(); |
| 87 | assert!(keyboard.output.reports.len() == 0); |
| 88 | assert!(keyboard.events.is_empty()); // we eat the keypress though |
| 89 | keyboard.add_keyrelease(0x00E4, 0); |
| 90 | keyboard.handle_keys().unwrap(); |
| 91 | check_output( |
| 92 | &keyboard, |
| 93 | &[ |
| 94 | &[U, LShift, LCtrl], |
| 95 | &[], |
| 96 | &[E], |
| 97 | &[], |
| 98 | &[Kp4], |
| 99 | &[], |
| 100 | &[Enter], |
| 101 | &[], |
| 102 | ], |
| 103 | ); |
| 104 | assert!(keyboard.events.is_empty()); // we eat the keypress though |
| 105 | } |
| 106 | #[test] |
| 107 | fn test_unicode_keyboard_wincompose() { |
| 108 | use crate::key_codes::KeyCode::*; |
nothing calls this directly
no test coverage detected