Skip to content

Instantly share code, notes, and snippets.

@remy
Created March 28, 2020 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save remy/2296e7df61f5c76f71a1d3ed218e0c1d to your computer and use it in GitHub Desktop.
Save remy/2296e7df61f5c76f71a1d3ed218e0c1d to your computer and use it in GitHub Desktop.
A Karabiner-Elements key config to let me use the esc key with cspect.

In breif, this config lets me use the escape key to bring up the ZX Spectrum Next menu when running under CSpect on the mac.

The escape key will send: F10, shift+1, F10.

Using any modifier key and escape will exit CSpect (sending a real esc key to CSpect).

This config is used with Karabiner-Elements

{
"title": "CSpect",
"rules": [
{
"description": "Send shift+1 on esc",
"manipulators": [
{
"conditions": [
{
"file_paths": ["^/usr/local/bin/mono$"],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "escape"
},
"to": [
{
"key_code": "f10",
"modifiers": ["fn"],
"hold_down_milliseconds": 100
},
{
"key_code": "1",
"modifiers": ["left_shift"],
"hold_down_milliseconds": 100
},
{
"key_code": "f10",
"modifiers": ["fn"],
"hold_down_milliseconds": 100
}
],
"type": "basic"
}
]
},
{
"description": "Send esc when modified",
"manipulators": [
{
"conditions": [
{
"file_paths": ["^/usr/local/bin/mono$"],
"type": "frontmost_application_if"
}
],
"from": {
"key_code": "escape",
"modifiers": { "optional": "any" }
},
"to": [
{
"key_code": "escape"
}
],
"type": "basic"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment