From 370577e4ed1a714e818bf11cc870e4915f82e93b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Sun, 12 Apr 2020 20:37:55 +0200 Subject: [PATCH] Add *OPT aliases for *ALT keycodes and macros (#8714) --- docs/feature_advanced_keycodes.md | 6 +++--- docs/feature_macros.md | 4 ++-- docs/ja/feature_advanced_keycodes.md | 4 ++-- docs/keycodes.md | 12 ++++++------ docs/keycodes_basic.md | 4 ++-- docs/mod_tap.md | 4 ++-- quantum/quantum_keycodes.h | 9 +++++++-- quantum/send_string_keycodes.h | 2 ++ tmk_core/common/keycode.h | 2 ++ 9 files changed, 28 insertions(+), 19 deletions(-) diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index b2abe5dae0..b8664074a7 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -6,11 +6,11 @@ These allow you to combine a modifier with a keycode. When pressed, the keydown |----------|-------------------------------|----------------------------------------------------| |`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` | |`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` | -|`LALT(kc)`|`A(kc)` |Hold Left Alt and press `kc` | +|`LALT(kc)`|`A(kc)`, `LOPT(kc)` |Hold Left Alt and press `kc` | |`LGUI(kc)`|`G(kc)`, `LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` | |`RCTL(kc)`| |Hold Right Control and press `kc` | |`RSFT(kc)`| |Hold Right Shift and press `kc` | -|`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` | +|`RALT(kc)`|`ROPT(kc)`, `ALGR(kc)` |Hold Right Alt and press `kc` | |`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` | |`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)` |Hold Left Shift and GUI and press `kc` | |`LCA(kc)` | |Hold Left Control and Alt and press `kc` | @@ -18,7 +18,7 @@ These allow you to combine a modifier with a keycode. When pressed, the keydown |`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | |`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| -You can also chain them, for example `LCTL(LALT(KC_DEL))` makes a key that sends Control+Alt+Delete with a single keypress. +You can also chain them, for example `LCTL(LALT(KC_DEL))` or `C(A(KC_DEL))` makes a key that sends Control+Alt+Delete with a single keypress. # Legacy Content :id=legacy-content diff --git a/docs/feature_macros.md b/docs/feature_macros.md index 1bd2d74e7d..1c7705a516 100644 --- a/docs/feature_macros.md +++ b/docs/feature_macros.md @@ -161,11 +161,11 @@ There's also a couple of mod shortcuts you can use: * `SS_LCTL(string)` * `SS_LSFT(string)` -* `SS_LALT(string)` +* `SS_LALT(string)` or `SS_LOPT(string)` * `SS_LGUI(string)`, `SS_LCMD(string)` or `SS_LWIN(string)` * `SS_RCTL(string)` * `SS_RSFT(string)` -* `SS_RALT(string)` or `SS_ALGR(string)` +* `SS_RALT(string)`, `SS_ROPT(string)` or `SS_ALGR(string)` * `SS_RGUI(string)`, `SS_RCMD(string)` or `SS_RWIN(string)` These press the respective modifier, send the supplied string and then release the modifier. diff --git a/docs/ja/feature_advanced_keycodes.md b/docs/ja/feature_advanced_keycodes.md index d208d7f926..c6e21feb94 100644 --- a/docs/ja/feature_advanced_keycodes.md +++ b/docs/ja/feature_advanced_keycodes.md @@ -54,11 +54,11 @@ QMK を使い始めたばかりの場合は、全てを単純にしたいでし |----------|-------------------------------|----------------------------------------------------| | `LCTL(kc)` | `C(kc)` | 左 Control を押しながら `kc` を押します。 | | `LSFT(kc)` | `S(kc)` | 左 Shift を押しながら `kc` を押します。 | -| `LALT(kc)` | `A(kc)` | 左 Alt を押しながら `kc`を押します。 | +| `LALT(kc)` | `A(kc)`, `LOPT(kc)` | 左 Alt を押しながら `kc`を押します。 | | `LGUI(kc)` | `G(kc)`, `LCMD(kc)`, `LWIN(kc)` | 左 GUI を押しながら `kc` を押します。 | | `RCTL(kc)` | | 右 Control を押しながら `kc` を押します。 | | `RSFT(kc)` | | 右 Shift を押しながら `kc` を押します。 | -| `RALT(kc)` | `ALGR(kc)` | 右 Alt を押しながら `kc` を押します。 | +| `RALT(kc)` | `ROPT(kc)`, `ALGR(kc)` | 右 Alt を押しながら `kc` を押します。 | | `RGUI(kc)` | `RCMD(kc)`, `LWIN(kc)` | 右 GUI を押しながら `kc` を押します。 | | `SGUI(kc)` | `SCMD(kc)`, `SWIN(kc)` | 左 Shift と左 GUI を押しながら `kc` を押します。 | | `LCA(kc)` | | 左 Control と左 Alt を押しながら `kc` を押します。 | diff --git a/docs/keycodes.md b/docs/keycodes.md index 1a388f106b..18fd811184 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -175,11 +175,11 @@ See also: [Basic Keycodes](keycodes_basic.md) |`KC_EXSEL` | |ExSel | |`KC_LCTRL` |`KC_LCTL` |Left Control | |`KC_LSHIFT` |`KC_LSFT` |Left Shift | -|`KC_LALT` | |Left Alt | +|`KC_LALT` |`KC_LOPT` |Left Alt (Option) | |`KC_LGUI` |`KC_LCMD`, `KC_LWIN` |Left GUI (Windows/Command/Meta key) | |`KC_RCTRL` |`KC_RCTL` |Right Control | |`KC_RSHIFT` |`KC_RSFT` |Right Shift | -|`KC_RALT` |`KC_ALGR` |Right Alt (AltGr) | +|`KC_RALT` |`KC_ROPT`, `KC_ALGR` |Right Alt (Option/AltGr) | |`KC_RGUI` |`KC_RCMD`, `KC_RWIN` |Right GUI (Windows/Command/Meta key) | |`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down | |`KC_SYSTEM_SLEEP` |`KC_SLEP` |System Sleep | @@ -378,11 +378,11 @@ See also: [Modifier Keys](feature_advanced_keycodes.md#modifier-keys) |----------|-------------------------------|----------------------------------------------------| |`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` | |`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` | -|`LALT(kc)`|`A(kc)` |Hold Left Alt and press `kc` | +|`LALT(kc)`|`A(kc)`, `LOPT(kc)` |Hold Left Alt and press `kc` | |`LGUI(kc)`|`G(kc)`, `LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` | |`RCTL(kc)`| |Hold Right Control and press `kc` | |`RSFT(kc)`| |Hold Right Shift and press `kc` | -|`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` | +|`RALT(kc)`|`ROPT(kc)`, `ALGR(kc)` |Hold Right Alt and press `kc` | |`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` | |`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)` |Hold Left Shift and GUI and press `kc` | |`LCA(kc)` | |Hold Left Control and Alt and press `kc` | @@ -401,11 +401,11 @@ See also: [Mod-Tap](mod_tap.md) |`MT(mod, kc)`| |`mod` when held, `kc` when tapped | |`LCTL_T(kc)` |`CTL_T(kc)` |Left Control when held, `kc` when tapped | |`LSFT_T(kc)` |`SFT_T(kc)` |Left Shift when held, `kc` when tapped | -|`LALT_T(kc)` |`ALT_T(kc)` |Left Alt when held, `kc` when tapped | +|`LALT_T(kc)` |`LOPT_T(kc)`, `ALT_T(kc)`, `OPT_T(kc)` |Left Alt when held, `kc` when tapped | |`LGUI_T(kc)` |`LCMD_T(kc)`, `LWIN_T(kc)`, `GUI_T(kc)`, `CMD_T(kc)`, `WIN_T(kc)`|Left GUI when held, `kc` when tapped | |`RCTL_T(kc)` | |Right Control when held, `kc` when tapped | |`RSFT_T(kc)` | |Right Shift when held, `kc` when tapped | -|`RALT_T(kc)` |`ALGR_T(kc)` |Right Alt when held, `kc` when tapped | +|`RALT_T(kc)` |`ROPT_T(kc)`, `ALGR_T(kc)` |Right Alt when held, `kc` when tapped | |`RGUI_T(kc)` |`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped | |`SGUI_T(kc)` |`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | |`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | diff --git a/docs/keycodes_basic.md b/docs/keycodes_basic.md index 75d58c1f1b..09efc8c9c3 100644 --- a/docs/keycodes_basic.md +++ b/docs/keycodes_basic.md @@ -112,11 +112,11 @@ The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07 |-----------|--------------------|------------------------------------| |`KC_LCTRL` |`KC_LCTL` |Left Control | |`KC_LSHIFT`|`KC_LSFT` |Left Shift | -|`KC_LALT` | |Left Alt | +|`KC_LALT` |`KC_LOPT` |Left Alt (Option) | |`KC_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) | |`KC_RCTRL` |`KC_RCTL` |Right Control | |`KC_RSHIFT`|`KC_RSFT` |Right Shift | -|`KC_RALT` |`KC_ALGR` |Right Alt (AltGr) | +|`KC_RALT` |`KC_ROPT`, `KC_ALGR`|Right Alt (Option/AltGr) | |`KC_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key)| ## International diff --git a/docs/mod_tap.md b/docs/mod_tap.md index 2b86701ca4..ced0beba99 100644 --- a/docs/mod_tap.md +++ b/docs/mod_tap.md @@ -31,11 +31,11 @@ For convenience, QMK includes some Mod-Tap shortcuts to make common combinations |------------|-----------------------------------------------------------------|-------------------------------------------------------| |`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped | |`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped | -|`LALT_T(kc)`|`ALT_T(kc)` |Left Alt when held, `kc` when tapped | +|`LALT_T(kc)`|`LOPT_T(kc)`, `ALT_T(kc)`, `OPT_T(kc)` |Left Alt when held, `kc` when tapped | |`LGUI_T(kc)`|`LCMD_T(kc)`, `LWIN_T(kc)`, `GUI_T(kc)`, `CMD_T(kc)`, `WIN_T(kc)`|Left GUI when held, `kc` when tapped | |`RCTL_T(kc)`| |Right Control when held, `kc` when tapped | |`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped | -|`RALT_T(kc)`|`ALGR_T(kc)` |Right Alt when held, `kc` when tapped | +|`RALT_T(kc)`|`ROPT_T(kc)`, `ALGR_T(kc)` |Right Alt when held, `kc` when tapped | |`RGUI_T(kc)`|`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped | |`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | |`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index f6aac22341..0958c4f4eb 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -521,13 +521,15 @@ enum quantum_keycodes { #define LSFT(kc) (QK_LSFT | (kc)) #define LALT(kc) (QK_LALT | (kc)) #define LGUI(kc) (QK_LGUI | (kc)) +#define LOPT(kc) LALT(kc) #define LCMD(kc) LGUI(kc) #define LWIN(kc) LGUI(kc) #define RCTL(kc) (QK_RCTL | (kc)) #define RSFT(kc) (QK_RSFT | (kc)) #define RALT(kc) (QK_RALT | (kc)) -#define ALGR(kc) RALT(kc) #define RGUI(kc) (QK_RGUI | (kc)) +#define ALGR(kc) RALT(kc) +#define ROPT(kc) RALT(kc) #define RCMD(kc) RGUI(kc) #define RWIN(kc) RGUI(kc) @@ -736,8 +738,11 @@ enum quantum_keycodes { #define LALT_T(kc) MT(MOD_LALT, kc) #define RALT_T(kc) MT(MOD_RALT, kc) -#define ALT_T(kc) LALT_T(kc) +#define LOPT_T(kc) LALT_T(kc) +#define ROPT_T(kc) RALT_T(kc) #define ALGR_T(kc) RALT_T(kc) +#define ALT_T(kc) LALT_T(kc) +#define OPT_T(kc) LOPT_T(kc) #define LGUI_T(kc) MT(MOD_LGUI, kc) #define RGUI_T(kc) MT(MOD_RGUI, kc) diff --git a/quantum/send_string_keycodes.h b/quantum/send_string_keycodes.h index 86dc8bf00c..1e8a8e9ff5 100644 --- a/quantum/send_string_keycodes.h +++ b/quantum/send_string_keycodes.h @@ -96,11 +96,13 @@ /* Modifiers */ #define X_LCTL X_LCTRL #define X_LSFT X_LSHIFT +#define X_LOPT X_LALT #define X_LCMD X_LGUI #define X_LWIN X_LGUI #define X_RCTL X_RCTRL #define X_RSFT X_RSHIFT #define X_ALGR X_RALT +#define X_ROPT X_RALT #define X_RCMD X_RGUI #define X_RWIN X_RGUI diff --git a/tmk_core/common/keycode.h b/tmk_core/common/keycode.h index e1059fadf0..5c8ba8fe60 100644 --- a/tmk_core/common/keycode.h +++ b/tmk_core/common/keycode.h @@ -152,11 +152,13 @@ along with this program. If not, see . /* Modifiers */ #define KC_LCTL KC_LCTRL #define KC_LSFT KC_LSHIFT +#define KC_LOPT KC_LALT #define KC_LCMD KC_LGUI #define KC_LWIN KC_LGUI #define KC_RCTL KC_RCTRL #define KC_RSFT KC_RSHIFT #define KC_ALGR KC_RALT +#define KC_ROPT KC_RALT #define KC_RCMD KC_RGUI #define KC_RWIN KC_RGUI