Browse Source

core: Add macro commands SM(), RM() and CM()

tags/v2.9
tmk 8 years ago
parent
commit
8ccbbde881
1 changed files with 22 additions and 2 deletions
  1. 22
    2
      tmk_core/doc/keymap.md

+ 22
- 2
tmk_core/doc/keymap.md View File

@@ -368,17 +368,37 @@ Default Layer also has bitwise operations, they are executed when key is release
MACRO( I(255), T(H), T(E), T(L), T(L), W(255), T(O), END )

#### 2.3.1 Macro Commands
- **MACRO()**
- **MACRO_NONE**

- **I()** change interval of stroke.
- **D()** press key
- **U()** release key
- **T()** type key(press and release)
- **W()** wait
- **SM()** store modifier state
- **RM()** restore modifier state
- **CM()** clear modifier state
- **END** end mark

#### 2.3.2 Examples
***TBD***

const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
switch (id) {
case HELLO:
return (record->event.pressed ?
MACRO( I(0), T(H), T(E), T(L), T(L), W(255), T(O), END ) :
MACRO_NONE );
case ALT_TAB:
return (record->event.pressed ?
MACRO( D(LALT), D(TAB), END ) :
MACRO( U(TAB), END ));
}
return MACRO_NONE;
}

***TODO: sample implementation***
See `keyboard/hhkb/keymap.c` for sample.




Loading…
Cancel
Save