Lines Matching refs:kbd
118 update_keymap(struct keyboard *kbd) in update_keymap() argument
123 new_keymap = xkb_x11_keymap_new_from_device(kbd->ctx, kbd->conn, in update_keymap()
124 kbd->device_id, 0); in update_keymap()
128 new_state = xkb_x11_state_new_from_device(new_keymap, kbd->conn, in update_keymap()
129 kbd->device_id); in update_keymap()
133 if (kbd->keymap) in update_keymap()
136 xkb_state_unref(kbd->state); in update_keymap()
137 xkb_keymap_unref(kbd->keymap); in update_keymap()
138 kbd->keymap = new_keymap; in update_keymap()
139 kbd->state = new_state; in update_keymap()
149 init_kbd(struct keyboard *kbd, xcb_connection_t *conn, uint8_t first_xkb_event, in init_kbd() argument
154 kbd->conn = conn; in init_kbd()
155 kbd->first_xkb_event = first_xkb_event; in init_kbd()
156 kbd->ctx = ctx; in init_kbd()
157 kbd->keymap = NULL; in init_kbd()
158 kbd->state = NULL; in init_kbd()
159 kbd->device_id = device_id; in init_kbd()
161 ret = update_keymap(kbd); in init_kbd()
172 xkb_state_unref(kbd->state); in init_kbd()
173 xkb_keymap_unref(kbd->keymap); in init_kbd()
179 deinit_kbd(struct keyboard *kbd) in deinit_kbd() argument
181 xkb_state_unref(kbd->state); in deinit_kbd()
182 xkb_keymap_unref(kbd->keymap); in deinit_kbd()
186 process_xkb_event(xcb_generic_event_t *gevent, struct keyboard *kbd) in process_xkb_event() argument
201 if (event->any.deviceID != kbd->device_id) in process_xkb_event()
212 update_keymap(kbd); in process_xkb_event()
216 update_keymap(kbd); in process_xkb_event()
220 xkb_state_update_mask(kbd->state, in process_xkb_event()
232 process_event(xcb_generic_event_t *gevent, struct keyboard *kbd) in process_event() argument
239 test_print_keycode_state(kbd->state, NULL, keycode); in process_event()
247 if (gevent->response_type == kbd->first_xkb_event) in process_event()
248 process_xkb_event(gevent, kbd); in process_event()
254 loop(xcb_connection_t *conn, struct keyboard *kbd) in loop() argument
278 process_event(event, kbd); in loop()