diff options
author | melonbred <61572569+melonbred@users.noreply.github.com> | 2022-04-12 23:36:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-12 23:36:33 -0700 |
commit | f3a49876d50c7fc8d71f9718de9319321d8e94c9 (patch) | |
tree | 914270c91c7fc8e14f3e08c4a20034ae7becac84 /keyboards/pegasus/pegasus.c | |
parent | 9a38ebc65600b42681e86179ab2ffe39dfd9dcdb (diff) |
[Keyboard] add pegasus (#16701)
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'keyboards/pegasus/pegasus.c')
-rw-r--r-- | keyboards/pegasus/pegasus.c | 37 |
1 files changed, 37 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>. + */ + +#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 |