Skip to content

feat: allow to specify master keyboard#79

Open
lefuturiste wants to merge 2 commits intojcs:masterfrom
lefuturiste:master
Open

feat: allow to specify master keyboard#79
lefuturiste wants to merge 2 commits intojcs:masterfrom
lefuturiste:master

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
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
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