Karabiner-elements: [Enhancement] Different key mappings on different keyboards w/o switching profile

Created on 7 Jun 2017  路  13Comments  路  Source: pqrs-org/Karabiner-Elements

I have made some enhancements to KBE to remove the pain of switching profiles for 2+ keyboards by supporting per-device configuration. Please take a look at https://github.com/starsy/Karabiner-Elements if you are interested in. The release/download link is here: https://github.com/starsy/Karabiner-Elements/releases/tag/v1.0_merged . Pull request is here: https://github.com/tekezo/Karabiner-Elements/pull/752. It works pretty stably on my MBPR, I think it worths a try. Hope it can solve your problems too. Please don't hesitate to let me know if any issues or questions.

image

stale

Most helpful comment

This is so useful for those who have external keyboards. Please merge @starsy 's PR.

All 13 comments

Very nice! I will have to try this out. Does the original karabiner support this kind of thing?

@palme1337 the old karabiner supported it, however the new karabiner elements doesn't, hope one day the official version would support it. I just released a new version with minor enhancement, feel free to try and let me know any comments.

This is so useful for those who have external keyboards. Please merge @starsy 's PR.

This is exactly what we need!

@starsy Can you do an official pull request to merge this into the original tekezo/Karabiner-Elements codebase?

@eytanhanig I have opened a pull request, but @tekezo is not responding to it. I put some thoughts in another thread: https://github.com/tekezo/Karabiner-Elements/issues/792 now i copy them here to explain what I think as the reason.


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:

  • The change itself is big in terms both code size and scope. There are several thousands of lines of change, from PreferenceWindow to KarabinerKit to libkrb to device_grabber to console_user_server, from ObjectiveC to C to C++, the only thing not touched is the kernel module. It is difficult to review so much code change at one time and to merge w/o a throughout review is risky and not responsible for the large KBE user groups.
  • The configuration file format requires a change which introduce a backward compatibility issue to the wide user groups again. The initial KBE's config file has no per device key mapping support in design -- this is quite strange because it is there in the old KB feature set. I have to change the config file format in a non-backward compatible way to support it, hmmm @tekezo i would like to blame this to you. 馃槥
  • @tekezo maintains a very nice suite of unit test cases for his code as quality guarantee. But due to a wide spectrum of changes, especially the changes in device_grabber and its low level dependencies, many of the C/C++ function interfaces has been changed, which breaks the unit test suite. i haven't decided to update them due to the workload and the necessity. But if @tekezo is willing to accept the pull request, i would be glad to extend the change to unit test suite.
  • Code style. when you look deep into the code, @tekezo has his very own taste in how to write C++ code. the whole device_grabber and user_console_server is composed purely by .hpp, which means both the class/function definitions and implementations are put in header files. this is definitely debatable with certain limitations like long build time -- not be able to do parallel compiling, the cross-reference class types across header files is cumbersome or impossible. Thus I introduced a few new .cpp files to address these challenges, however it apparently broke @tekezo 's code style purity and paradigms.
  • KBE is obviously @tekezo 's own baby when looking at the contribution history. There is no other significant contributors to the project, @tekezo may just want to keep his total ownership on this, which is understandable.

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.

@wincent very cool!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Activate

This issue should be closed (functionality already exists via device_if/device_unless).

This issue should be closed (functionality already exists via device_if/device_unless).

It's also in the UI:

image

I just tried, oh yeah, it works perfect! Thanks for help.
It can be closed

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings