From f3a49876d50c7fc8d71f9718de9319321d8e94c9 Mon Sep 17 00:00:00 2001 From: melonbred <61572569+melonbred@users.noreply.github.com> Date: Tue, 12 Apr 2022 23:36:33 -0700 Subject: [Keyboard] add pegasus (#16701) Co-authored-by: Joel Challis Co-authored-by: Drashna Jaelre Co-authored-by: Ryan --- keyboards/pegasus/pegasus.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 keyboards/pegasus/pegasus.c (limited to 'keyboards/pegasus/pegasus.c') diff --git a/keyboards/pegasus/pegasus.c b/keyboards/pegasus/pegasus.c new file mode 100644 index 0000000000..0800a36f9e --- /dev/null +++ b/keyboards/pegasus/pegasus.c @@ -0,0 +1,37 @@ +/* Copyright 2020 melonbred + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "pegasus.h" + +#ifdef ENCODER_ENABLE +bool encoder_update_kb(uint8_t index, bool clockwise) { + if (!encoder_update_user(index, clockwise)) { return false; } + if (index == 0) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + } else if (index == 1) { + if (clockwise) { + tap_code(KC_PGDN); + } else { + tap_code(KC_PGUP); + } + } + return true; +} +#endif -- cgit v1.2.3