]> git.donarmstrong.com Git - qmk_firmware.git/commit
Add `DYN_REC_STOP` to dynamic macros
authorWeiyi Lou <cinaeco@gmail.com>
Sat, 29 Apr 2017 12:02:01 +0000 (22:02 +1000)
committerWeiyi Lou <cinaeco@gmail.com>
Sun, 30 Apr 2017 09:21:44 +0000 (19:21 +1000)
commit4ff40a551a310e9b29a5838f87a9db58c0e5767e
tree25e11e3847b8c2df884fbaba68fdcd7ce1ea48b0
parent26bbfd78125224abdbd2e4ccf3aa3df1b5fc4968
Add `DYN_REC_STOP` to dynamic macros

Dynamic macro functionality is modified to check for `DYN_REC_STOP`, so
that macro recording can be stopped with a designated key combination
(e.g. `qs` or anything) instead of mandating the use of a `_DYN` layer.

`_DYN` layer stopping can still be done by passing `DYN_REC_STOP` within
`process_record_user()`:

    bool process_record_user(uint16_t keycode, keyrecord_t *record) {
      uint16_t macro_kc = (keycode == MO(_DYN) ? DYN_REC_STOP : keycode);
      if (!process_record_dynamic_macro(macro_kc, record)) {
        return false;
      }
      return true;
    }
quantum/dynamic_macro.h