]> git.donarmstrong.com Git - qmk_firmware.git/commit
Allow one-shot modifiers to be chained
authorGergely Nagy <qmk@gergo.csillger.hu>
Tue, 24 Apr 2018 14:41:38 +0000 (16:41 +0200)
committerJack Humbert <jack.humb@gmail.com>
Mon, 14 May 2018 14:09:28 +0000 (10:09 -0400)
commit38f204db3031475aef2252e1ad11e4c87fb559f1
tree037feaeac9bae770ef268b348007aa5efcb63fc8
parente76eee2d0a9d002fb264de538c816a6c5de4b8b9
Allow one-shot modifiers to be chained

Many a times one would want to use multiple modifiers with the same key,
preferably without having to hold anything, like `Ctrl+Shift+C` or
`Ctrl+Shift+V` to copy/paste in GNOME Terminal. To make this possible, we need
to be able to chain one-shot modifiers, so that we can have multiple of them
active at the same time.

The easiest way to accomplish this is that whenever we activate a one-shot
modifier, we apply it on top of the existing set, instead of re-setting the
state. When deactivating, either due to an interrupt, or due to a timeout, we
deactivate all oneshots anyway, so the clearing part is covered. When we turn
the one-shot modifier into a toggle, that will also clear all one-shot modifiers
first, so we covered that case too.

Fixes #2796, #1580, and #856.

Signed-off-by: Gergely Nagy <qmk@gergo.csillger.hu>
tmk_core/common/action.c