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

Method add_keypress

src/lib.rs:193–204  ·  view source on GitHub ↗

add a KeyPress event

(&mut self, keycode: X, ms_since_last: u16)

Source from the content-addressed store, hash-verified

191 }
192 /// add a KeyPress event
193 pub fn add_keypress<X: AcceptsKeycode>(&mut self, keycode: X, ms_since_last: u16) {
194 let e = Key {
195 keycode: keycode.to_u32(),
196 original_keycode: keycode.to_u32(),
197 ms_since_last,
198 running_number: self.running_number,
199 flag: 0,
200 };
201 self.running_number += 1;
202 self.events
203 .push((Event::KeyPress(e), EventStatus::Unhandled));
204 }
205 /// add a KeyRelease event
206 pub fn add_keyrelease<X: AcceptsKeycode>(&mut self, keycode: X, ms_since_last: u16) {
207 let e = Key {

Callers 15

pcMethod · 0.80
pctMethod · 0.80
test_toggle_handlerFunction · 0.80
test_dvorak_bracketsFunction · 0.80
test_oneshot_shiftFunction · 0.80
test_oneshot_interactionFunction · 0.80
test_abortFunction · 0.80
test_oneshotFunction · 0.80
test_oneshot_timeoutFunction · 0.80

Calls 1

to_u32Method · 0.80

Tested by 15

pcMethod · 0.64
pctMethod · 0.64
test_toggle_handlerFunction · 0.64
test_dvorak_bracketsFunction · 0.64
test_oneshot_shiftFunction · 0.64
test_oneshot_interactionFunction · 0.64
test_abortFunction · 0.64
test_oneshotFunction · 0.64
test_oneshot_timeoutFunction · 0.64