Karabiner

User avatar
Muirium
µ

23 Aug 2023, 01:19

fanf wrote:
22 Aug 2023, 21:38
Ohhh I think it’s the <<< which is supported by your interactive shell (usually zsh on macOS) but not by /bin/sh (a POSIX sh derived from FreeBSD’s Almquist shell). I guess you can just delete the <<<$0 bit because bc will read your calculation from stdin by default.
Well spotted! I had no idea you could just pipe into bc. Every example I remember used <<< after the fact. Thanks for the tip!

This one finally works:

Code: Select all

"shell_command": "printf %g $(pbpaste | bc -l) | pbcopy"
And it works on a wider range of expressions, too:

Code: Select all

1/3=0.333333
2^2=4
sqrt(4^2+3^2)=5
1/sqrt(1-(.99^2))=7.08881
For the curious: that last one is the time dilation factor at 99% lightspeed.

My single keystroke calculator is complete:

Code: Select all

{
      "description": "∑ Calc: ⌃ Control = Equals ⇨ Calculate Expression and Paste",
      "manipulators": [
        {
          "from": {
            "key_code": "equal_sign",
            "modifiers": {
              "mandatory": [
                "control",
                "shift"
              ],
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "key_code": "c",
              "modifiers": [
                "left_command"
              ],
              "hold_down_milliseconds": 200
            },
            {
              "shell_command": "printf %g $(pbpaste | bc -l) | pbcopy"
            },
            {
              "key_code": "left_command",
              "hold_down_milliseconds": 200
            },
            {
              "key_code": "v",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "type": "basic"
        },
        {
          "from": {
            "key_code": "equal_sign",
            "modifiers": {
              "mandatory": [
                "control"
              ],
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "key_code": "c",
              "modifiers": [
                "left_command"
              ],
              "hold_down_milliseconds": 200
            },
            {
              "shell_command": "printf %g $(pbpaste | bc -l) | pbcopy"
            },
            {
            	"key_code": "right_arrow"
            },
            {
            	"key_code": "equal_sign"
            },
            {
              "key_code": "left_command",
              "hold_down_milliseconds": 200
            },
            {
              "key_code": "v",
              "modifiers": [
                "left_command"
              ]
            }
          ],
          "type": "basic"
        }
      ]
    }
I’m fair chuffed, for now. That is in fact a good thing. Should also be easier to tweak it when I inevitably get the itch again. :D

User avatar
Muirium
µ

07 Sep 2023, 17:45

Modified my select word macro to work a bit better in certain apps *cough* Obsidian *cough* which are a bit slow for Karabiner's native speed. A ten millisecond wait between keystrokes is sufficient, and barely noticeable in use. (You'll see it in the non-Shifted versions.)

Code: Select all

{
      "description": "⌃ Control C/V ⇨ Select Word Left/Right",
      "manipulators": [
        {
          "from": {
            "key_code": "c",
            "modifiers": {
              "mandatory": [
                "control"
              ],
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_arrow"
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_option"
              ]
            },
            {
              "key_code": "left_command",
              "hold_down_milliseconds": 10
            },
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_option",
                "left_shift"
              ],
              "repeat": false
            }
          ],
          "type": "basic"
        },
        {
          "from": {
            "key_code": "c",
            "modifiers": {
              "mandatory": [
                "control",
                "shift"
              ],
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_option",
                "left_shift"
              ],
              "repeat": false
            }
          ],
          "type": "basic"
        },
        {
          "from": {
            "key_code": "v",
            "modifiers": {
              "mandatory": [
                "control"
              ],
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_arrow"
            },
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_option"
              ]
            },
            {
              "key_code": "left_command",
              "hold_down_milliseconds": 10
            },
            {
              "key_code": "left_arrow",
              "modifiers": [
                "left_option",
                "left_shift"
              ],
              "repeat": false
            }
          ],
          "type": "basic"
        },
        {
          "from": {
            "key_code": "v",
            "modifiers": {
              "mandatory": [
                "control"
              ],
              "optional": [
                "caps_lock",
                "shift"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_arrow",
              "modifiers": [
                "left_option",
                "left_shift"
              ],
              "repeat": true
            }
          ],
          "type": "basic"
        }
      ]
    },
Revisiting this prompted me to fix another buggy matter where, on subsequent presses, the macro sometimes (but not always) stayed put on the same word. Threw in an extra arrow nudge at the start, appears to have fixed all that. 🤷🏼‍♂️

User avatar
Muirium
µ

06 Dec 2023, 19:16

