I’ve a Swedish keyboard (with such a structure). Now there are a lot of default keyboard shortcuts in macOS and apps that are not potential on a Swedish structure as a result of the second key press requires modifier keys, for instance, command + [
. Here, the open square bracket [
, for example, is a character that on a Swedish keyboard require the option
key to access and therefore it’s not possible to use the shortcut command + [
. This problem exists for other symbols as well.
So instead of remapping all predefined shortcuts (and because I sometimes switch to a US keyboard on Windows), I’d like to define specific keys that maps to (in this case [
), so that I can use that key in combination with other keys to trigger the default shortcuts (in this case command + [
). For example, mapping right_command
to [
to be able to combine command + right_command
to trigger the command + [
shortcut.
Using Karabiner-Elements, first thing to try is mapping a key to directly to the key code open_bracket
:
{ "manipulators": [ { "from": { "key_code": "right_command", "modifiers": { "optional": ["any"] } }, "to": [{ "key_code": "open_bracket" }], "sort": "fundamental" } ] }
This does not work because it simply maps to that place on the Swedish keyboard, which is å.
If I simulate the important thing mixture that leads to a [
, which is opt + 8
, it does work:
{ "manipulators": [ { "from": { "key_code": "right_command", "modifiers": { "optional": ["any"] } }, "to": [ { "key_code": "8", "modifiers": "left_option" } ], "sort": "fundamental" } ] }
Nonetheless, utilizing this to set off a shortcut just like the one talked about above would not work. That is most likely as a result of two key presses are simulated. Karabiner-EventViewer outputs the next when urgent right_command
:
[ { "type": "down", "name": {"key_code":"left_option"}, "usagePage": "7 (0x0007)", "usage": "226 (0x00e2)", "misc": "flags left_option" }, { "type": "down", "name": {"key_code":"8"}, "usagePage": "7 (0x0007)", "usage": "37 (0x0025)", "misc": "flags left_option" } ]
And with the modifer key to set off command + [
:
[ { "type": "down", "name": {"key_code":"left_command"}, "usagePage": "7 (0x0007)", "usage": "227 (0x00e3)", "misc": "flags left_command" }, { "type": "down", "name": {"key_code":"left_option"}, "usagePage": "7 (0x0007)", "usage": "226 (0x00e2)", "misc": "flags left_command,left_option" }, { "type": "down", "name": {"key_code":"8"}, "usagePage": "7 (0x0007)", "usage": "37 (0x0025)", "misc": "flags left_command,left_option" } ]
Maybe that is why the keyboard mixture doesn’t work, because the second key press would would cancel it.
So my query is
[Using the open bracket example] I want to have the ability to map a key to [
(which in any other case would require a modify key) after which additionally be capable of use it in keyboard shortcuts reminiscent of cmd + [
.
Is there a method to remap a key to output [ and nonetheless use it together with modifiers for shortcuts, with out triggering points from simulated a number of key presses?