qmk / qmk_firmware

Open-source keyboard firmware for Atmel AVR and Arm USB families
https://qmk.fm
GNU General Public License v2.0
18.09k stars 38.89k forks source link

Produce another key when combined with shift #61

Closed boris-arkenaar closed 8 years ago

boris-arkenaar commented 8 years ago

I am looking for a way to produce a different key stroke when pressed in combination with the shift key.

For example: I would like the comma and dot key to behave normally when pressed alone. But when pressed with the shift key held down I would like the keyboard to produce a SHIFT+9 and SHIFT+0 instead (i.e.: the comma and dot keys produce parentheses when shifted, instead of the less than and greater than symbols).

ezuk commented 8 years ago

Well there's a somewhat crazy way to do this: You could make an entire layer that's a "shift" layer (i.e, sends capital letters and $ and whatnot), and just map those two keys to send ( and ). Then you could remap the Shift key on the keyboard to temporarily toggle that layer on.

In use, this would do exactly what you need -- press and hold "Shift" (which is really a momentary toggle layer switch), then press , and you get (.

@jackhumbert - is there a simpler way to do this?

boris-arkenaar commented 8 years ago

Thanks. If I'm right that would mean though that you would have to define the shifted state for all keys, not just the dot and comma keys, right?

jackhumbert commented 8 years ago

That's the easiest way I know how! Defining the shift layers is a bit easier with S().

plgruener commented 8 years ago

I've got the same issue (a hardcoded non-qwerty layout), and a question arises: will there be any disadvantages not having a "normal" Shift-key? Eg. shortcuts not working etc? (not having my ergodox-ez yet, so cannot test).

jackhumbert commented 8 years ago

The only odd behaviour I can think of is when you're holding a shifted key, the next key you press will also be shifted, which might cause some confusion when typing symbols quickly.

eltang commented 8 years ago

It turns out that someone other than me does notice that! Do you think that it is possible to fix this by redefining S(key) to apply Oneshot Shift rather than regular shift?

ezuk commented 8 years ago

@jackhumbert back atcha :)

jackhumbert commented 8 years ago

That issue is a dup of #50 :)

eltang commented 8 years ago

I was referencing your comment:

The only odd behaviour I can think of is when you're holding a shifted key, the next key you press will also be shifted, which might cause some confusion when typing symbols quickly.

.

jackhumbert commented 8 years ago

Ah, gotcha - that's really a separate issue. I'll make a new issue.