Here's how I fixed my PC to Mac modifier key chording problem mentioned here. Several things were going sideways, so I'll explain them for my later self as much as anyone. :geek:
  • When swapping around modifiers, Karabiner gets tricky in the "from": condition. Quite unintuitively, you must include the output key in the definition of its own input. You must include Command as an optional modifier even when defining Command. This hadn't occurred to me so I was getting weird behaviour where Alt would map to Command just fine, and Control + Command would work too, but Option + Command wasn't working. The best "optional": modifiers in this case are simply "any".
  • I also learned that to "device_if" against several values—I’m screening for my Realforce, Novatouch, Filco and this 8BitDo now—you must list their "vendor_id"s in separate {}, blocks, not just sequentially as I'd left it before. Looks dirtier but actually works now.
  • The above is quite enough to get general Command and Option behaviour working fine, but I overload mine for Spotlight (double press Command to bring it up, an age old Quicksilver habit of mine), and Shortcat (double press Option to engage it). I'd defined both of these in their own rules but neither one was working with PC keyboards, even with the rules in the correct evaluation order in Karabiner. They still worked fine on my Mac-native keyboards. Something about these PC mod remaps messes up their triggers.
  • So what I did was take the "variable_if", "to_delayed_action" and "to_if_canceled" logic from those rules and implement it again here, inside the "device_if" logic that determines which keyboards are PC layout. The result is duplication within the rules, but the behaviour I desire and mission accomplished. For now…

Code: Select all

{
  "title": "Rules Under Construction",
  "description": "Argh!",
  "rules": [
    {
      "description": "⌨️ PC Keyboards: Swap ⌘ Command and ⌥ Option",
      "manipulators": [
        {
          "type": "basic",
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 300
          },
          "conditions": [
            {
              "type": "variable_if",
              "name": "left_option pressed",
              "value": 1
            }
          ],
          "from": {
            "key_code": "left_command",
            "modifiers": {
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "key_code": "spacebar",
              "modifiers": [
                "left_option"
              ]
            }
          ]
        },
        {
          "type": "basic",
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 300
          },
          "conditions": [
            {
              "type": "device_if",
              "identifiers": [
                {
                  "vendor_id": 1241
                },
                {
                  "vendor_id": 2131
                },
                {
                  "vendor_id": 9494
                },
                {
                  "vendor_id": 11720
                }
              ]
            }
          ],
          "from": {
            "key_code": "left_command",
            "modifiers": {
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "left_option pressed",
                "value": 1
              }
            },
            {
              "key_code": "left_option"
            }
          ],
          "to_delayed_action": {
            "to_if_invoked": [
              {
                "set_variable": {
                  "name": "left_option pressed",
                  "value": 0
                }
              }
            ],
            "to_if_canceled": [
              {
                "set_variable": {
                  "name": "left_option pressed",
                  "value": 0
                }
              }
            ]
          }
        },
        {
          "type": "basic",
          "conditions": [
            {
              "type": "device_if",
              "identifiers": [
                {
                  "vendor_id": 1241
                },
                {
                  "vendor_id": 2131
                },
                {
                  "vendor_id": 9494
                },
                {
                  "vendor_id": 11720
                }
              ]
            }
          ],
          "from": {
            "key_code": "left_command",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_option"
            }
          ]
        },
        {
          "type": "basic",
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 300
          },
          "conditions": [
            {
              "type": "variable_if",
              "name": "left_command pressed",
              "value": 1
            }
          ],
          "from": {
            "key_code": "left_option",
            "modifiers": {
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "apple_vendor_keyboard_key_code": "spotlight"
            }
          ]
        },
        {
          "type": "basic",
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 300
          },
          "conditions": [
            {
              "type": "device_if",
              "identifiers": [
                {
                  "vendor_id": 1241
                },
                {
                  "vendor_id": 2131
                },
                {
                  "vendor_id": 9494
                },
                {
                  "vendor_id": 11720
                }
              ]
            }
          ],
          "from": {
            "key_code": "left_option",
            "modifiers": {
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "left_command pressed",
                "value": 1
              }
            },
            {
              "key_code": "left_command"
            }
          ],
          "to_delayed_action": {
            "to_if_invoked": [
              {
                "set_variable": {
                  "name": "left_command pressed",
                  "value": 0
                }
              }
            ],
            "to_if_canceled": [
              {
                "set_variable": {
                  "name": "left_command pressed",
                  "value": 0
                }
              }
            ]
          }
        },
        {
          "type": "basic",
          "conditions": [
            {
              "type": "device_if",
              "identifiers": [
                {
                  "vendor_id": 1241
                },
                {
                  "vendor_id": 2131
                },
                {
                  "vendor_id": 9494
                },
                {
                  "vendor_id": 11720
                }
              ]
            }
          ],
          "from": {
            "key_code": "left_option",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_command"
            }
          ]
        },
        {
          "type": "basic",
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 300
          },
          "conditions": [
            {
              "type": "variable_if",
              "name": "right_option pressed",
              "value": 1
            }
          ],
          "from": {
            "key_code": "right_command",
            "modifiers": {
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "key_code": "spacebar",
              "modifiers": [
                "right_option"
              ]
            }
          ]
        },
        {
          "type": "basic",
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 300
          },
          "conditions": [
            {
              "type": "device_if",
              "identifiers": [
                {
                  "vendor_id": 1241
                },
                {
                  "vendor_id": 2131
                },
                {
                  "vendor_id": 9494
                },
                {
                  "vendor_id": 11720
                }
              ]
            }
          ],
          "from": {
            "key_code": "right_command",
            "modifiers": {
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "right_option pressed",
                "value": 1
              }
            },
            {
              "key_code": "right_option"
            }
          ],
          "to_delayed_action": {
            "to_if_invoked": [
              {
                "set_variable": {
                  "name": "right_option pressed",
                  "value": 0
                }
              }
            ],
            "to_if_canceled": [
              {
                "set_variable": {
                  "name": "right_option pressed",
                  "value": 0
                }
              }
            ]
          }
        },
        {
          "type": "basic",
          "conditions": [
            {
              "type": "device_if",
              "identifiers": [
                {
                  "vendor_id": 1241
                },
                {
                  "vendor_id": 2131
                },
                {
                  "vendor_id": 9494
                },
                {
                  "vendor_id": 11720
                }
              ]
            }
          ],
          "from": {
            "key_code": "right_command",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_option"
            }
          ]
        },
        {
          "type": "basic",
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 300
          },
          "conditions": [
            {
              "type": "variable_if",
              "name": "right_command pressed",
              "value": 1
            }
          ],
          "from": {
            "key_code": "right_option",
            "modifiers": {
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "apple_vendor_keyboard_key_code": "spotlight"
            }
          ]
        },
        {
          "type": "basic",
          "parameters": {
            "basic.to_delayed_action_delay_milliseconds": 300
          },
          "conditions": [
            {
              "type": "device_if",
              "identifiers": [
                {
                  "vendor_id": 1241
                },
                {
                  "vendor_id": 2131
                },
                {
                  "vendor_id": 9494
                },
                {
                  "vendor_id": 11720
                }
              ]
            }
          ],
          "from": {
            "key_code": "right_option",
            "modifiers": {
              "optional": [
                "caps_lock"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "right_command pressed",
                "value": 1
              }
            },
            {
              "key_code": "right_command"
            }
          ],
          "to_delayed_action": {
            "to_if_invoked": [
              {
                "set_variable": {
                  "name": "right_command pressed",
                  "value": 0
                }
              }
            ],
            "to_if_canceled": [
              {
                "set_variable": {
                  "name": "right_command pressed",
                  "value": 0
                }
              }
            ]
          }
        },
        {
          "type": "basic",
          "conditions": [
            {
              "type": "device_if",
              "identifiers": [
                {
                  "vendor_id": 1241
                },
                {
                  "vendor_id": 2131
                },
                {
                  "vendor_id": 9494
                },
                {
                  "vendor_id": 11720
                }
              ]
            }
          ],
          "from": {
            "key_code": "right_option",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_command"
            }
          ]
        }
      ]
    }
  ]
}

