Update tidbit mouse keys based on tidbit mouse keys
This commit is contained in:
parent
44b1fae401
commit
b5dd2bec95
|
@ -29,6 +29,7 @@
|
||||||
#define MOUSEKEY_WHEEL_INTERVAL 50
|
#define MOUSEKEY_WHEEL_INTERVAL 50
|
||||||
#define MOUSEKEY_WHEEL_TIME_TO_MAX 20
|
#define MOUSEKEY_WHEEL_TIME_TO_MAX 20
|
||||||
#define MOUSEKEY_WHEEL_MAX_SPEED 10
|
#define MOUSEKEY_WHEEL_MAX_SPEED 10
|
||||||
|
#define MK_COMBINED
|
||||||
|
|
||||||
// Encoder
|
// Encoder
|
||||||
#define ENCODERS_PAD_A { D3 }
|
#define ENCODERS_PAD_A { D3 }
|
||||||
|
|
|
@ -20,16 +20,31 @@
|
||||||
|
|
||||||
enum custom_keycodes {
|
enum custom_keycodes {
|
||||||
PROG = SAFE_RANGE,
|
PROG = SAFE_RANGE,
|
||||||
|
ACCEL,
|
||||||
|
ACCEL_ADJ,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
ACCEL_0 = 0,
|
||||||
|
ACCEL_1 = 1,
|
||||||
|
ACCEL_2 = 2,
|
||||||
|
};
|
||||||
|
static uint8_t acceleration_level = ACCEL_0;
|
||||||
|
void change_accel(void) {
|
||||||
|
acceleration_level++;
|
||||||
|
if (acceleration_level > ACCEL_2) {
|
||||||
|
acceleration_level = ACCEL_0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
// Base layer (numpad)
|
// Base layer (numpad)
|
||||||
[0] = LAYOUT(
|
[0] = LAYOUT(
|
||||||
TO(1), PROG, KC_NO, \
|
TO(1), PROG, KC_AUDIO_VOL_UP, \
|
||||||
LCTL(LALT(KC_TAB)), LGUI(KC_DOWN), KC_NO, KC_AUDIO_VOL_UP, \
|
KC_MS_WH_LEFT, KC_NO, KC_MS_WH_RIGHT, KC_AUDIO_VOL_DOWN, \
|
||||||
KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_AUDIO_VOL_DOWN, \
|
KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, LCTL(LALT(KC_TAB)), \
|
||||||
KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_BTN3, \
|
KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, LGUI(KC_DOWN), \
|
||||||
KC_NO, KC_MS_WH_LEFT, KC_MS_WH_RIGHT, KC_ESC \
|
KC_NO, KC_ESC, ACCEL_ADJ, ACCEL \
|
||||||
),
|
),
|
||||||
|
|
||||||
// Function layer (numpad)
|
// Function layer (numpad)
|
||||||
|
@ -53,7 +68,40 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
bootloader_jump(); //jump to bootloader
|
bootloader_jump(); //jump to bootloader
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ACCEL:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
switch(acceleration_level) {
|
||||||
|
case ACCEL_0:
|
||||||
|
register_code16(KC_ACL0);
|
||||||
|
break;
|
||||||
|
case ACCEL_1:
|
||||||
|
register_code16(KC_ACL1);
|
||||||
|
break;
|
||||||
|
case ACCEL_2:
|
||||||
|
register_code16(KC_ACL2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch(acceleration_level) {
|
||||||
|
case ACCEL_0:
|
||||||
|
unregister_code16(KC_ACL0);
|
||||||
|
break;
|
||||||
|
case ACCEL_1:
|
||||||
|
unregister_code16(KC_ACL1);
|
||||||
|
break;
|
||||||
|
case ACCEL_2:
|
||||||
|
unregister_code16(KC_ACL2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false; // Skip all further processing of this key
|
||||||
|
case ACCEL_ADJ:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
change_accel();
|
||||||
|
}
|
||||||
|
return false; // Skip all further processing of this key
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,36 +11,36 @@
|
||||||
},
|
},
|
||||||
"TG(1)",
|
"TG(1)",
|
||||||
"Boot",
|
"Boot",
|
||||||
""
|
"Vol Up"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"Ctrl + Alt + Tab",
|
"Wheel Left",
|
||||||
"GUI + Down",
|
|
||||||
"",
|
"",
|
||||||
"Vol Up"
|
"Wheel Right",
|
||||||
|
"Vol Down"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"Left Click",
|
"Left Click",
|
||||||
"Up",
|
"Up",
|
||||||
"Right Click",
|
"Right Click",
|
||||||
"Vol Down"
|
"Ctrl + Alt + Tab"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
"Left",
|
"Left",
|
||||||
"Down",
|
"Down",
|
||||||
"Right",
|
"Right",
|
||||||
"Mouse 3"
|
"GUI + Down"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"a": 5
|
"a": 5
|
||||||
},
|
},
|
||||||
"W Up\nW Dn\n\n\n\n\nEnc",
|
"W Up\nW Dn",
|
||||||
{
|
{
|
||||||
"a": 7
|
"a": 7
|
||||||
},
|
},
|
||||||
"W Left",
|
"Esc",
|
||||||
"W Right",
|
"Accel Mode",
|
||||||
"Esc"
|
"Accel"
|
||||||
]
|
]
|
||||||
]
|
]
|
Binary file not shown.
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
@ -29,6 +29,7 @@
|
||||||
#define MOUSEKEY_WHEEL_INTERVAL 50
|
#define MOUSEKEY_WHEEL_INTERVAL 50
|
||||||
#define MOUSEKEY_WHEEL_TIME_TO_MAX 20
|
#define MOUSEKEY_WHEEL_TIME_TO_MAX 20
|
||||||
#define MOUSEKEY_WHEEL_MAX_SPEED 10
|
#define MOUSEKEY_WHEEL_MAX_SPEED 10
|
||||||
|
#define MK_COMBINED
|
||||||
|
|
||||||
// Encoder
|
// Encoder
|
||||||
#define ENCODERS_PAD_A { D3 }
|
#define ENCODERS_PAD_A { D3 }
|
||||||
|
|
|
@ -20,16 +20,31 @@
|
||||||
|
|
||||||
enum custom_keycodes {
|
enum custom_keycodes {
|
||||||
PROG = SAFE_RANGE,
|
PROG = SAFE_RANGE,
|
||||||
|
ACCEL,
|
||||||
|
ACCEL_ADJ,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
ACCEL_0 = 0,
|
||||||
|
ACCEL_1 = 1,
|
||||||
|
ACCEL_2 = 2,
|
||||||
|
};
|
||||||
|
static uint8_t acceleration_level = ACCEL_0;
|
||||||
|
void change_accel(void) {
|
||||||
|
acceleration_level++;
|
||||||
|
if (acceleration_level > ACCEL_2) {
|
||||||
|
acceleration_level = ACCEL_0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
// Base layer (numpad)
|
// Base layer (numpad)
|
||||||
[0] = LAYOUT(
|
[0] = LAYOUT(
|
||||||
TO(1), PROG, KC_NO, \
|
TO(1), PROG, KC_AUDIO_VOL_UP, \
|
||||||
LCTL(LALT(KC_TAB)), LGUI(KC_DOWN), KC_NO, KC_AUDIO_VOL_UP, \
|
KC_MS_WH_LEFT, KC_NO, KC_MS_WH_RIGHT, KC_AUDIO_VOL_DOWN, \
|
||||||
KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_AUDIO_VOL_DOWN, \
|
KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, LCTL(LALT(KC_TAB)), \
|
||||||
KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_BTN3, \
|
KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, LGUI(KC_DOWN), \
|
||||||
KC_NO, KC_MS_WH_LEFT, KC_MS_WH_RIGHT, KC_ESC \
|
KC_NO, KC_ESC, ACCEL_ADJ, ACCEL \
|
||||||
),
|
),
|
||||||
|
|
||||||
// Function layer (numpad)
|
// Function layer (numpad)
|
||||||
|
@ -53,7 +68,40 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
bootloader_jump(); //jump to bootloader
|
bootloader_jump(); //jump to bootloader
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ACCEL:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
switch(acceleration_level) {
|
||||||
|
case ACCEL_0:
|
||||||
|
register_code16(KC_ACL0);
|
||||||
|
break;
|
||||||
|
case ACCEL_1:
|
||||||
|
register_code16(KC_ACL1);
|
||||||
|
break;
|
||||||
|
case ACCEL_2:
|
||||||
|
register_code16(KC_ACL2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch(acceleration_level) {
|
||||||
|
case ACCEL_0:
|
||||||
|
unregister_code16(KC_ACL0);
|
||||||
|
break;
|
||||||
|
case ACCEL_1:
|
||||||
|
unregister_code16(KC_ACL1);
|
||||||
|
break;
|
||||||
|
case ACCEL_2:
|
||||||
|
unregister_code16(KC_ACL2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false; // Skip all further processing of this key
|
||||||
|
case ACCEL_ADJ:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
change_accel();
|
||||||
|
}
|
||||||
|
return false; // Skip all further processing of this key
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue