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

feat: allow to specify master keyboard #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lefuturiste
Copy link

The issue that I encountered was that after I setup xremap, the cursor was flickering like in #78 and so I looked into this and realized that in that case, xbanish should only attach and listen to the new virtual keyboard created by xremap.

So this patch implement a new argument -k to specify which keyboard device name should the program attach to.

This implementation is basic and simple, I may forgot edge cases.

Provide a new argument -k to specify which keyboard device name should
the program attach to. Useful in case where you have xremap running.
xbanish.c Outdated
@@ -109,6 +111,10 @@ main(int argc, char *argv[])
ignored |= mods[i].mask;

break;
case 'k':
// choose which keyboard device to listen only (in case of xremap or Kmonad being used)
master_keyboard_device = strdup(optarg);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strdup can fail since it allocates memory and so the return value needs to be checked.

But in this case, there should be zero reason to duplicate the string to begin with.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx, should be fixed

xbanish.c Outdated
@@ -109,6 +111,10 @@ main(int argc, char *argv[])
ignored |= mods[i].mask;

break;
case 'k':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation seems messed up, ensure you're using TABs.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also fixed. I forgot to change my editor config. I added an .editorconfig file just for me 😄

@lefuturiste lefuturiste requested a review from N-R-K March 30, 2023 10:26
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.

2 participants