()
| 129 | |
| 130 | #[test] |
| 131 | fn test_longtab_plus_mod() { |
| 132 | let mut keyboard = Keyboard::new(KeyOutCatcher::new()); |
| 133 | let timeout: u16 = 1000; |
| 134 | keyboard.add_handler(Box::new(LongTap::new( |
| 135 | UserKey::UK0, |
| 136 | KeyCode::A, |
| 137 | KeyCode::B, |
| 138 | timeout, |
| 139 | ))); |
| 140 | keyboard.add_handler(Box::new(USBKeyboard::new())); |
| 141 | |
| 142 | keyboard.add_keypress(UserKey::UK0, 0); |
| 143 | keyboard.handle_keys().unwrap(); |
| 144 | check_output(&keyboard, &[&[]]); |
| 145 | keyboard.output.clear(); |
| 146 | |
| 147 | keyboard.add_keyrelease(UserKey::UK0, timeout - 1); |
| 148 | keyboard.handle_keys().unwrap(); |
| 149 | dbg!(&keyboard.output.reports); |
| 150 | check_output(&keyboard, &[&[KeyCode::A]]); |
| 151 | keyboard.output.clear(); |
| 152 | |
| 153 | keyboard.add_keypress(KeyCode::LShift, 0); |
| 154 | keyboard.handle_keys().unwrap(); |
| 155 | keyboard.output.clear(); |
| 156 | keyboard.add_keypress(UserKey::UK0, 0); |
| 157 | keyboard.handle_keys().unwrap(); |
| 158 | check_output(&keyboard, &[&[KeyCode::LShift]]); |
| 159 | keyboard.output.clear(); |
| 160 | |
| 161 | keyboard.add_keyrelease(UserKey::UK0, timeout); |
| 162 | keyboard.handle_keys().unwrap(); |
| 163 | dbg!(&keyboard.output.reports); |
| 164 | check_output(&keyboard, &[&[KeyCode::B, KeyCode::LShift]]); |
| 165 | keyboard.output.clear(); |
| 166 | } |
| 167 | } |
nothing calls this directly
no test coverage detected