MCPcopy Create free account
hub / github.com/daisy/MathCAT / do_navigate_keypress

Function do_navigate_keypress

src/interface.rs:258–264  ·  view source on GitHub ↗

Given a key code along with the modifier keys, the current node is moved accordingly (or value reported in some cases). `key` is the [keycode](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode#constants_for_keycode_value) for the key (in JavaScript, `ev.key_code`) The spoken text for the new current node is returned.

(key: usize, shift_key: bool, control_key: bool, alt_key: bool, meta_key: bool)

Source from the content-addressed store, hash-verified

256/// `key` is the [keycode](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode#constants_for_keycode_value) for the key (in JavaScript, `ev.key_code`)
257/// The spoken text for the new current node is returned.
258pub fn do_navigate_keypress(key: usize, shift_key: bool, control_key: bool, alt_key: bool, meta_key: bool) -> Result<String> {
259 return MATHML_INSTANCE.with(|package_instance| {
260 let package_instance = package_instance.borrow();
261 let mathml = get_element(&package_instance);
262 return do_mathml_navigate_key_press(mathml, key, shift_key, control_key, alt_key, meta_key);
263 });
264}
265
266/// Given a navigation command, the current node is moved accordingly.
267/// This is a higher level interface than `do_navigate_keypress` for applications that want to interpret the keys themselves.

Callers

nothing calls this directly

Calls 2

get_elementFunction · 0.85

Tested by

no test coverage detected