qmk_firmware

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

keymap.c (2953B)


      1 /* Copyright 2021 Kyle McCreery
      2  *
      3  * This program is free software: you can redistribute it and/or modify
      4  * it under the terms of the GNU General Public License as published by
      5  * the Free Software Foundation, either version 2 of the License, or
      6  * (at your option) any later version.
      7  *
      8  * This program is distributed in the hope that it will be useful,
      9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     11  * GNU General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License
     14  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
     15  */
     16 #include QMK_KEYBOARD_H
     17 
     18 // Defines names for use in layer keycodes and the keymap
     19 
     20 enum layer_names {
     21     _BASE,
     22     _FN1,
     23     _FN2,
     24     _FN3
     25 };
     26 
     27 
     28 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     29     /* Base */
     30     [_BASE] = LAYOUT(
     31                   KC_F1,   KC_F2,   KC_F3,   KC_F4,
     32                   KC_NUM,  KC_PSLS, KC_PAST, KC_PMNS,
     33                   KC_P7,   KC_P8,   KC_P9,   KC_PPLS,
     34         KC_MUTE,  KC_P4,   KC_P5,   KC_P6,   _______,
     35         MO(_FN1), KC_P1,   KC_P2,   KC_P3,   KC_PENT,
     36         KC_BSPC,  KC_P0,   _______, KC_PDOT, _______,
     37 
     38                   KC_F5,   KC_F6,   KC_F7
     39 
     40     ),
     41     [_FN1] = LAYOUT(
     42                  _______,  _______, _______, _______,
     43                  _______,  _______, _______, _______,
     44                  UG_HUED,  UG_SPDU, UG_HUEU, _______,
     45         _______, UG_PREV,  UG_TOGG, UG_NEXT, _______,
     46         _______, UG_VALD,  UG_SPDD, UG_VALU, _______,
     47         _______, UG_SATD,  _______, UG_SATU, _______,
     48 
     49                  _______, _______, _______
     50 
     51     ),
     52     [_FN2] = LAYOUT(
     53                   _______, _______, _______, _______,
     54                   _______, _______, _______, _______,
     55                   _______, _______, _______, _______,
     56         _______,  _______, _______, _______, _______,
     57         _______,  _______, _______, _______, _______,
     58         _______,  _______, _______, _______, _______,
     59 
     60                   _______, _______, _______
     61 
     62     ),
     63     [_FN3] = LAYOUT(
     64                   _______, _______, _______, _______,
     65                   _______, _______, _______, _______,
     66                   _______, _______, _______, _______,
     67         _______,  _______, _______, _______, _______,
     68         _______,  _______, _______, _______, _______,
     69         _______,  _______, _______, _______, _______,
     70 
     71                   _______, _______, _______
     72 
     73     )
     74 };
     75 
     76 #ifdef ENCODER_MAP_ENABLE
     77 const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
     78     [_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_BRID, KC_BRIU) },
     79     [_FN1]  = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
     80     [_FN2]  = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
     81     [_FN3]  = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
     82 };
     83 #endif