diff options
| author | Thiago Alves <talk@thiagoalves.com.br> | 2016-05-05 18:41:37 -0700 |
|---|---|---|
| committer | Jack Humbert <jack.humb@gmail.com> | 2016-05-05 21:41:37 -0400 |
| commit | 74e97eefd7ae76f9ddcb76890a30aa9038804cdb (patch) | |
| tree | 9bdf7ce6ffb97a024c8230e5e960d53503262ced /tmk_core/common/action_code.h | |
| parent | d4520cd3ac7550fc7243e9a76824d9ba674875c6 (diff) | |
| download | qmk_firmware-74e97eefd7ae76f9ddcb76890a30aa9038804cdb.tar.gz qmk_firmware-74e97eefd7ae76f9ddcb76890a30aa9038804cdb.zip | |
Adds oneshot layer and oneshot tap toggling (#308)
This commit is mostly a cherry-pick from `ahtn` at
https://github.com/tmk/tmk_keyboard/pull/255.
These are the changes:
* Adds ACTION_LAYER_ONESHOT
* Adds ONESHOT_TAP_TOGGLE
* Mentions sticky keys in the docs on oneshot.
Diffstat (limited to 'tmk_core/common/action_code.h')
| -rw-r--r-- | tmk_core/common/action_code.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tmk_core/common/action_code.h b/tmk_core/common/action_code.h index 2b0b0b077..ca729aaec 100644 --- a/tmk_core/common/action_code.h +++ b/tmk_core/common/action_code.h | |||
| @@ -76,7 +76,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 76 | * 101E|LLLL|1111 0001 On/Off (0xF1) [NOT TAP] | 76 | * 101E|LLLL|1111 0001 On/Off (0xF1) [NOT TAP] |
| 77 | * 101E|LLLL|1111 0010 Off/On (0xF2) [NOT TAP] | 77 | * 101E|LLLL|1111 0010 Off/On (0xF2) [NOT TAP] |
| 78 | * 101E|LLLL|1111 0011 Set/Clear (0xF3) [NOT TAP] | 78 | * 101E|LLLL|1111 0011 Set/Clear (0xF3) [NOT TAP] |
| 79 | * 101E|LLLL|1111 xxxx Reserved (0xF4-FF) | 79 | * 101E|LLLL|1111 0100 One Shot Layer (0xF4) [TAP] |
| 80 | * 101E|LLLL|1111 xxxx Reserved (0xF5-FF) | ||
| 80 | * ELLLL: layer 0-31(E: extra bit for layer 16-31) | 81 | * ELLLL: layer 0-31(E: extra bit for layer 16-31) |
| 81 | * | 82 | * |
| 82 | * | 83 | * |
| @@ -250,6 +251,7 @@ enum layer_pram_tap_op { | |||
| 250 | OP_ON_OFF, | 251 | OP_ON_OFF, |
| 251 | OP_OFF_ON, | 252 | OP_OFF_ON, |
| 252 | OP_SET_CLEAR, | 253 | OP_SET_CLEAR, |
| 254 | OP_ONESHOT, | ||
| 253 | }; | 255 | }; |
| 254 | #define ACTION_LAYER_BITOP(op, part, bits, on) (ACT_LAYER<<12 | (op)<<10 | (on)<<8 | (part)<<5 | ((bits)&0x1f)) | 256 | #define ACTION_LAYER_BITOP(op, part, bits, on) (ACT_LAYER<<12 | (op)<<10 | (on)<<8 | (part)<<5 | ((bits)&0x1f)) |
| 255 | #define ACTION_LAYER_TAP(layer, key) (ACT_LAYER_TAP<<12 | (layer)<<8 | (key)) | 257 | #define ACTION_LAYER_TAP(layer, key) (ACT_LAYER_TAP<<12 | (layer)<<8 | (key)) |
| @@ -266,6 +268,7 @@ enum layer_pram_tap_op { | |||
| 266 | #define ACTION_LAYER_ON_OFF(layer) ACTION_LAYER_TAP((layer), OP_ON_OFF) | 268 | #define ACTION_LAYER_ON_OFF(layer) ACTION_LAYER_TAP((layer), OP_ON_OFF) |
| 267 | #define ACTION_LAYER_OFF_ON(layer) ACTION_LAYER_TAP((layer), OP_OFF_ON) | 269 | #define ACTION_LAYER_OFF_ON(layer) ACTION_LAYER_TAP((layer), OP_OFF_ON) |
| 268 | #define ACTION_LAYER_SET_CLEAR(layer) ACTION_LAYER_TAP((layer), OP_SET_CLEAR) | 270 | #define ACTION_LAYER_SET_CLEAR(layer) ACTION_LAYER_TAP((layer), OP_SET_CLEAR) |
| 271 | #define ACTION_LAYER_ONESHOT(layer) ACTION_LAYER_TAP((layer), OP_ONESHOT) | ||
| 269 | #define ACTION_LAYER_MODS(layer, mods) ACTION_LAYER_TAP((layer), 0xe0 | ((mods)&0x0f)) | 272 | #define ACTION_LAYER_MODS(layer, mods) ACTION_LAYER_TAP((layer), 0xe0 | ((mods)&0x0f)) |
| 270 | /* With Tapping */ | 273 | /* With Tapping */ |
| 271 | #define ACTION_LAYER_TAP_KEY(layer, key) ACTION_LAYER_TAP((layer), (key)) | 274 | #define ACTION_LAYER_TAP_KEY(layer, key) ACTION_LAYER_TAP((layer), (key)) |
