1
0
Fork 0

Add *OPT aliases for *ALT keycodes and macros (#8714)

This commit is contained in:
Konstantin Đorđević 2020-04-12 20:37:55 +02:00 committed by GitHub
parent 6e84247ec2
commit 370577e4ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 28 additions and 19 deletions

View file

@ -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` | |`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` |
|`LSFT(kc)`|`S(kc)` |Hold Left Shift 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` | |`LGUI(kc)`|`G(kc)`, `LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` |
|`RCTL(kc)`| |Hold Right Control and press `kc` | |`RCTL(kc)`| |Hold Right Control and press `kc` |
|`RSFT(kc)`| |Hold Right Shift 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` | |`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` | |`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)` |Hold Left Shift and GUI and press `kc` |
|`LCA(kc)` | |Hold Left Control and Alt 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` | |`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` |
|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI 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 # Legacy Content :id=legacy-content

View file

@ -161,11 +161,11 @@ There's also a couple of mod shortcuts you can use:
* `SS_LCTL(string)` * `SS_LCTL(string)`
* `SS_LSFT(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_LGUI(string)`, `SS_LCMD(string)` or `SS_LWIN(string)`
* `SS_RCTL(string)` * `SS_RCTL(string)`
* `SS_RSFT(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)` * `SS_RGUI(string)`, `SS_RCMD(string)` or `SS_RWIN(string)`
These press the respective modifier, send the supplied string and then release the modifier. These press the respective modifier, send the supplied string and then release the modifier.

View file

@ -54,11 +54,11 @@ QMK を使い始めたばかりの場合は、全てを単純にしたいでし
|----------|-------------------------------|----------------------------------------------------| |----------|-------------------------------|----------------------------------------------------|
| `LCTL(kc)` | `C(kc)` | 左 Control を押しながら `kc` を押します。 | | `LCTL(kc)` | `C(kc)` | 左 Control を押しながら `kc` を押します。 |
| `LSFT(kc)` | `S(kc)` | 左 Shift を押しながら `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` を押します。 | | `LGUI(kc)` | `G(kc)`, `LCMD(kc)`, `LWIN(kc)` | 左 GUI を押しながら `kc` を押します。 |
| `RCTL(kc)` | | 右 Control を押しながら `kc` を押します。 | | `RCTL(kc)` | | 右 Control を押しながら `kc` を押します。 |
| `RSFT(kc)` | | 右 Shift を押しながら `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` を押します。 | | `RGUI(kc)` | `RCMD(kc)`, `LWIN(kc)` | 右 GUI を押しながら `kc` を押します。 |
| `SGUI(kc)` | `SCMD(kc)`, `SWIN(kc)` | 左 Shift と左 GUI を押しながら `kc` を押します。 | | `SGUI(kc)` | `SCMD(kc)`, `SWIN(kc)` | 左 Shift と左 GUI を押しながら `kc` を押します。 |
| `LCA(kc)` | | 左 Control と左 Alt を押しながら `kc` を押します。 | | `LCA(kc)` | | 左 Control と左 Alt を押しながら `kc` を押します。 |

View file

@ -175,11 +175,11 @@ See also: [Basic Keycodes](keycodes_basic.md)
|`KC_EXSEL` | |ExSel | |`KC_EXSEL` | |ExSel |
|`KC_LCTRL` |`KC_LCTL` |Left Control | |`KC_LCTRL` |`KC_LCTL` |Left Control |
|`KC_LSHIFT` |`KC_LSFT` |Left Shift | |`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_LGUI` |`KC_LCMD`, `KC_LWIN` |Left GUI (Windows/Command/Meta key) |
|`KC_RCTRL` |`KC_RCTL` |Right Control | |`KC_RCTRL` |`KC_RCTL` |Right Control |
|`KC_RSHIFT` |`KC_RSFT` |Right Shift | |`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_RGUI` |`KC_RCMD`, `KC_RWIN` |Right GUI (Windows/Command/Meta key) |
|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down | |`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down |
|`KC_SYSTEM_SLEEP` |`KC_SLEP` |System Sleep | |`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` | |`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` |
|`LSFT(kc)`|`S(kc)` |Hold Left Shift 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` | |`LGUI(kc)`|`G(kc)`, `LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` |
|`RCTL(kc)`| |Hold Right Control and press `kc` | |`RCTL(kc)`| |Hold Right Control and press `kc` |
|`RSFT(kc)`| |Hold Right Shift 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` | |`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` | |`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)` |Hold Left Shift and GUI and press `kc` |
|`LCA(kc)` | |Hold Left Control and Alt 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 | |`MT(mod, kc)`| |`mod` when held, `kc` when tapped |
|`LCTL_T(kc)` |`CTL_T(kc)` |Left Control 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 | |`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 | |`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 | |`RCTL_T(kc)` | |Right Control when held, `kc` when tapped |
|`RSFT_T(kc)` | |Right Shift 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 | |`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 | |`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 | |`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped |

