5.7 C
New York
Monday, January 27, 2025

Mac: The best way to map a key for a key+modifier after which use the worth assigned as a part of a keyboard shortcut?


I’ve a Swedish keyboard (with such design). Now there are lots of predetermined keyboard shortcuts in macOS and functions that aren’t attainable in a Swedish design as a result of the second Press key requires modifier keys, for instance, for instance, command + (. Right here, the open sq. assist (For instance, he’s a personality who on a Swedish keyboard requires choice Key to entry and, due to this fact, it isn’t attainable to make use of the shortcut command + (. This drawback additionally exists for different symbols.

Then, as an alternative of reallocating all predefined shortcuts (and since generally I alter to an US keyboard. In Home windows), I want to outline particular keys which are assigned (on this case (), so as to use that key together with different keys to activate predetermined shortcuts (on this case command + (). For instance, mapping right_command to ( Be capable of mix command + right_command to activate the command + ( shortcut.

Utilizing Karabiner-Components, the very first thing to attempt is to map a key to the code of the important thing open_bracket:

{
  "manipulators": (
    {
      "from": {
        "key_code": "right_command",
        "modifiers": { "elective": ("any") }
      },
      "to": ({ "key_code": "open_bracket" }),
      "kind": "fundamental"
    }
  )
}

This doesn’t work, since that place is just assigned on the Swedish keyboard, which is to.

If the important thing mixture simulates that ends in a ( what’s decide + 8works:

{
  "manipulators": (
    {
      "from": {
        "key_code": "right_command",
        "modifiers": { "elective": ("any") }
      },
      "to": (
        {
          "key_code": "8",
          "modifiers": "left_option"
        }
      ),
      "kind": "fundamental"
    }
  )
}

Nevertheless, utilizing this to activate a shortcut as talked about above doesn’t work. That is in all probability as a result of simulate two keys of keys. Karabiner-EventViewer comes out the next when urgent right_command:

(
  {
    "kind": "down",
    "identify": {"key_code":"left_option"},
    "usagePage": "7 (0x0007)",
    "utilization": "226 (0x00e2)",
    "misc": "flags left_option"
  },
  {
    "kind": "down",
    "identify": {"key_code":"8"},
    "usagePage": "7 (0x0007)",
    "utilization": "37 (0x0025)",
    "misc": "flags left_option"
  }
)

And with the modifer key to activate command + (:

(
  {
    "kind": "down",
    "identify": {"key_code":"left_command"},
    "usagePage": "7 (0x0007)",
    "utilization": "227 (0x00e3)",
    "misc": "flags left_command"
  },
  {
    "kind": "down",
    "identify": {"key_code":"left_option"},
    "usagePage": "7 (0x0007)",
    "utilization": "226 (0x00e2)",
    "misc": "flags left_command,left_option"
  },
  {
    "kind": "down",
    "identify": {"key_code":"8"},
    "usagePage": "7 (0x0007)",
    "utilization": "37 (0x0025)",
    "misc": "flags left_command,left_option"
  }
)

Maybe that’s the reason the keyboard mixture doesn’t work, for the reason that second key would press the cancel.

So my query is

(Utilizing the instance of open assist) I need to map a key to ( (in any other case it will require a modification key) after which it’s also possible to use it in keyboard shortcuts akin to cmd + (.

Is there any option to reallocate a key to the exit (and nonetheless use it together with a shortcuts, with out activating issues of simulated a number of keys?

Related Articles

Latest Articles