Formatting
This commit is contained in:
@@ -13,7 +13,7 @@ AlwaysBreakAfterReturnType: None
|
|||||||
AlwaysBreakBeforeMultilineStrings: 'false'
|
AlwaysBreakBeforeMultilineStrings: 'false'
|
||||||
BinPackArguments: 'true'
|
BinPackArguments: 'true'
|
||||||
BinPackParameters: 'true'
|
BinPackParameters: 'true'
|
||||||
ColumnLimit: '1000'
|
ColumnLimit: '100'
|
||||||
IndentCaseLabels: 'true'
|
IndentCaseLabels: 'true'
|
||||||
IndentPPDirectives: AfterHash
|
IndentPPDirectives: AfterHash
|
||||||
IndentWidth: '4'
|
IndentWidth: '4'
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
// ),
|
// ),
|
||||||
};
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
void keyboard_pre_init_user(void) {
|
void keyboard_pre_init_user(void) {
|
||||||
setPinOutput(24);
|
setPinOutput(24);
|
||||||
@@ -112,12 +113,10 @@ typedef struct {
|
|||||||
oneshot_mode_t mode;
|
oneshot_mode_t mode;
|
||||||
} oneshot_state_t;
|
} oneshot_state_t;
|
||||||
|
|
||||||
oneshot_state_t oneshot_state[4] = {
|
oneshot_state_t oneshot_state[4] = {{0, KC_LSFT, OS_LSFT, os_up_unqueued},
|
||||||
{ 0, KC_LSFT, OS_LSFT, os_up_unqueued },
|
{0, KC_LCTL, OS_LCTL, os_up_unqueued},
|
||||||
{ 0, KC_LCTL, OS_LCTL, os_up_unqueued },
|
{0, KC_LALT, OS_LALT, os_up_unqueued},
|
||||||
{ 0, KC_LALT, OS_LALT, os_up_unqueued },
|
{0, KC_LGUI, OS_LGUI, os_up_unqueued}};
|
||||||
{ 0, KC_LGUI, OS_LGUI, os_up_unqueued }
|
|
||||||
};
|
|
||||||
|
|
||||||
bool is_oneshot_ignored_key(uint16_t keycode) {
|
bool is_oneshot_ignored_key(uint16_t keycode) {
|
||||||
switch (keycode) {
|
switch (keycode) {
|
||||||
@@ -136,20 +135,12 @@ bool is_oneshot_ignored_key(uint16_t keycode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool is_oneshot_cancel_key(uint16_t keycode) {
|
bool is_oneshot_cancel_key(uint16_t keycode) {
|
||||||
switch (keycode) {
|
return keycode == KC_NO;
|
||||||
case KC_NO:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Based on https://github.com/qmk/qmk_firmware/blob/user-keymaps-still-present/users/callum/oneshot.c
|
// Based on
|
||||||
void update_oneshot(
|
// https://github.com/qmk/qmk_firmware/blob/user-keymaps-still-present/users/callum/oneshot.c
|
||||||
oneshot_state_t *state,
|
void update_oneshot(oneshot_state_t *state, uint16_t keycode, keyrecord_t *record) {
|
||||||
uint16_t keycode,
|
|
||||||
keyrecord_t *record
|
|
||||||
) {
|
|
||||||
if (keycode == state->trigger) {
|
if (keycode == state->trigger) {
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
// Trigger keydown
|
// Trigger keydown
|
||||||
@@ -233,4 +224,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user