-
-
Notifications
You must be signed in to change notification settings - Fork 866
Add per device support for key mappings #752
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
Conversation
Hi @carrigmore Thanks for your comments. However sorry my change will not fix the problem that you raised. There is a "not_to = true" attribute on "locking_num_lock" in simple_modifications.json. I think @tekezo may have some reason to put it there and he can explain. But before that, would you please try remove that attribute from the json file and see whether the newly defined mapping works? As none of my keyboards has num_lock keys, sorry I would not be able to test your scenario on my side. |
support identifying available devices and their names on-the-fly
@perlun I would like to do the rebase, but as @tekezo is not showing his opinion on accepting the functionality and meanwhile KBE is being developed in very fast pace, the rebased code will expire very soon, so i decide to follow it instead of create another pull request or so. I put some thoughts in another thread: #792 Yes, i opened a pull request quite long ago, @tekezo didn't respond to it. I think there could be several reasons, as @tekezo not sending any words, this is my pure guess:
So I have created this fork as https://github.com/starsy/Karabiner-Elements , the "master" branch is for stable release and the "follow" branch keeps tracking and following KBE original's change, in case one day @tekezo would like to accept it, it can be done quickly. The stable release and pre-built packages can be found in "Release" section. Once the recently added complex configuration in KBE original is stabilized, I would like to review the difficulty and necessity to extend this highly demanded feature to it. |
Thanks for the explanation @starsy. To avoid confusion, could you rename your fork to |
Thank you for your fork! I'm working on importing the changes. |
Thanks @tekezo for KBE such great tool! Really glad to see you are adding this highly demand feature to make KBE even greater! As you are personally working on it now, I am going to close this pull request. But in case you need any help, please don't hesitate to let me know. |
Turns out that simple_modifications does the right thing for us here but complex_modifications does not. Specifically, the latter produces different events in the following cases: - Shift down, Command down (produces Shift down, Command down). - Command down, Shift down (produces Option down, Shift down). And: - Shift down, Option down (produces Shift down, Option down). - Option down, Shift down (produces Command down, Shift down). In other words, the keys get swapped only if they are pressed alone. I believe `device_if` support is coming to `simple_modifications` soon (see pqrs-org/Karabiner-Elements#752 (comment)) so I am just going to switch to that and wait. If it doesn't come soon I'll see if I can come up with a more verbose complex_modifications equivalent to what simple_modifications is doing.
@starsy really, really great work! This is actually the core feature I need from this program. Without it is kinda useless, applying rebinds to ALL keyboards does not make sense to me at all. Unless your keyboards are all the same :) |
Karabiner-Elements v0.91.13 supports per device settings in Note: |
Hi Fumihiko San,
Hope you are doing fine.
Thanks for writing Karabiner such a great key mapping tool. I wrote some code to add per-device support for each key mappings for my own needs, e.g. this key mapping only works on keyboard A and that key mapping only works on keyboard B. The new feature works fine on my MBPR thus I would like to contribute this code back to the origin source to benefit more people having the similar needs. Also, it would be fantastic if you can review the code changes and let me know your comments. I would be more than happy to make further improvement accordingly.
Here is a screen shot for the configuration window:

There are many scenarios people needs this feature, especially when there is an external PC keyboard attached to the MacBook Pro and when they are using the two keyboards at the same time. E.g. 1) swap the left command/option on the external KB but leave the internal ones untouched. 2) map the right_option on the internal KB to forward_delete, but leave right_option on the external KB unchanged because there is a specific "delete" key on the external PC keyboard, etc.
There are certain points that you might need be aware of:
Other changes should be straightforward by reading the code diff.
Anyway, appreciate you can review the code, let me know your comments, and I would be extremely happy if you found these changes are useful and would like to accept them into the base.
Cheers,
Yang