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

Function test_sequence_private_trigger

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

Source from the content-addressed store, hash-verified

183 }
184 #[test]
185 fn test_sequence_private_trigger() {
186 use crate::key_codes::KeyCode::*;
187
188 let map = &[UserKey::UK1.to_u32(), B.to_u32(), C.to_u32()];
189 let l = Sequence::new(map, X, 3);
190 let mut k = Keyboard::new(KeyOutCatcher::new());
191 k.output.state().unicode_mode = UnicodeSendMode::Debug;
192 k.add_handler(Box::new(l));
193 k.add_handler(Box::new(UnicodeKeyboard::new()));
194 k.add_handler(Box::new(USBKeyboard::new()));
195
196 k.pc(UserKey::UK1, &[&[]]);
197 k.rc(UserKey::UK1, &[&[]]);
198
199 k.pc(B, &[&[B]]);
200 k.rc(B, &[&[]]);
201
202 k.pc(C, &[&[C]]);
203 k.rc(C, &[&[BSpace], &[], &[BSpace], &[], &[BSpace], &[], &[X]]);
204 }
205 #[test]
206 fn test_sequence_mixed_trigger() {
207 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