User avatar
Muirium
µ

08 Jan 2024, 01:15

After a fair old session of finagling, my (new to me) 'lil Poker is now behaving much more HHKB-like. Thankfully!

Code: Select all

{
  "title": "♦️ Poker Rules",
  "description": "Work in progress",
  "rules": [
    {
      "description": "♦️ Poker: Let's Fn' Fix This Thing!",
      "manipulators": [
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "left_control",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_control"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "right_control",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_control"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "application",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_option"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "caps_lock",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_control"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "grave_accent_and_tilde",
            "modifiers": {
              "optional": [
                "shift",
                "right_command",
                "option",
                "right_control"
              ]
            }
          },
          "to": [
            {
              "key_code": "escape"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "grave_accent_and_tilde",
            "modifiers": {
              "mandatory": [
                "left_control"
              ],
              "optional": [
              	"any"
              ]
            }
          },
          "to": [
            {
              "key_code": "grave_accent_and_tilde"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "grave_accent_and_tilde",
            "modifiers": {
              "optional": [
              	"left_command"
              ]
            }
          },
          "to": [
            {
              "key_code": "grave_accent_and_tilde"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "grave_accent_and_tilde",
            "modifiers": {
              "optional": [
              	"left_command",
              	"left_option"
              ]
            }
          },
          "to": [
            {
              "key_code": "escape"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "backslash",
            "modifiers": {
             "optional": [
                "shift",
                "option",
                "command"
              ]
            }
          },
          "to": [
            {
              "key_code": "delete_or_backspace"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "delete_or_backspace",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "backslash"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "open_bracket",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "up_arrow"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "semicolon",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "left_arrow"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "quote",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "right_arrow"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "slash",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "down_arrow"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "l",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "page_up"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "period",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "page_down"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "k",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "home"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "comma",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "end"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "close_bracket",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "mouse_key": {
              	"vertical_wheel": -32
              }
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "backslash",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "mouse_key": {
              	"vertical_wheel": 32
              }
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "a",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "consumer_key_code": "mute"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "s",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "consumer_key_code": "volume_decrement"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "d",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "consumer_key_code": "volume_increment"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "1",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "f1"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "2",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "f2"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "3",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "f3"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "4",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "f4"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "5",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "f5"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "6",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "f6"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "7",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "f7"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "8",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "f8"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "9",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "f9"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "0",
            "modifiers": {
            	"mandatory": [
            		"left_control"
            	],
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "key_code": "f10"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "v",
            "modifiers": {
              "mandatory": [
                "left_control"
              ]
            }
          },
          "to": [
            {
              "mouse_key": {
                "x": -2000,
                "y": 2000
              }
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "b",
            "modifiers": {
              "mandatory": [
                "left_control"
              ]
            }
          },
          "to": [
            {
              "mouse_key": {
                "y": 2828
              }
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "n",
            "modifiers": {
              "mandatory": [
                "left_control"
              ]
            }
          },
          "to": [
            {
              "mouse_key": {
                "x": 2000,
                "y": 2000
              }
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "f",
            "modifiers": {
              "mandatory": [
                "left_control"
              ]
            }
          },
          "to": [
            {
              "mouse_key": {
                "x": -2828
              }
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "g",
            "modifiers": {
              "mandatory": [
                "left_control"
              ]
            }
          },
          "to": [
            {
              "pointing_button": "button1"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "h",
            "modifiers": {
              "mandatory": [
                "left_control"
              ]
            }
          },
          "to": [
            {
              "mouse_key": {
                "x": 2828
              }
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "r",
            "modifiers": {
              "mandatory": [
                "left_control"
              ]
            }
          },
          "to": [
            {
              "mouse_key": {
                "x": -2000,
                "y": -2000
              }
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "t",
            "modifiers": {
              "mandatory": [
                "left_control"
              ]
            }
          },
          "to": [
            {
              "mouse_key": {
                "y": -2828
              }
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "y",
            "modifiers": {
              "mandatory": [
                "left_control"
              ]
            }
          },
          "to": [
            {
              "mouse_key": {
                "x": 2000,
                "y": -2000
              }
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "x",
            "modifiers": {
              "mandatory": [
                "left_control"
              ]
            }
          },
          "to": [
            {
              "pointing_button": "button2"
            }
          ]
        },
        {
          "type": "basic",
          "conditions": [
            {
            	"type": "device_if",
            	"identifiers": [
            		{
            			"product_id": 12563
            		}
            	]
            }
          ],
          "from": {
            "key_code": "z",
            "modifiers": {
              "mandatory": [
                "left_control"
              ]
            }
          },
          "to": [
            {
              "pointing_button": "button1"
            }
          ]
        }
      ]
    }
  ]
}
What I've done is left it with DIP switches 2 and 3 active, as I liked them on the iPhone, and rejiggered the mods around for real use on my Mac.
  • The bottom right corner control key is now pressed into service as my all important Fn-key, just like on my Kishsaver, near-enough where it ought to be on an HHKB proper
  • Naturally Caps Lock is banished for a real Control key left of A. That one serves for my many text-manipulation macros, among other things
  • The bottom left Control key is given something much more useful to do than merely shadow Caps Lock: it's a second Fn key to activate my layer left-handed. A new idea I might try out on the Kishsaver too
  • I have moved the big red A and B caps to the appropriate Fn keys now
  • Too many \s showing up when I’m reaching for Backspace. Fixed that, with said \ and | now relegated to Fn
  • Some real hacky Escape / Backtick logic to match my muscle memory for several overlaid functions on that one key. Defaults to Escape, obvs, with Fn Esc to make `, but my fingers expect many things with various combos there, which they have now
  • Fun fact: the Poker has the same USB vendor ID as my Filco: 1241. That's why I’m using Product ID to filter it out for the Fn layer
  • Naturally, all my unholy mountain of existing Karabiner stuff still works with this keyboard, with a little fiddling here and there now completed
  • The one key I couldn't remap is the Poker's own Fn: just right of Spacebar. Annoying, but there you go. There's plenty enough keys to go round not to miss that one, but I’m not learning that Fn layer when I can have my own!
Right, that's enough jiggery-Pokery for one day. G'night!

Post Reply

Return to “Workshop”