qmk_firmware

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

keymap.c (758B)


      1 #include QMK_KEYBOARD_H
      2 
      3 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
      4     [0] = LAYOUT(
      5                  KC_P7,   KC_P8,   KC_P9, KC_PMNS,
      6                  KC_P4,   KC_P5,   KC_P6, KC_PPLS,
      7         KC_MUTE, KC_P1,   KC_P2,   KC_P3, KC_TAB,
      8         KC_ESC,  KC_DEL, KC_P0, KC_PDOT, KC_PENT
      9     )
     10 
     11 };
     12 
     13 bool encoder_update_user(uint8_t index, bool clockwise) {
     14   if (index == 0) { /* First encoder below the controller */
     15     if (clockwise) {
     16       tap_code(KC_VOLD); /*volume down*/
     17     } else {
     18       tap_code(KC_VOLU); /*volume up*/
     19     }
     20   } else if (index == 1) { /* Second encoder */
     21     if (clockwise) {
     22       tap_code(MS_WHLU); /*mouse wheel up*/
     23     } else {
     24       tap_code(MS_WHLD); /*mouse wheel down*/
     25     }
     26   }
     27     return true;
     28 }