From e804e28e8e54d6821737fc32f31b7f2735a5994d Mon Sep 17 00:00:00 2001 From: Koobaczech <67293963+Koobaczech@users.noreply.github.com> Date: Thu, 23 Dec 2021 16:43:10 -0500 Subject: [Keyboard] Add Pearlboards boards to directory (#15005) Co-authored-by: Ryan --- keyboards/pearlboards/pandora/pandora.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'keyboards/pearlboards/pandora/pandora.c') diff --git a/keyboards/pearlboards/pandora/pandora.c b/keyboards/pearlboards/pandora/pandora.c index 78368e9687..5ce5d22b06 100644 --- a/keyboards/pearlboards/pandora/pandora.c +++ b/keyboards/pearlboards/pandora/pandora.c @@ -15,3 +15,28 @@ */ #include "pandora.h" + +// Encoder rotate function +bool encoder_update_user(uint8_t index, bool clockwise) { + /* First encoder */ + if (index == 0) { + if (clockwise) { + tap_code(KC_AUDIO_VOL_UP); + } else { + tap_code(KC_AUDIO_VOL_DOWN); + } + } + return true; +} +// Encoder click function +bool dip_switch_update_user(uint8_t index, bool active) { + switch (index) { + /* First encoder */ + case 0: + if (active) { + tap_code(KC_MEDIA_PLAY_PAUSE); + } + break; + } + return true; +} -- cgit v1.2.3