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

Unable to create a working complex modification with F24 key and modifiers #3475

Open BeauPetite opened 1 year ago

BeauPetite commented 1 year ago

macOS Ventura 13.3.1 Kinesis Advantage 360 Keyboard Karabiner-Elements 14.12.0

Issue:

I am trying to create a complex modification using Karabiner-Elements that combines the Fn24 key with other modifiers (e.g., Shift, Control, Option, Command) to trigger specific keyboard shortcuts. However, I have been unable to get this complex modification to work as intended.

Configuration:

Here's the complex modification I have created:

{ "title": "Custom F24 Key Combinations", "rules": [ { "description": "F24+S triggers ⇧⌘⌃⌥←", "manipulators": [ { "type": "basic", "from": { "key_code": "s", "modifiers": { "mandatory": ["f24"] } }, "to": [ { "key_code": "left_arrow", "modifiers": ["right_shift", "right_command", "right_control", "left_option"] } ] } ] }, { "description": "F24+D triggers ⇧⌘⌃⌥↑", "manipulators": [ { "type": "basic", "from": { "key_code": "d", "modifiers": { "mandatory": ["f24"] } }, "to": [ { "key_code": "up_arrow", "modifiers": ["right_shift", "right_command", "right_control", "left_option"] } ] } ] }, { "description": "F24+F triggers ⇧⌘⌃⌥→", "manipulators": [ { "type": "basic", "from": { "key_code": "f", "modifiers": { "mandatory": ["f24"] } }, "to": [ { "key_code": "right_arrow", "modifiers": ["right_shift", "right_command", "right_control", "left_option"] } ] } ] }, { "description": "F24+C triggers ⇧⌘⌃⌥↓", "manipulators": [ { "type": "basic", "from": { "key_code": "c", "modifiers": { "mandatory": ["f24"] } }, "to": [ { "key_code": "down_arrow", "modifiers": ["right_shift", "right_command", "right_control", "left_option"] } ] } ] } ] }

Troubleshooting Steps Taken:

I assigned the blank #4 shortcut key on the keyboard to f24, and verified it's being read correctly using Karabiner-EventViewer Verified that the shortcuts are working as intended when triggered directly. Checked the log files (console_user_server.log, grabber_agent.log, and overser_agent.log), but they did not provide useful information for this issue.

Request for Help:

I am seeking assistance in determining why my complex modification is not working as intended. Any guidance on how to further troubleshoot this issue, or any suggestions for changes to my configuration, would be greatly appreciated.

Thank you in advance for your help!

eugenesvk commented 1 year ago

F24 isn't a modifier, so you can't use it in the list of modifiers.

You'd need to turn it into a pseudo-modifier using variables like in this example where F3 becomes a modifier and with 8/9 keys changes volume in Goku syntax

 {:des "  [☰f3] 🠿f3 ⟶ ☰f3" :rules [
  [:f3     nil nil
   {:alone {:key :f3 :halt true} :delayed{:canceled[:f3]} :held{:set["mf3"1] :repeat false}
    :afterup{:set["mf3"0]}
    :params{:alone 254 :held 255 :delay 255} }]
  ]}
 {:des "  ☰f38⃣/9⃣  ⟶ volume up/down" :rules [
  [:8 :🔈− ["mf3"1]]
  [:9 :🔈+ ["mf3"1]]
 ]}

or Karabiner syntax

{
        "description" : "  [☰f3] 🠿f3 ⟶ ☰f3",
        "manipulators" : [ {
          "to_if_alone" : [ {
            "key_code" : "f3",
            "halt" : true
          } ],
          "to_if_held_down" : [ {
            "set_variable" : {
              "name" : "mf3",
              "value" : 1
            },
            "repeat" : false
          } ],
          "to_after_key_up" : [ {
            "set_variable" : {
              "name" : "mf3",
              "value" : 0
            }
          } ],
          "to_delayed_action" : {
            "to_if_canceled" : [ {
              "key_code" : "f3"
            } ]
          },
          "parameters" : {
            "basic.to_if_alone_timeout_milliseconds" : 254,
            "basic.to_if_held_down_threshold_milliseconds" : 255,
            "basic.to_delayed_action_delay_milliseconds" : 255
          },
          "from" : {
            "key_code" : "f3"
          },
          "type" : "basic"
        }, {
          "to_if_alone" : [ {
            "key_code" : "f3",
            "halt" : true
          } ],
          "to_if_held_down" : [ {
            "set_variable" : {
              "name" : "mf3",
              "value" : 1
            },
            "repeat" : false
          } ],
          "to_after_key_up" : [ {
            "set_variable" : {
              "name" : "mf3",
              "value" : 0
            }
          } ],
          "to_delayed_action" : {
            "to_if_canceled" : [ {
              "key_code" : "f3"
            } ]
          },
          "parameters" : {
            "basic.to_if_alone_timeout_milliseconds" : 254,
            "basic.to_if_held_down_threshold_milliseconds" : 255,
            "basic.to_delayed_action_delay_milliseconds" : 255
          },
          "from" : {
            "key_code" : "f3"
          },
          "type" : "basic"
        } ]
      }, {
        "description" : "  ☰f38⃣/9⃣  ⟶ volume up/down",
        "manipulators" : [ {
          "from" : {
            "key_code" : "8"
          },
          "to" : [ {
            "key_code" : "volume_down"
          } ],
          "conditions" : [ {
            "name" : "mf3",
            "value" : 1,
            "type" : "variable_if"
          } ],
          "type" : "basic"
        }, {
          "from" : {
            "key_code" : "9"
          },
          "to" : [ {
            "key_code" : "volume_up"
          } ],
          "conditions" : [ {
            "name" : "mf3",
            "value" : 1,
            "type" : "variable_if"
          } ],
          "type" : "basic"
        }, {
          "from" : {
            "key_code" : "8"
          },
          "to" : [ {
            "key_code" : "volume_down"
          } ],
          "conditions" : [ {
            "name" : "mf3",
            "value" : 1,
            "type" : "variable_if"
          } ],
          "type" : "basic"
        }, {
          "from" : {
            "key_code" : "9"
          },
          "to" : [ {
            "key_code" : "volume_up"
          } ],
          "conditions" : [ {
            "name" : "mf3",
            "value" : 1,
            "type" : "variable_if"
          } ],
          "type" : "basic"
        } ]
      },