mirror of
https://github.com/Keychron/qmk_firmware.git
synced 2024-11-25 01:47:10 +06:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
commit
8f03657491
|
@ -81,5 +81,13 @@
|
||||||
|
|
||||||
#ifdef MOUSEKEY_ENABLE
|
#ifdef MOUSEKEY_ENABLE
|
||||||
# define MOUSEKEY_INTERVAL 16 // 60 FPS
|
# define MOUSEKEY_INTERVAL 16 // 60 FPS
|
||||||
|
|
||||||
|
// Speed up the slowest preset
|
||||||
|
# define MK_C_OFFSET_0 4
|
||||||
|
# define MK_C_INTERVAL_0 16
|
||||||
|
|
||||||
|
// Speed up the medium preset
|
||||||
|
# define MK_C_OFFSET_1 16
|
||||||
|
|
||||||
# define MK_3_SPEED
|
# define MK_3_SPEED
|
||||||
#endif
|
#endif
|
|
@ -10,15 +10,30 @@ enum custom_keycodes {
|
||||||
MCR_REC, // Macro record
|
MCR_REC, // Macro record
|
||||||
MCR_SWT, // Swap active macro
|
MCR_SWT, // Swap active macro
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef MOUSEKEY_ENABLE
|
||||||
|
MS_ACL_U,
|
||||||
|
MS_ACL_D,
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
enum layout_names {
|
enum layout_names {
|
||||||
_MAIN = 0, // Keys Layout: The main keyboard layout that has all the characters
|
_MAIN = 0, // Keys Layout: The main keyboard layout that has all the characters
|
||||||
_SUB, // Extension to Main
|
_SUB, // Extension to Main
|
||||||
_CTR, // Macros, RGB, Audio controls, layer access. More or less the control center of my keyboard
|
_CTR, // Macros, RGB, Audio controls, layer access. More or less the control center of my keyboard
|
||||||
|
#ifdef MOUSEKEY_ENABLE
|
||||||
|
_MSE,
|
||||||
|
#endif // MOUSEKEY_ENABLE
|
||||||
_END,
|
_END,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef MOUSEKEY_ENABLE
|
||||||
|
#include "action.h"
|
||||||
|
#define TOG_MSE TG(_MSE)
|
||||||
|
static int current_accel = 0;
|
||||||
|
#else
|
||||||
|
#define TOG_MSE XXXXXXX
|
||||||
|
#endif // MOUSEKEY_ENABLE
|
||||||
|
|
||||||
#ifdef DYNAMIC_MACRO_ENABLE
|
#ifdef DYNAMIC_MACRO_ENABLE
|
||||||
// Macro 1 is = 1, Macro 2 = -1, No macro = 0
|
// Macro 1 is = 1, Macro 2 = -1, No macro = 0
|
||||||
static bool MACRO1 = true;
|
static bool MACRO1 = true;
|
||||||
|
@ -57,8 +72,16 @@ const uint16_t PROGMEM keymaps[_END][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
XXXXXXX, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, XXXXXXX, XXXXXXX, KC_VOLU, XXXXXXX, XXXXXXX, MCR_REC,
|
XXXXXXX, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, XXXXXXX, XXXXXXX, KC_VOLU, XXXXXXX, XXXXXXX, MCR_REC,
|
||||||
XXXXXXX, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, MCR_PLY,
|
XXXXXXX, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, MCR_PLY,
|
||||||
XXXXXXX, XXXXXXX, RGB_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, XXXXXXX, XXXXXXX, MCR_SWT,
|
XXXXXXX, XXXXXXX, RGB_TOG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLD, XXXXXXX, XXXXXXX, MCR_SWT,
|
||||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TOG_MSE, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
||||||
)
|
)
|
||||||
|
#ifdef MOUSEKEY_ENABLE
|
||||||
|
,[_MSE] = LAYOUT_planck_mit(
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, XXXXXXX, XXXXXXX, KC_BTN1, KC_WH_D, KC_WH_U, KC_BTN2, XXXXXXX,
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MS_ACL_D, TOG_MSE, MS_ACL_U,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
||||||
|
)
|
||||||
|
#endif // MOUSEKEY_ENABLE
|
||||||
};
|
};
|
||||||
|
|
||||||
#define LAYER (get_highest_layer(layer_state))
|
#define LAYER (get_highest_layer(layer_state))
|
||||||
|
@ -126,6 +149,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MOUSEKEY_ENABLE
|
||||||
|
if (keycode == MS_ACL_U || keycode == MS_ACL_D) {
|
||||||
|
if (record->event.pressed) {
|
||||||
|
if ( (keycode == MS_ACL_U) && (current_accel < 2) ) { current_accel += 1; }
|
||||||
|
if ( (keycode == MS_ACL_D) && (current_accel > 0) ) { current_accel -= 1; }
|
||||||
|
}
|
||||||
|
keycode = KC_ACL0 + current_accel;
|
||||||
|
action_t mousekey_action = action_for_keycode(keycode);
|
||||||
|
process_action(record, mousekey_action);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
#ifdef DYNAMIC_MACRO_ENABLE
|
#ifdef DYNAMIC_MACRO_ENABLE
|
||||||
case MCR_SWT:
|
case MCR_SWT:
|
||||||
|
|
|
@ -5,48 +5,68 @@ A layout that aims to be familiar to people that have used larger boards
|
||||||
## The layout
|
## The layout
|
||||||
|
|
||||||
The primary layer ( `_MAIN` ) is as close to standard qwerty as I could get.
|
The primary layer ( `_MAIN` ) is as close to standard qwerty as I could get.
|
||||||
```
|
| row | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|
||||||
esc | q | w | e | r | t | y | u | i | o | p | bksp
|
|-----|------|------|---|-----|-----|-----|-----|-----|-----|-----|----|------|
|
||||||
tab | a | s | d | f | g | h | j | k | l | ; | '
|
| 1 | esc | q | w | e | r | t | y | u | i | o | p | bksp |
|
||||||
shft | z | x | c | v | b | n | m | , | . | / | rtrn
|
| 2 | tab | a | s | d | f | g | h | j | k | l | ; | ' |
|
||||||
ctrl | win | | alt | SUB | spc | CTR | lft | dwn | up | rght
|
| 3 | shft | z | x | c | v | b | n | m | , | . | / | rtrn |
|
||||||
```
|
| 4 | ctrl | win | | alt | SUB | spc | <- | CTR | lft | dwn | up | rght |
|
||||||
|
|
||||||
The secondary layer ( `_SUB` ) is for syntax, F keys, and number keys
|
The secondary layer ( `_SUB` ) is for syntax, F keys, and number keys
|
||||||
```
|
| row | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|
||||||
grv | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | del
|
|-----|-----|----|----|----|-----|-----|-----|----|------|-----|----|------|
|
||||||
| F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | pgup
|
| 1 | grv | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | del |
|
||||||
_ | F7 | F8 | F9 | F10 | F11 | F12 | | home | end | \ | pgdn
|
| 2 | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | pgup |
|
||||||
_ | _ | | _ | _ | _ | _ | | | |
|
| 3 | _ | F7 | F8 | F9 | F10 | F11 | F12 | | home | end | \ | pgdn |
|
||||||
```
|
| 4 | _ | _ | | _ | _ | _ | <- | _ | | | | |
|
||||||
|
|
||||||
The control layer ( `_CTR` ) is for lighting, media, and macros
|
The control layer ( `_CTR` ) is for lighting, media, and macros
|
||||||
```
|
| row | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|
||||||
| SPD- | BRI+ | SPD+ | HUE+ | SAT+ | | | VOL+ | | | MCR_REC
|
|-----|---|-------|------|-------|------|---------|-----|------|------|------|----|---------|
|
||||||
| EFCT- | BRI- | EFCT+ | HUE- | SAT- | | PREV | PLAY | NEXT | | MCR_PLY
|
| 1 | | SPD- | BRI+ | SPD+ | HUE+ | SAT+ | | | VOL+ | | | MCR_REC |
|
||||||
| | TOG | | | | | | VOL- | | | MCR_SWT
|
| 2 | | EFCT- | BRI- | EFCT+ | HUE- | SAT- | | PREV | PLAY | NEXT | | MCR_PLY |
|
||||||
| | | | | _ | | | | |
|
| 3 | | | TOG | | | | | | VOL- | | | MCR_SWT |
|
||||||
```
|
| 4 | | | | | | MSE_TOG | <- | | | | | |
|
||||||
|
|
||||||
| Key name | Explanation |
|
The mouse layer ( `_MSE` ) is for making the keyboard function as a mouse as well
|
||||||
| -------- | -------------------------------------- |
|
| row | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
|
||||||
| \_ | Passthrough the key on the layer below |
|
|-----|---|------|------|------|-------|---------|-----|-------|-------|-------|-------|----|
|
||||||
| SUB | Goes to _SUB layer while held down |
|
| 1 | | | | | | | | | | | | |
|
||||||
| CTR | Goes to _CTR layer while held down |
|
| 2 | | MS_L | MS_D | MS_U | MS_R | | | L_CLC | SCR_D | SCR_U | R_CLC | |
|
||||||
| SPD +/- | Changes speed for the RGB effect |
|
| 3 | | | | | | | | | | | | |
|
||||||
| BRI +/- | Changes the brightness of the lighting |
|
| 4 | | | | | ACL_D | MSE_TOG | <- | ACL_U | | | | |
|
||||||
| EFCT +/- | Moves to the next/previous effect |
|
|
||||||
| TOG | Toggles the lighting on or off |
|
| Key name | Explanation |
|
||||||
| HUE +/- | Changes the hue for RGB effects |
|
|----------|----------------------------------------------|
|
||||||
| SAT +/- | Changes the saturation for RGB effects |
|
| \_ | Passthrough the key on the layer below |
|
||||||
| MSE | Toggles the Mouse layer |
|
| <- | Same key as imediate left. Used for spacebar |
|
||||||
| VOL +/- | Raises or lowers media volume |
|
| SUB | Goes to _SUB layer while held down |
|
||||||
| PREV | Goes to previous media |
|
| CTR | Goes to _CTR layer while held down |
|
||||||
| PLAY | Play/Pause media |
|
| MSE_TOG | Toggles the mouse layer on or off |
|
||||||
| NEXT | Goes to next media |
|
| SPD +/- | Changes speed for the RGB effect |
|
||||||
| MCR_REC | Record macro ( Press again to stop ) |
|
| BRI +/- | Changes the brightness of the lighting |
|
||||||
| MCR_PLY | Play recorded macro |
|
| EFCT +/- | Moves to the next/previous effect |
|
||||||
| MCR_SWT | Switch active macro |
|
| TOG | Toggles the lighting on or off |
|
||||||
|
| HUE +/- | Changes the hue for RGB effects |
|
||||||
|
| SAT +/- | Changes the saturation for RGB effects |
|
||||||
|
| MSE | Toggles the Mouse layer |
|
||||||
|
| VOL +/- | Raises or lowers media volume |
|
||||||
|
| PREV | Goes to previous media |
|
||||||
|
| PLAY | Play/Pause media |
|
||||||
|
| NEXT | Goes to next media |
|
||||||
|
| MCR_REC | Record macro ( Press again to stop ) |
|
||||||
|
| MCR_PLY | Play recorded macro |
|
||||||
|
| MCR_SWT | Switch active macro |
|
||||||
|
| MS_L | Move mouse cursor left |
|
||||||
|
| MS_U | Move mouse cursor up |
|
||||||
|
| MS_D | Move mouse cursor down |
|
||||||
|
| MD_R | Move mouse cursor right |
|
||||||
|
| L_CLC | Mouse left click |
|
||||||
|
| R_CLC | Mouse right click |
|
||||||
|
| SCR_U | Mouse scroll up |
|
||||||
|
| SCR_D | Mouse scroll down |
|
||||||
|
| ACL_U | Raise mouse/scroll speed |
|
||||||
|
| ACL_D | Lower mouse/scroll speed |
|
||||||
|
|
||||||
## Compiling
|
## Compiling
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
MOUSEKEY_ENABLE = no
|
MOUSEKEY_ENABLE = yes
|
||||||
NKRO_ENABLE = yes
|
NKRO_ENABLE = yes
|
||||||
DYNAMIC_MACRO_ENABLE = yes
|
DYNAMIC_MACRO_ENABLE = yes
|
||||||
LTO_ENABLE = yes
|
LTO_ENABLE = yes
|
Loading…
Reference in New Issue
Block a user