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

Function ps2_put_keycode

tinyemu/ps2.c:140–151  ·  view source on GitHub ↗

keycode is a Linux input layer keycode. We only support the PS/2 keycode set 1 */

Source from the content-addressed store, hash-verified

138/* keycode is a Linux input layer keycode. We only support the PS/2
139 keycode set 1 */
140void ps2_put_keycode(PS2KbdState *s, BOOL is_down, int keycode)
141{
142 if (keycode >= INPUT_MAKE_KEY_MIN) {
143 if (keycode > INPUT_MAKE_KEY_MAX)
144 return;
145 keycode = linux_input_to_keycode_set1[keycode - INPUT_MAKE_KEY_MIN];
146 if (keycode == 0)
147 return;
148 ps2_queue(&s->common, 0xe0);
149 }
150 ps2_queue(&s->common, keycode | ((!is_down) << 7));
151}
152
153uint32_t ps2_read_data(void *opaque)
154{

Callers 1

pc_vm_send_key_eventFunction · 0.85

Calls 1

ps2_queueFunction · 0.85

Tested by

no test coverage detected