Skip to content

Commit

Permalink
Get rid of useless shit
Browse files Browse the repository at this point in the history
  • Loading branch information
adophoxia committed Jan 14, 2024
1 parent 0780b59 commit 2e2913b
Showing 1 changed file with 1 addition and 106 deletions.
107 changes: 1 addition & 106 deletions keyboards/keychron/q0/base/keymaps/adophoxia/adophoxia.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,109 +35,4 @@ bool shutdown_user(bool jump_to_bootloader) {
rgb_matrix_update_pwm_buffers();
// false to not process kb level
return false;
}

bool is_base_active = true;
#define BASE_LAYER _BASE
uint16_t base_layer_timer = 0;

layer_state_t layer_state_set_user(layer_state_t state) {
switch (get_highest_layer(state)) {
case _BASE:

break;
case _FN1 && _FN2
if (current_layer > _BASE) {
is_base_active = false;
}
break;
default:
// Reset back to the current profile
ap2_led_reset_foreground_color();
break;
}
return state;
}





bool is_base_active = false;
#define LAYER_BASE 0
uint16_t base_layer_timer = 0;

uint8_t current_layer = get_highest_layer(layer_state);

if (current_layer > LAYER_BASE) {
return false;
}






























#### Super ALT↯TAB

This macro will register `KC_LALT` and tap `KC_TAB`, then wait for 1000ms. If the key is tapped again, it will send another `KC_TAB`; if there is no tap, `KC_LALT` will be unregistered, thus allowing you to cycle through windows.

```c
bool is_alt_tab_active = false; // ADD this near the beginning of keymap.c
uint16_t alt_tab_timer = 0; // we will be using them soon.

enum custom_keycodes { // Make sure have the awesome keycode ready
ALT_TAB = SAFE_RANGE,
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { // This will do most of the grunt work with the keycodes.
case ALT_TAB:
if (record->event.pressed) {
if (!is_alt_tab_active) {
is_alt_tab_active = true;
register_code(KC_LALT);
}
alt_tab_timer = timer_read();
register_code(KC_TAB);
} else {
unregister_code(KC_TAB);
}
break;
}
return true;
}

void matrix_scan_user(void) { // The very important timer.
if (is_alt_tab_active) {
if (timer_elapsed(alt_tab_timer) > 1000) {
unregister_code(KC_LALT);
is_alt_tab_active = false;
}
}
}
```
}

0 comments on commit 2e2913b

Please sign in to comment.