feat: allow to specify master keyboard#79
Open
lefuturiste wants to merge 2 commits intojcs:masterfrom
Open
Conversation
Provide a new argument -k to specify which keyboard device name should the program attach to. Useful in case where you have xremap running.
N-R-K
suggested changes
Mar 29, 2023
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); |
Contributor
There was a problem hiding this comment.
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.
xbanish.c
Outdated
| ignored |= mods[i].mask; | ||
|
|
||
| break; | ||
| case 'k': |
Contributor
There was a problem hiding this comment.
The indentation seems messed up, ensure you're using TABs.
Author
There was a problem hiding this comment.
Also fixed. I forgot to change my editor config. I added an .editorconfig file just for me 😄
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
-kto specify which keyboard device name should the program attach to.This implementation is basic and simple, I may forgot edge cases.