jotix's community ortho_4x12 layout change (#17891)

master
jotix 2022-08-03 07:32:23 -03:00 committed by GitHub
parent 0206bd9df3
commit 4ec2626b43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 60 additions and 29 deletions

View File

@ -4,14 +4,17 @@ enum layers {
_QWERTY, _QWERTY,
_LOWER, _LOWER,
_RAISE, _RAISE,
_GAME,
_NUMPAD,
_MOUSE,
_ADJUST,
}; };
#define LOWER MO(_LOWER) #define LOWER MO(_LOWER)
#define RAISE MO(_RAISE) #define RAISE MO(_RAISE)
#define GAME TG(_GAME)
static bool is_ctl_pressed; #define NUMPAD TG(_NUMPAD)
static bool is_esc_pressed; #define MOUSE TG(_MOUSE)
static bool is_bspc_pressed;
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@ -50,12 +53,61 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______,_______,_______,_______,_______,_______,_______,_______,KC_HOME,KC_PGDN,KC_PGUP,KC_END _______,_______,_______,_______,_______,_______,_______,_______,KC_HOME,KC_PGDN,KC_PGUP,KC_END
// └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘ // └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘
), ),
[_GAME] = LAYOUT_ortho_4x12 (
// ┌───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┐
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_UP, _______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,_______,_______,_______,KC_SLSH,KC_LEFT,KC_DOWN,KC_RGHT
// └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘
),
[_NUMPAD] = LAYOUT_ortho_4x12 (
// ┌───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┐
NUMPAD ,_______,_______,_______,_______,_______,_______,KC_P7, KC_P8, KC_P9, KC_PMNS,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,_______,_______,KC_P4, KC_P5, KC_P6, KC_PPLS,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,_______,_______,KC_P1, KC_P2, KC_P3, KC_PSLS,KC_PENT,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,_______,_______,_______,KC_P0, KC_PDOT,KC_PAST,_______
// └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘
),
[_MOUSE] = LAYOUT_ortho_4x12 (
// ┌───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┐
MOUSE, KC_BTN1,KC_MS_U,KC_BTN2,KC_WH_U,_______,_______,_______,_______,_______,_______,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,KC_MS_L,KC_MS_D,KC_MS_R,KC_WH_D,_______,_______,_______,_______,_______,_______,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______
// └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘
),
[_ADJUST] = LAYOUT_ortho_4x12 (
// ┌───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┬───────┐
_______,RESET ,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,GAME ,_______,_______,_______,_______,_______,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,_______,NUMPAD, MOUSE, _______,_______,_______,_______,
// ├───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┼───────┤
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______
// └───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┴───────┘
),
}; };
layer_state_t layer_state_set_user(layer_state_t state) { layer_state_t layer_state_set_user(layer_state_t state) {
state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
#ifdef JOTANCK_LEDS #ifdef JOTANCK_LEDS
writePin(JOTANCK_LED1, (get_highest_layer(state) == _LOWER)); writePin(JOTANCK_LED1, (get_highest_layer(state) == _MOUSE));
writePin(JOTANCK_LED2, (get_highest_layer(state) == _RAISE)); writePin(JOTANCK_LED2, (get_highest_layer(state) == _NUMPAD));
#endif #endif
return state; return state;
} }
@ -67,24 +119,3 @@ bool led_update_user(led_t led_state) {
} }
return true; return true;
} }
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_LCTL:
is_ctl_pressed = record->event.pressed;
break;
case KC_ESC:
is_esc_pressed = record->event.pressed;
break;
case KC_BSPC:
is_bspc_pressed = record->event.pressed;
break;
};
return true;
}
void matrix_scan_user(void) {
if (is_ctl_pressed && is_esc_pressed && is_bspc_pressed) {
reset_keyboard();
}
}