pqrs-org / Karabiner-Elements

Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.
https://pqrs.org/osx/karabiner/
The Unlicense
18.73k stars 836 forks source link

Automatic, Device Specific Profiles #792

Closed nfarrar closed 6 years ago

nfarrar commented 7 years ago

When I'm at my desk, I use an external keyboard & mouse. I use Karabiner-Elements to remap left-option to left-command and left-command to left-option.

I don't want this applied to the internal keyboard though. I see the devices tab, in the GUI, but am not sure how to apply the profile to a specific device. Wasn't able to find any examples of doing this. Is it possible?

Here's basic configuration I'm using:

{
    "global": {
        "check_for_updates_on_startup": true,
        "show_in_menu_bar": true,
        "show_profile_name_in_menu_bar": false
    },
    "profiles": [
        {
            "devices": [],
            "fn_function_keys": {
                "f1": "display_brightness_decrement",
                "f10": "mute",
                "f11": "volume_decrement",
                "f12": "volume_increment",
                "f2": "display_brightness_increment",
                "f3": "mission_control",
                "f4": "launchpad",
                "f5": "illumination_decrement",
                "f6": "illumination_increment",
                "f7": "rewind",
                "f8": "play_or_pause",
                "f9": "fastforward"
            },
            "name": "Default profile",
            "selected": true,
            "simple_modifications": {},
            "virtual_hid_keyboard": {
                "caps_lock_delay_milliseconds": 0,
                "keyboard_type": "ansi"
            },
            "name": "Default profile",
            "selected": true,
            "simple_modifications": {
                "left_command": "left_option",
                "left_option": "left_command"
            }
        }
    ]
}
starsy commented 7 years ago

@nfarrar check out this fork: https://github.com/starsy/Karabiner-Elements

tonylegrone commented 7 years ago

@starsy, I came here looking for the same functionality. Your fork works great!

levity commented 7 years ago

@starsy is it true that device-specific key modifications are not supported in the non-forked version, even by editing karabiner.json directly?

starsy commented 7 years ago

@levity that's true. original KBE doesn't have device-specific key modification capability.

lavelle commented 7 years ago

@starsy is there any plan to merge your fork back into master?

dguo commented 7 years ago

@lavelle, he has #756 open. I'm also looking forward to when it gets merged.

starsy commented 7 years ago

@lavelle @dguo

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.

lavelle commented 7 years ago

Cool, thats good to know, thanks for the update @starsy.

I've started using your fork and it works perfectly for me. Hopefully we'll see it make its way to master eventually but in the meantime i can keep using the fork. Thanks for creating such a useful tool!

dguo commented 7 years ago

And thanks for being so detailed and considerate, @starsy!

caseymhunt commented 7 years ago

@nfarrar I have the exact same requirement. I need a certain remapping to function on my external (bluetooth) keyboard but not to my internal MBP keyboard.

I also require that Caps Lock remapping (hyperkey) work for both keyboards which precludes me from using your fork @starsy though it does look elegant.

starsy commented 7 years ago

@caseymhunt you can configure Caps Lock remapping for both keyboards with this fork.

stale[bot] commented 6 years ago

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.