-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support autorepeat #12
base: master
Are you sure you want to change the base?
Conversation
closes anko#7
@@ -72,12 +72,12 @@ int main(int argc, char * argv[]) { | |||
{ // Register to receive XInput events | |||
Window root = DefaultRootWindow(disp); | |||
XIEventMask m; | |||
m.deviceid = XIAllMasterDevices; | |||
m.deviceid = XIAllDevices; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XI_KeyPress
won't be capturable with master devices only
if (printKeyUps) { | ||
if (cookie->evtype == XI_KeyPress) { | ||
XIDeviceEvent* dev_ev = cookie->data; | ||
printf("%s", (dev_ev->flags & XIKeyRepeat) ? "=" : "+"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to output of xinput --test-xi2 --root
, XIDeviceEvent
was the correct type to handle XI_KeyPress
@@ -142,9 +142,17 @@ int main(int argc, char * argv[]) { | |||
char *str = XKeysymToString(s); | |||
if (NULL == str) continue; | |||
|
|||
if (cookie->evtype == XI_RawKeyRelease && ev->deviceid != ev->sourceid) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate key event would be sent so filtering with deviceid and sourceid
closes #7