Author Topic: Spaceshift on Mac?  (Read 3562 times)

0 Members and 1 Guest are viewing this topic.

Offline pyro

  • Thread Starter
  • Posts: 177
Spaceshift on Mac?
« on: Tue, 16 March 2021, 16:09:12 »
Is it possible to achieve Spaceshift on a Mac? On Windows I use remapkey.exe (from Windows Resource Kit Tools) and Autohotkey (AHK), on Linux xkb/xmodmap, xcape, xbindkeys get you there, but what about Mac? Anybody done this before?

For clarification, by Spaceshift I mean that the spacebar behaves like Shift when pressed and held, but produces a Space character on release if no other button was pressed in between press and release.

Offline nevin

  • Posts: 1459
  • Location: US
Re: Spaceshift on Mac?
« Reply #1 on: Tue, 16 March 2021, 16:42:44 »
some mac remapping apps:
- KeyRemap4MacBook
- Karabiner
- ControllerMate

whether they do that specific action... i don't know for sure, never looked into that particular action.
Keeb.io Viterbi, Apple m0110, Apple m0120, Apple m0110a, Apple 658-4081, Apple M1242, Apple AEK II, MK96, GH60/Pure, Cherry g84-4100, Adesso AKP-220B, Magicforce 68

Offline Gorbon

  • Posts: 39
  • Location: Greece
Re: Spaceshift on Mac?
« Reply #2 on: Tue, 16 March 2021, 17:53:04 »
Karabiner-Elements can easily do this and much much more. I've been using it extensively for quite some time now.

I wrote you a small config for that. Put it in a .json file under "~/.config/karabiner/assets/complex_modifications/" and then you can enable it in "preferences > complex modifications".

You can adjust the timing parameters to your preferences.

Code: [Select]
{
  "description": "Spaceshift",
  "manipulators": [
    {
      "type": "basic",
      "from": {
        "key_code": "spacebar",
        "modifiers": {
          "optional": [
            "any"
          ]
        }
      },
      "to_if_alone": [
        {
          "key_code": "spacebar"
        }
      ],
      "to_if_held_down": [
        {
          "key_code": "left_shift"
        }
      ],
      "parameters": {
        "basic.to_if_alone_timeout_milliseconds": 200,
        "basic.to_if_held_down_threshold_milliseconds": 200
      }
    }
  ]
}

If you're interested, you'll find lots more in karabiner's documentation.
« Last Edit: Wed, 17 March 2021, 05:51:55 by Gorbon »

Offline pyro

  • Thread Starter
  • Posts: 177
Re: Spaceshift on Mac?
« Reply #3 on: Tue, 16 March 2021, 19:03:23 »
That's great, thank you!