Skip to content

Support autorepeat#12

Open
take-cheeze wants to merge 1 commit intoanko:masterfrom
take-cheeze:autorepeat
Open

Support autorepeat#12
take-cheeze wants to merge 1 commit intoanko:masterfrom
take-cheeze:autorepeat

Conversation

@take-cheeze
Copy link
Copy Markdown

closes #7

Window root = DefaultRootWindow(disp);
XIEventMask m;
m.deviceid = XIAllMasterDevices;
m.deviceid = XIAllDevices;
Copy link
Copy Markdown
Author

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) ? "=" : "+");
Copy link
Copy Markdown
Author

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

char *str = XKeysymToString(s);
if (NULL == str) continue;

if (cookie->evtype == XI_RawKeyRelease && ev->deviceid != ev->sourceid) continue;
Copy link
Copy Markdown
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support autorepeat?

1 participant