jotix layouts (#8644)
* jotix layouts * jotix ortho 4x4 layout * Update layouts/community/ortho_4x4/jotix/keymap.c Co-Authored-By: Drashna Jaelre <drashna@live.com> * jotix Co-authored-by: Drashna Jaelre <drashna@live.com>miryoku-merge-master
parent
2392ddb76b
commit
26cb83b8c0
@ -1,41 +1,74 @@
|
|||||||
#include QMK_KEYBOARD_H
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
extern keymap_config_t keymap_config;
|
enum layers {
|
||||||
|
_NUMPAD,
|
||||||
|
_GAMEPAD,
|
||||||
|
_FN
|
||||||
|
};
|
||||||
|
|
||||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
static bool is_p0_pressed;
|
||||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
static bool is_p7_pressed;
|
||||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
static bool is_pmns_pressed;
|
||||||
// entirely and just use numbers.
|
|
||||||
|
|
||||||
#define _NUMPAD 0
|
#define TGGAME TG(_GAMEPAD)
|
||||||
#define _LOWER 1
|
|
||||||
#define LOWER LT(_LOWER, KC_PENT)
|
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
/* Numpad
|
|
||||||
* +-------+-------+-------+-------+
|
|
||||||
* | 7 | 8 | 9 | - |
|
|
||||||
* +-------+-------+-------+-------+
|
|
||||||
* | 4 | 5 | 6 | + |
|
|
||||||
* +-------+-------+-------+-------+
|
|
||||||
* | 1 | 2 | 3 | / |
|
|
||||||
* +-------+-------+-------+-------+
|
|
||||||
* | | 0 | . | * |
|
|
||||||
* +-------+-------+-------+-------+
|
|
||||||
*/
|
|
||||||
[_NUMPAD] = LAYOUT_ortho_4x4 (
|
[_NUMPAD] = LAYOUT_ortho_4x4 (
|
||||||
KC_P7, KC_P8, KC_P9, KC_PMNS,
|
KC_P7, KC_P8, KC_P9, KC_PMNS,
|
||||||
KC_P4, KC_P5, KC_P6, KC_PPLS,
|
KC_P4, KC_P5, KC_P6, KC_PPLS,
|
||||||
KC_P1, KC_P2, KC_P3, KC_PSLS,
|
KC_P1, KC_P2, KC_P3, MO(_FN),
|
||||||
LOWER, KC_P0, KC_PDOT,KC_PAST
|
KC_P0, KC_PDOT,KC_PSLS,KC_PAST
|
||||||
),
|
),
|
||||||
|
|
||||||
/* Lower */
|
[_GAMEPAD] = LAYOUT_ortho_4x4 (
|
||||||
[_LOWER] = LAYOUT_ortho_4x4 (
|
KC_5, KC_6, KC_7, KC_8,
|
||||||
KC_NLCK,_______,_______,RESET ,
|
KC_1, KC_2, KC_3, KC_4,
|
||||||
_______,_______,_______,_______,
|
KC_Q, KC_W, KC_E, _______,
|
||||||
_______,_______,_______,_______,
|
KC_A, KC_S, KC_D, KC_SPC
|
||||||
_______,_______,_______,_______
|
|
||||||
),
|
),
|
||||||
|
|
||||||
|
[_FN] = LAYOUT_ortho_4x4 (
|
||||||
|
KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,
|
||||||
|
KC_EXLM,KC_AT, KC_HASH,KC_DLR,
|
||||||
|
KC_Z, KC_X, KC_C, _______,
|
||||||
|
KC_NLCK,_______,_______,TGGAME
|
||||||
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
|
#ifdef JOTPAD16_LEDS
|
||||||
|
writePin(JOTPAD16_LED1, (get_highest_layer(state) == _FN));
|
||||||
|
writePin(JOTPAD16_LED2, (get_highest_layer(state) == _GAMEPAD));
|
||||||
|
#endif
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool led_update_user(led_t led_state) {
|
||||||
|
// NumLock allways on
|
||||||
|
if (!led_state.num_lock) {
|
||||||
|
tap_code(KC_NUMLOCK);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case KC_P0:
|
||||||
|
is_p0_pressed = record->event.pressed;
|
||||||
|
break;
|
||||||
|
case KC_P7:
|
||||||
|
is_p7_pressed = record->event.pressed;
|
||||||
|
break;
|
||||||
|
case KC_PMNS:
|
||||||
|
is_pmns_pressed = record->event.pressed;
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
if (is_p0_pressed && is_p7_pressed && is_pmns_pressed) {
|
||||||
|
reset_keyboard();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,3 @@
|
|||||||
# Jotix ortho 4x4 keymap
|
# Jotix ortho 4x4 keymap
|
||||||
|
|
||||||

|
Tested on jotpad16
|
||||||
|
|
||||||
Enter is 'Lower' on hold.
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue