Has anyone gotten ShapeShifter + TopsyTurvy to play nice together?

My goal is to have a key that types “!” when pressed unshifted, and “#” when pressed shifted. (I also want a few other key pairings like this.) I was hoping that using TopsyTurvy and ShapeShifter together could make this happen, but it didn’t seem to work – I can make a key that types “!” when pressed, but it types “1” when shift-pressed. (Well, a whole bunch of "1"s, actually, but that’s a separate issue).

Does anyone have an idea for how I can make a key that types “!” when pressed and “#” when shift-pressed?

Bonus points if the technique allows me to make the actual 1 key execute a macro when shift-pressed, though I’m willing to compromise on that front.

I haven’t written it yet, but I will probably get a plugin finished that will do exactly what you want (including the macro) sometime next month.

3 Likes

The ModifierLayers plugin I have was designed to do exactly this: https://github.com/nikitakit/Kaleidoscope-ModifierLayers

2 Likes

I don’t use any of those plugins. Instead, what I did was:

  1. Duplicate all your layers (where you’d like to be able to use Shift as a modifier). Add _SHIFT (or something) at the end of the layer names.
  2. Add LSHIFT() around all keys in the *_SHIFT layers.
  3. Replace some keys in the *_SHIFT layers, to make them type what you want.
  4. Replace Key_LeftShift and Key_RightShift with ShiftToLayer(FOO_SHIFT) everywhere, so that the “shift” keys shifts to the appropriate *_SHIFT layer instead of sending an actual Shift keypress to the OS.
  5. Add a Key_LeftShift somewhere, which can be used for shift-clicking.

Here are my layers:

See also:

The trouble with that approach is that you can’t use shift in combination with a pointing device.

What does shift + mouse do for you? Afaik, on gnu/linux, in firefox, shift+left click highlights to where the cursor was last, which I rarely use and would happily press a different key than normal to do. It appears to do nothing for right and middle click. I have no idea of any other functionality. This seems like a trivial inconvenience.

@iank In addition to shift+mouse (which is used for graphics applications like Inkscape, as well as games), the other issue with that approach is that now shift won’t work properly with other layers, e.g. a “function layer” activated by pressing the fn key. You can work around this, but it becomes harder if the function layer is partially transparent (e.g. if it’s only supposed to affect the left half of the keyboard, but not the right half).

My personal usecase involves using many additional layers, which is why I decided to make a plugin. Of course your needs may be different.

Edit: shift-click is also used for multi-item selections in a gui file manager or similar apps.

2 Likes

Yes, my solution is a hack which brings its own problems (with workarounds). But it’s an approach to consider.