You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function must always return a valid macro, and default implementation of `action_get_macro` always returns `MACRO_NONE` which has no effect.
397
+
398
+
#### 2.3.1.1 Limitations
399
+
Similar to the Function Action system, the selector functions is passed a `keyrecord_t` object, so it can inspect the key state (e.g. different macros on key press or release), and key itself.
400
+
401
+
Unlike the Function Action system,`macros` are pre-recorded key sequences, so you can only select from a list. If you want to use dynamic macros then you should look at the more complex function action system.
385
402
386
-
`Macro` action indicates complex key strokes.
387
-
388
-
MACRO( D(LSHIFT), D(D), END )
389
-
MACRO( U(D), U(LSHIFT), END )
390
-
MACRO( I(255), T(H), T(E), T(L), T(L), W(255), T(O), END )
403
+
#### 2.3.2 Implementing/Defining Macro sequences
404
+
Macros are of the form (must be wrapped by the `MACRO` function, and end with an `END` mark)
391
405
392
-
#### 2.3.1 Macro Commands
393
-
- **MACRO()**
394
-
- **MACRO_NONE**
406
+
MACRO( ..., END )
407
+
408
+
Within each macro, the following commands can be used:
395
409
396
410
- **I()** change interval of stroke.
397
411
- **D()** press key
@@ -401,27 +415,38 @@ Default Layer also has bitwise operations, they are executed when key is release
401
415
- **SM()** store modifier state
402
416
- **RM()** restore modifier state
403
417
- **CM()** clear modifier state
404
-
- **END** end mark
418
+
419
+
e.g.:
420
+
421
+
MACRO( D(LSHIFT), D(D), END ) // hold down LSHIFT and D - will print 'D'
422
+
MACRO( U(D), U(LSHIFT), END ) // release U and LSHIFT keys (an event.pressed == False counterpart for the one above)
423
+
MACRO( I(255), T(H), T(E), T(L), T(L), W(255), T(O), END ) // slowly print out h-e-l-l---o
0 commit comments