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

Make modifier keys configurable, autodetect keyboard layout #7

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

Conversation

ydahhrk
Copy link

@ydahhrk ydahhrk commented Jul 18, 2016

  1. Moved a bunch of documentation to unix/README.md.
  2. Desired modifier keys to grab are now sent as program arguments. See unix/README.mx#Arguments.
  3. The program now automatically grabs/releases the keyboard depending on whether the current layout is Dvorak or not, respectively.

This is a fix for #2, #4 and also a more versatile solution than the proposed #5. However, it only applies to the Unix code; I left the Windows version unmodified.

ydahhrk added 4 commits May 9, 2016 10:53
The original code only grabs Control, Alt, Control+Shift and Alt+Shift.
While he lack of versatility is slightly upsetting, the real problem is
that NumLock is considered a modifier so turning it on breaks the
grabbing, confusing some people.

This, for example, is a likely victim:
http://askubuntu.com/questions/143573

This commit allows the user to specify the modifiers they want to grab
when the program is invoked.

This fix only applies to the unix binary!

I also moved the in-code header documentation to a README since it was
getting a little long.
There was a bogus accent getting in the way of Alt+Shift working.

Also updated a comment referring to -DXDQ_GREEDY, a compilation
flag that was obsoleted in the previous commit.
The Unix binary now automatically realizes whether the current
layout is Dvorak and grabs/ungrabs keys as appropriate. This
prevents the binary from shuffling the shortcuts all over the place
when the user reverts to Qwerty, for example.

This is part of kentonv#2. (It's missing the
Windows implementation)

The code also validates argvs better. It now complains if the user
sends unknown modifiers as program arguments. These bogus strings
used to be simply ignored.
I forgot that macros meant to be editable during compilation
are supposed to have "XDQ_" as prefix. Fixed for
XDQ_MODIFIER_LIMIT.
@kentonv
Copy link
Owner

kentonv commented Aug 8, 2016

Hi there! This looks useful. Unfortunately I don't have time to review this carefully or really do any maintenance work on this code. :(

As an alternative, I'd be happy to accept a change to the README which adds a link to your fork.

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