summaryrefslogtreecommitdiff
path: root/keyboards/handwired/mutepad/keymaps/default/keymap.c
diff options
context:
space:
mode:
authorJoshua Barber <josh@jwjb.io>2022-03-20 17:02:46 +0000
committerGitHub <noreply@github.com>2022-03-20 17:02:46 +0000
commit6125f7bf4d15b4ab9403186a5282bb75bc00bd07 (patch)
tree65a5d1b076a254a325ee876ed613ac38fb62fe9a /keyboards/handwired/mutepad/keymaps/default/keymap.c
parent2f095b8925df98cf2c8c818c8fc44a9015efd6be (diff)
Add MutePad keyboard (Handwired) (#16590)
* Add MutePad keyboard * Update info.json and readme * Move mutepad to handwired folder * Address PR comments
Diffstat (limited to 'keyboards/handwired/mutepad/keymaps/default/keymap.c')
-rw-r--r--keyboards/handwired/mutepad/keymaps/default/keymap.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/keyboards/handwired/mutepad/keymaps/default/keymap.c b/keyboards/handwired/mutepad/keymaps/default/keymap.c
new file mode 100644
index 0000000000..d26e230e53
--- /dev/null
+++ b/keyboards/handwired/mutepad/keymaps/default/keymap.c
@@ -0,0 +1,43 @@
+// Copyright 2022 Joshua Barber (@JoshwJB)
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include QMK_KEYBOARD_H
+
+// Defines names for use in layer keycodes and the keymap
+enum layer_names { _BASE };
+
+enum custom_keycodes { MUTE_GOOGLE_MEET = 0, MUTE_TEAMS = 1 };
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case MUTE_GOOGLE_MEET:
+ if (record->event.pressed) {
+ tap_code16(G(KC_D));
+ }
+ break;
+ case MUTE_TEAMS:
+ if (record->event.pressed) {
+ tap_code16(C(S(KC_M)));
+ }
+ break;
+ }
+
+ return true;
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ /* Base */
+ [_BASE] = LAYOUT(MUTE_TEAMS, KC_F23, KC_F24, KC_MPLY)};
+
+#ifdef ENCODER_ENABLE
+
+bool encoder_update_user(uint8_t index, bool clockwise) {
+ if (clockwise) {
+ tap_code(KC_VOLU);
+ } else {
+ tap_code(KC_VOLD);
+ }
+ return true;
+}
+
+#endif