MCPcopy Index your code
hub / github.com/endbasic/endbasic / inject_keyboard_event

Method inject_keyboard_event

web/src/input.rs:99–108  ·  view source on GitHub ↗

Pushes a new captured `dom_event` keyboard event into the input.

(&self, dom_event: KeyboardEvent)

Source from the content-addressed store, hash-verified

97
98 /// Pushes a new captured `dom_event` keyboard event into the input.
99 pub fn inject_keyboard_event(&self, dom_event: KeyboardEvent) {
100 let key = on_key_event_into_key(dom_event);
101 if key == Key::Interrupt
102 && let Err(e) = self.signals_tx.try_send(Signal::Break)
103 {
104 log_and_panic!("Send to unbounded channel must succeed: {}", e);
105 }
106
107 self.safe_try_send(key)
108 }
109
110 /// Generates a fake Escape key press.
111 pub fn press_escape(&self) {

Callers 1

index.jsFile · 0.80

Calls 2

on_key_event_into_keyFunction · 0.85
safe_try_sendMethod · 0.80

Tested by

no test coverage detected