Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

take-cheeze
Copy link

closes #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;
Copy link
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
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

@@ -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;
Copy link
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