MCPcopy Create free account
hub / github.com/ading2210/linuxpdf / key_pressed

Function key_pressed

pdflinux.js:209–226  ·  view source on GitHub ↗
(key_str)

Source from the content-addressed store, hash-verified

207}
208
209function key_pressed(key_str) {
210 let key_lower = key_str.toLowerCase();
211 let shift_pressed = false;
212 if (key_str === " ") {
213 key_str = "Space";
214 }
215 //handle strings that are different than the actual key because they were pressed with shift
216 else if (keys_shifted_map[key_str] || key_lower != key_str) {
217 key_str = keys_shifted_map[key_str] || key_lower;
218 shift_pressed = true;
219 key_down(key_to_input_map["Shift"]);
220 }
221
222 if (shift_pressed) key_down(key_to_input_map["Shift"]);
223 print_msg("pressed: " + key_str);
224 press_input(key_to_input_map[key_str]);
225 if (shift_pressed) key_up(key_to_input_map["Shift"]);
226}
227
228set_interval(() => {
229 globalThis.getField("key_input").value = "Type here for keyboard inputs.";

Callers

nothing calls this directly

Calls 4

key_downFunction · 0.85
print_msgFunction · 0.85
press_inputFunction · 0.85
key_upFunction · 0.85

Tested by

no test coverage detected