MCPcopy Create free account
hub / github.com/TyberiusPrime/KeyToKey / test_sequence_mixed_trigger

Function test_sequence_mixed_trigger

src/handlers/sequence.rs:206–224  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

204 }
205 #[test]
206 fn test_sequence_mixed_trigger() {
207 use crate::key_codes::KeyCode::*;
208 let map = &[A.to_u32(), UserKey::UK1.to_u32(), 0x1234];
209 let l = Sequence::new(map, X, 1);
210 let mut k = Keyboard::new(KeyOutCatcher::new());
211 k.output.state().unicode_mode = UnicodeSendMode::Debug;
212 k.add_handler(Box::new(l));
213 k.add_handler(Box::new(UnicodeKeyboard::new()));
214 k.add_handler(Box::new(USBKeyboard::new()));
215
216 k.pc(A, &[&[A]]);
217 k.rc(A, &[&[]]);
218
219 k.pc(UserKey::UK1, &[&[]]);
220 k.rc(UserKey::UK1, &[&[]]);
221
222 k.pc(0x1234, &[&[]]);
223 k.rc(0x1234, &[&[BSpace], &[], &[X]]);
224 }
225 #[test]
226 fn test_dual_sequence() {
227 use crate::key_codes::KeyCode::*;

Callers

nothing calls this directly

Calls 5

to_u32Method · 0.80
stateMethod · 0.80
add_handlerMethod · 0.80
pcMethod · 0.80
rcMethod · 0.80

Tested by

no test coverage detected