Created
November 15, 2012 21:08
-
-
Save bluetech/4081283 to your computer and use it in GitHub Desktop.
Find core keybaord device id with XKB only
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int | |
get_core_kbd_device_id(struct app *app, uint8_t *out) | |
{ | |
xcb_xkb_get_device_info_cookie_t cookie; | |
_cleanup_free_ xcb_xkb_get_device_info_reply_t *reply = NULL; | |
cookie = xcb_xkb_get_device_info(app->conn, | |
XCB_XKB_ID_USE_CORE_KBD, | |
0, 0, 0, 0, 0, 0); | |
reply = xcb_xkb_get_device_info_reply(app->conn, cookie, NULL); | |
if (!reply) { | |
warnx("couldn't get core keyboard xkb device info"); | |
return -EFAULT; | |
} | |
*out = reply->deviceID; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment