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.81k stars 838 forks source link

Request: (Japanese Karabiner functionality) Command keys to En and Ja #386

Closed b-d-m-p closed 6 years ago

b-d-m-p commented 8 years ago

Hi,

Thanks for making this utility—I really appreciate it.

I use Japanese everyday and I got a Spanish keyboard, so I was using Karabiner's first option in the Japanese section, which changes, on one tap, the left command key to English and the right command key to Japanese. (I've included a screenshot.)

karabiner japanese

With Karabiner-Elements, I mapped my fn key to En and my right cmd to Ja. Is there a way that I can add this specific option, which differentiates between a tap and a hold, to Karabiner-Elements? Having this would really make my work day more pleasant. 😄

Any info you can give to point me in the right direction would be very appreciated.

Thanks.

htakemoto commented 7 years ago

I am also the one waiting for this feature.

delphinus commented 7 years ago

You can use the feature by forked binary that can be downloaded below.

My sample setting:

{
    "profiles": [
        {
            "devices": [],
            "name": "Default profile",
            "selected": true,
            "simple_modifications": {
                "left_command": "left_command",
                "right_command": "right_command"
            },
            "standalone_modifiers": {
                "left_command": "japanese_eisuu",
                "right_command": "japanese_kana"
            }
        }
    ]
}

I hope to merge PR early.

b-d-m-p commented 7 years ago

Awesome! Thanks so much!

b-d-m-p commented 7 years ago

I installed your fork, but I'm not sure how to apply those settings. Could you describe the process?

b-d-m-p commented 7 years ago

Found it! https://github.com/tekezo/Karabiner-Elements/pull/247

htakemoto commented 7 years ago

It didn't work.

First, I am very confused with the config location

~/.config/karabiner/karabiner.json ~/.karabiner.d/configuration/karabiner.json

Which is the one to add our custom json?

I also tried both standalone keys 0.90.72 (with hyper key) and standalone keys 0.90.72 from the one @delphinus provided. There is no luck.

UPDATE:

It seems there are some changes with 0.90.72, so here is how I made it work with the one @delphinus provided:

  1. install standalone keys 0.90.72 (NOT with hyper key)
  2. add your custom config into ~/.config/karabiner/karabiner.json
  3. update karabiner.json to replace standalone_modifiers with standalone_keys.

Here is my complete ~/.config/karabiner/karabiner.json file

{
    "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": {
                "left_command": "left_command",
                "right_command": "right_command"
            },
            "standalone_keys": {
                "left_command": "japanese_eisuu",
                "right_command": "japanese_kana"
            },
            "virtual_hid_keyboard": {
                "keyboard_type": "ansi"
            }
        }
    ]
}
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.