View file

@ -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_LCTRL` |`KC_LCTL` |Left Control |
|`KC_LSHIFT`|`KC_LSFT` |Left Shift | |`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_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) |
|`KC_RCTRL` |`KC_RCTL` |Right Control | |`KC_RCTRL` |`KC_RCTL` |Right Control |
|`KC_RSHIFT`|`KC_RSFT` |Right Shift | |`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_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key)|
## International ## International

View file

@ -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 | |`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 | |`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 | |`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 | |`RCTL_T(kc)`| |Right Control when held, `kc` when tapped |
|`RSFT_T(kc)`| |Right Shift 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 | |`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 | |`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 | |`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped |

View file

@ -521,13 +521,15 @@ enum quantum_keycodes {
#define LSFT(kc) (QK_LSFT | (kc)) #define LSFT(kc) (QK_LSFT | (kc))
#define LALT(kc) (QK_LALT | (kc)) #define LALT(kc) (QK_LALT | (kc))
#define LGUI(kc) (QK_LGUI | (kc)) #define LGUI(kc) (QK_LGUI | (kc))
#define LOPT(kc) LALT(kc)
#define LCMD(kc) LGUI(kc) #define LCMD(kc) LGUI(kc)
#define LWIN(kc) LGUI(kc) #define LWIN(kc) LGUI(kc)
#define RCTL(kc) (QK_RCTL | (kc)) #define RCTL(kc) (QK_RCTL | (kc))
#define RSFT(kc) (QK_RSFT | (kc)) #define RSFT(kc) (QK_RSFT | (kc))
#define RALT(kc) (QK_RALT | (kc)) #define RALT(kc) (QK_RALT | (kc))
#define ALGR(kc) RALT(kc)
#define RGUI(kc) (QK_RGUI | (kc)) #define RGUI(kc) (QK_RGUI | (kc))
#define ALGR(kc) RALT(kc)
#define ROPT(kc) RALT(kc)
#define RCMD(kc) RGUI(kc) #define RCMD(kc) RGUI(kc)
#define RWIN(kc) RGUI(kc) #define RWIN(kc) RGUI(kc)
@ -736,8 +738,11 @@ enum quantum_keycodes {
#define LALT_T(kc) MT(MOD_LALT, kc) #define LALT_T(kc) MT(MOD_LALT, kc)
#define RALT_T(kc) MT(MOD_RALT, 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 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 LGUI_T(kc) MT(MOD_LGUI, kc)
#define RGUI_T(kc) MT(MOD_RGUI, kc) #define RGUI_T(kc) MT(MOD_RGUI, kc)

View file

@ -96,11 +96,13 @@
/* Modifiers */ /* Modifiers */
#define X_LCTL X_LCTRL #define X_LCTL X_LCTRL
#define X_LSFT X_LSHIFT #define X_LSFT X_LSHIFT
#define X_LOPT X_LALT
#define X_LCMD X_LGUI #define X_LCMD X_LGUI
#define X_LWIN X_LGUI #define X_LWIN X_LGUI
#define X_RCTL X_RCTRL #define X_RCTL X_RCTRL
#define X_RSFT X_RSHIFT #define X_RSFT X_RSHIFT
#define X_ALGR X_RALT #define X_ALGR X_RALT
#define X_ROPT X_RALT
#define X_RCMD X_RGUI #define X_RCMD X_RGUI
#define X_RWIN X_RGUI #define X_RWIN X_RGUI

View file

@ -152,11 +152,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Modifiers */ /* Modifiers */
#define KC_LCTL KC_LCTRL #define KC_LCTL KC_LCTRL
#define KC_LSFT KC_LSHIFT #define KC_LSFT KC_LSHIFT
#define KC_LOPT KC_LALT
#define KC_LCMD KC_LGUI #define KC_LCMD KC_LGUI
#define KC_LWIN KC_LGUI #define KC_LWIN KC_LGUI
#define KC_RCTL KC_RCTRL #define KC_RCTL KC_RCTRL
#define KC_RSFT KC_RSHIFT #define KC_RSFT KC_RSHIFT
#define KC_ALGR KC_RALT #define KC_ALGR KC_RALT
#define KC_ROPT KC_RALT
#define KC_RCMD KC_RGUI #define KC_RCMD KC_RGUI
#define KC_RWIN KC_RGUI #define KC_RWIN KC_RGUI