qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

keymap.c (2181B)


      1 // Copyright 2025 Qmk, Erik Peyronson @erikpeyronson
      2 // SPDX-License-Identifier: GPL-3.0-or-later
      3 
      4 // NOTE: This keymap is for debugging purposes to have firmware to test the matrix when building the keyboard. If you intend to build this keyboard
      5 // you should copy this to your fork or userspace repository and create your own.
      6 
      7 #include QMK_KEYBOARD_H
      8 
      9 // clang-format off
     10 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     11     [0] = LAYOUT_split_3x6_5(
     12         KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,                               KC_Y,    KC_U,    KC_I,    KC_O,    KC_P,    KC_BSPC,
     13         KC_LCTL, KC_A,    KC_S,    KC_D,    KC_F,    KC_G,                               KC_H,    KC_J,    KC_K,    KC_L,    KC_SCLN, KC_QUOT,
     14         KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,                               KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH, KC_RSFT,
     15                         KC_LBRC, KC_RBRC, KC_LGUI, KC_BSPC, KC_SPC,           KC_SPC,  KC_ENT,  KC_RALT, KC_LPRN, KC_RPRN
     16     )
     17 };
     18 // clang-format on
     19 
     20 void keyboard_post_init_user(void) {
     21 #ifdef CONSOLE_ENABLE
     22     debug_enable = true;
     23     debug_matrix = true;
     24 #endif
     25 }
     26 
     27 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
     28     // If console is enabled, it will print the matrix position and status of each key pressed
     29 #ifdef CONSOLE_ENABLE
     30     uprintf("KL: kc: 0x%04X, col: %2u, row: %2u, pressed: %u, time: %5u, int: %u, count: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed, record->event.time, record->tap.interrupted, record->tap.count);
     31 #endif
     32     return true;
     33 }
     34 
     35 // This function prints which half the keyboard considers itself to be which is
     36 // useful for verify if the handedness pin and display is correctly set up when building
     37 #ifdef OLED_ENABLE
     38 bool oled_task_user(void) {
     39     if (is_keyboard_left()) {
     40         oled_write_P(PSTR("left"), false);
     41     } else {
     42         oled_write_P(PSTR("right"), false);
     43     }
     44     return false;
     45 }
     46 #endif
     47 
     48 #ifdef ENCODER_MAP_ENABLE
     49 const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
     50     [0] = {ENCODER_CCW_CW(KC_UP, KC_DOWN), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT)}
     51 };
     52 #endif