qmk_firmware

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

keymap.c (1004B)


      1 // Copyright 2022 Joshua Barber (@JoshwJB)
      2 // SPDX-License-Identifier: GPL-2.0-or-later
      3 
      4 #include QMK_KEYBOARD_H
      5 
      6 // Defines names for use in layer keycodes and the keymap
      7 enum layer_names { _BASE };
      8 
      9 enum custom_keycodes { MUTE_GOOGLE_MEET = 0, MUTE_TEAMS = 1 };
     10 
     11 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
     12     switch (keycode) {
     13         case MUTE_GOOGLE_MEET:
     14             if (record->event.pressed) {
     15                 tap_code16(G(KC_D));
     16             }
     17             break;
     18         case MUTE_TEAMS:
     19             if (record->event.pressed) {
     20                 tap_code16(C(S(KC_M)));
     21             }
     22             break;
     23     }
     24 
     25     return true;
     26 };
     27 
     28 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
     29     /* Base */
     30     [_BASE] = LAYOUT(MUTE_TEAMS, KC_F23, KC_F24, KC_MPLY)};
     31 
     32 #ifdef ENCODER_ENABLE
     33 
     34 bool encoder_update_user(uint8_t index, bool clockwise) {
     35     if (clockwise) {
     36         tap_code(KC_VOLU);
     37     } else {
     38         tap_code(KC_VOLD);
     39     }
     40     return true;
     41 }
     42 
     43 #endif