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

backslash on JIS keyboard #982

Closed
Lizzix opened this issue Sep 13, 2017 · 9 comments
Closed

backslash on JIS keyboard #982

Lizzix opened this issue Sep 13, 2017 · 9 comments
Labels

Comments

@Lizzix
Copy link

Lizzix commented Sep 13, 2017

Hi, there.
I want to remap yen key (international 3) to backslash;
however, when I map yen key to backslash, it prints close bracket ( ] ).
If I set yen key to non us backslash, it prints section ( § ).
Is there any way to solve this issue?

@griffin-stewie
Copy link

same here. I'm using JIS keyboard that builtin with MacBook Pro Late 2016.
It's working when I set Virtual Keyboard Keyboard Type to ISO or ANSI, but it doesn't work when I set it as JIS.

Does anyone has a solution about this issue?

@hirakujira
Copy link

First, open this link in Safari to import JIS to ASCII settings.

karabiner://karabiner/assets/complex_modifications/import?url=https%3A%2F%2Fpqrs.org%2Fosx%2Fkarabiner%2Fcomplex_modifications%2Fjson%2Fjis_to_ascii.json

Then, modify the config file, you can cmd+shift+G to ~/.config/karabiner/assets/complex_modifications/ and you can see a json file.

Find "バッククオートとチルダを割り当てる。" in that file, and modify that part to

{ "description": "バッククオートとチルダを割り当てる。", "manipulators": [ { "type": "basic", "from": { "key_code": "international3", "modifiers": { "optional": [ "any" ] } }, "to": [ { "key_code": "international3", "modifiers": [ "option" ] } ] } ] }

That's all. remember to reopen karabiner-elements to apply

@griffin-stewie
Copy link

@hirakujira
Thank you. I could get behavior that I expect.

@tekezo
I think @hirakujira's way is one of workaround and it's not straightforward. I wish I could remap that I expect via "Simple Modifications" instead of "Complex Modifications".

@hirakujira
Copy link

hirakujira commented Oct 14, 2017

@griffin-stewie

I think this is not very possible unless theres a GUI for complex modifications.
Because the symbol \ in JIS keyboard should be option + yen (international 3), which is not configurable in simple modification.

An easier way to do this is asking @tekezo consider to add sample config like what I modified in the sample list, so you can just add this feature by adding configuration file

@griffin-stewie
Copy link

We could remap Yen to backslash simply Karabiner(previous version of Karabiner-Elements) so I thought current behavior is not expected behavior.

@terry182
Copy link

terry182 commented Jan 14, 2018

Same here. But my problem with my JIS keyboard is that it has a backslash key right next to the slash key. The event viewer shows the key was International1 but I can't remap it to backslash.

I tried the remapping and it gives the same result as @ambieneuphoria

@stale
Copy link

stale bot commented Mar 15, 2018

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.

@stale stale bot added the stale label Mar 15, 2018
@stale stale bot closed this as completed Mar 22, 2018
@Kuniwak
Copy link

Kuniwak commented Dec 21, 2020

This problem still occurred on 12.10.0.

That was the event logs when I typed ] by a built-in keyboard on MacBook Pro (15-inch, 2018). It seems the ] was recognized as \, but I could type ] by the same key on other apps like TextEdit as correctly.

I assumed the problem caused by keyboard type mismatch (expected JIS but it might be recognized as US). So I had tried following steps:

  1. Try the comment
    1. I confirmed that the problem was not solved on EventViewer
  2. Explicitly set a keyboard type
    1. I modified the country code of VirtualKeyboard to 45 from 0
    2. Then I selected JIS on the presented keyboard detection dialogs
    3. I restarted my computer
    4. I Confirmed that the problem was not solved on EventViewer
  3. Re-install Karabiner-Elements
    1. I uninstalled Karabiner-Elements
    2. I removed /Library/Application\ Support/org.pqrs and ~/.config/karabiner
    3. I re-installed Karabiner-Elements v12.10.0
    4. I confirmed that the problem was not solved on EventViewer

(and why I used v12.10.0 is I could not activate the driver of 13.13.0 on Catalina.)


My environments

sw_vers

$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.15.7
BuildVersion:	19H15

~/.config/karabiner/karabiner.json

