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.72k stars 836 forks source link

backslash on JIS keyboard #982

Closed Lizzix closed 6 years ago

Lizzix commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

@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 commented 7 years ago

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

terry182 commented 6 years ago

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[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.

Kuniwak commented 3 years ago

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 ```console $ sw_vers ProductName: Mac OS X ProductVersion: 10.15.7 BuildVersion: 19H15 ``` ### ~/.config/karabiner/karabiner.json ```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 ```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 ```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 commented 9 months ago

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