Compare commits

...

2 Commits

Author SHA1 Message Date
Joel Challis
f76f9c7d2a Add mouse support to SEND_STRING (#8223)
* Add mouse support to SEND_STRING

* add short forms
2020-02-23 14:03:01 -08:00
Jez Cope
530c997638 Add link to "Useful functions" in macro docs (#7446)
* Add link to "Useful functions" in macro docs

Help people find additional features they can activate within a macro

* Update docs/feature_macros.md

Co-Authored-By: Drashna Jaelre <drashna@live.com>

Co-authored-by: skullydazed <skullydazed@users.noreply.github.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
2020-02-23 12:50:11 -08:00
2 changed files with 38 additions and 0 deletions

View File

@@ -154,6 +154,8 @@ SEND_STRING(".."SS_TAP(X_END));
There are some functions you may find useful in macro-writing. Keep in mind that while you can write some fairly advanced code within a macro, if your functionality gets too complex you may want to define a custom keycode instead. Macros are meant to be simple.
?> You can also use the functions described in [Useful function](ref_functions.md) for additional functionality. For example `reset_keyboard()` allows you to reset the keyboard as part of a macro.
### `record->event.pressed`
This is a boolean value that can be tested to see if the switch is being pressed or released. An example of this is

View File

@@ -137,6 +137,24 @@
#define X_BRMU X_PAUSE
#define X_BRMD X_SCROLLLOCK
/* Mouse Keys */
#define X_MS_U X_MS_UP
#define X_MS_D X_MS_DOWN
#define X_MS_L X_MS_LEFT
#define X_MS_R X_MS_RIGHT
#define X_BTN1 X_MS_BTN1
#define X_BTN2 X_MS_BTN2
#define X_BTN3 X_MS_BTN3
#define X_BTN4 X_MS_BTN4
#define X_BTN5 X_MS_BTN5
#define X_WH_U X_MS_WH_UP
#define X_WH_D X_MS_WH_DOWN
#define X_WH_L X_MS_WH_LEFT
#define X_WH_R X_MS_WH_RIGHT
#define X_ACL0 X_MS_ACCEL0
#define X_ACL1 X_MS_ACCEL1
#define X_ACL2 X_MS_ACCEL2
/* Keyboard/Keypad Page (0x07) */
#define X_A 04
#define X_B 05
@@ -341,6 +359,24 @@
#define X_BRIGHTNESS_UP bd
#define X_BRIGHTNESS_DOWN be
/* Mouse Buttons (unallocated range in HID spec) */
#define X_MS_UP f0
#define X_MS_DOWN f1
#define X_MS_LEFT f2
#define X_MS_RIGHT f3
#define X_MS_BTN1 f4
#define X_MS_BTN2 f5
#define X_MS_BTN3 f6
#define X_MS_BTN4 f7
#define X_MS_BTN5 f8
#define X_MS_WH_UP f9
#define X_MS_WH_DOWN fa
#define X_MS_WH_LEFT fb
#define X_MS_WH_RIGHT fc
#define X_MS_ACCEL0 fd
#define X_MS_ACCEL1 fe
#define X_MS_ACCEL2 ff
// Send string macros
#define STRINGIZE(z) #z
#define ADD_SLASH_X(y) STRINGIZE(\x##y)