{
    "global": {
        "check_for_updates_on_startup": true,
        "show_in_menu_bar": true,
        "show_profile_name_in_menu_bar": false
    },
    "profiles": [
        {
            "complex_modifications": {
                "parameters": {
                    "basic.simultaneous_threshold_milliseconds": 50,
                    "basic.to_delayed_action_delay_milliseconds": 500,
                    "basic.to_if_alone_timeout_milliseconds": 1000,
                    "basic.to_if_held_down_threshold_milliseconds": 500,
                    "mouse_motion_to_scroll.speed": 100
                },
                "rules": []
            },
            "devices": [
                {
                    "disable_built_in_keyboard_if_exists": false,
                    "fn_function_keys": [],
                    "identifiers": {
                        "is_keyboard": true,
                        "is_pointing_device": false,
                        "product_id": 34304,
                        "vendor_id": 1452
                    },
                    "ignore": false,
                    "manipulate_caps_lock_led": true,
                    "simple_modifications": []
                }
            ],
            "fn_function_keys": [
                {
                    "from": {
                        "key_code": "f1"
                    },
                    "to": {
                        "consumer_key_code": "display_brightness_decrement"
                    }
                },
                {
                    "from": {
                        "key_code": "f2"
                    },
                    "to": {
                        "consumer_key_code": "display_brightness_increment"
                    }
                },
                {
                    "from": {
                        "key_code": "f3"
                    },
                    "to": {
                        "key_code": "mission_control"
                    }
                },
                {
                    "from": {
                        "key_code": "f4"
                    },
                    "to": {
                        "key_code": "launchpad"
                    }
                },
                {
                    "from": {
                        "key_code": "f5"
                    },
                    "to": {
                        "key_code": "illumination_decrement"
                    }
                },
                {
                    "from": {
                        "key_code": "f6"
                    },
                    "to": {
                        "key_code": "illumination_increment"
                    }
                },
                {
                    "from": {
                        "key_code": "f7"
                    },
                    "to": {
                        "consumer_key_code": "rewind"
                    }
                },
                {
                    "from": {
                        "key_code": "f8"
                    },
                    "to": {
                        "consumer_key_code": "play_or_pause"
                    }
                },
                {
                    "from": {
                        "key_code": "f9"
                    },
                    "to": {
                        "consumer_key_code": "fast_forward"
                    }
                },
                {
                    "from": {
                        "key_code": "f10"
                    },
                    "to": {
                        "consumer_key_code": "mute"
                    }
                },
                {
                    "from": {
                        "key_code": "f11"
                    },
                    "to": {
                        "consumer_key_code": "volume_decrement"
                    }
                },
                {
                    "from": {
                        "key_code": "f12"
                    },
                    "to": {
                        "consumer_key_code": "volume_increment"
                    }
                }
            ],
            "name": "Default profile",
            "parameters": {
                "delay_milliseconds_before_open_device": 1000
            },
            "selected": true,
            "simple_modifications": [],
            "virtual_hid_keyboard": {
                "country_code": 45,
                "mouse_key_xy_scale": 100
            }
        }
    ]
}

/Library/Application\ Support/org.pqrs/tmp/karabiner_grabber_device_details.json

[
    {
        "device_id": 4294969187,
        "is_karabiner_virtual_hid_device": false,
        "is_keyboard": true,
        "is_pointing_device": false,
        "product_id": 34304,
        "vendor_id": 1452
    },
    {
        "device_id": 4294968665,
        "is_built_in_keyboard": true,
        "is_karabiner_virtual_hid_device": false,
        "is_keyboard": true,
        "is_pointing_device": false,
        "location_id": 18446744071567310848,
        "manufacturer": "Apple Inc.",
        "product": "Apple Internal Keyboard / Trackpad",
        "product_id": 636,
        "serial_number": "FM782150110HYYMAM+TWN",
        "transport": "USB",
        "vendor_id": 1452
    },
    {
        "device_id": 4294968664,
        "is_built_in_pointing_device": true,
        "is_karabiner_virtual_hid_device": false,
        "is_keyboard": false,
        "is_pointing_device": true,
        "location_id": 18446744071567310848,
        "manufacturer": "Apple Inc.",
        "product": "Apple Internal Keyboard / Trackpad",
        "product_id": 636,
        "serial_number": "FM782150110HYYMAM+TWN",
        "transport": "USB",
        "vendor_id": 1452
    }
]

/Library/Application\ Support/org.pqrs/tmp/karabiner_grabber_manipulator_environment.json

{
    "frontmost_application": {
        "bundle_identifier": "com.google.Chrome",
        "file_path": "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
    },
    "input_source": {
        "input_mode_id": "com.apple.inputmethod.Roman",
        "input_source_id": "com.apple.inputmethod.Kotoeri.Roman",
        "language": "en"
    },
    "system_preferences_properties": {
        "keyboard_types": [
            [
                {
                    "country_code": 45,
                    "product_id": 10203,
                    "vendor_id": 5824
                },
                42
            ]
        ],
        "scroll_direction_is_natural": true,
        "use_fkeys_as_standard_function_keys": false
    },
    "variables": {},
    "virtual_hid_keyboard_country_code": 45,
    "virtual_hid_keyboard_keyboard_type": "jis"
}

@thomas-huang
Copy link

First, open this link in Safari to import JIS to ASCII settings.首先,在 Safari 中打开此链接以将 JIS 导入 ASCII 设置。

karabiner://karabiner/assets/complex_modifications/import?url=https%3A%2F%2Fpqrs.org%2Fosx%2Fkarabiner%2Fcomplex_modifications%2Fjson%2Fjis_to_ascii.json

Then, modify the config file, you can cmd+shift+G to /.config/karabiner/assets/complex_modifications/ and you can see a json file.然后,修改配置文件,可以cmd+shift+G到/.config/karabiner/assets/complex_modifications/,就可以看到一个json文件。

Find "バッククオートとチルダを割り当てる。" in that file, and modify that part to

{ "description": "バッククオートとチルダを割り当てる。", "manipulators": [ { "type": "basic", "from": { "key_code": "international3", "modifiers": { "optional": [ "any" ] } }, "to": [ { "key_code": "international3", "modifiers": [ "option" ] } ] } ] }

That's all. remember to reopen karabiner-elements to apply就这样。记得重新打开 karabiner-elements 来应用

It works, thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants