summaryrefslogtreecommitdiff
path: root/keyboards/mechlovin/adelais/keymaps
diff options
context:
space:
mode:
authormechlovin <57231893+mechlovin@users.noreply.github.com>2020-06-29 15:19:09 +0700
committerGitHub <noreply@github.com>2020-06-29 01:19:09 -0700
commite9e6054ee7eaca4cbd8d1c7566f394559ea8770a (patch)
tree36218fbceaa591cb58e30dfa3d468f001ace120a /keyboards/mechlovin/adelais/keymaps
parent4e4a3449a731bce9f6893d18d884af365d0df407 (diff)
[Keyboard] Refactor: add adelais rev.3 (#9496)
* Refactor: add adelais rev.3 * update * Update keymap.c * update * update * update
Diffstat (limited to 'keyboards/mechlovin/adelais/keymaps')
-rw-r--r--keyboards/mechlovin/adelais/keymaps/default/keymap.c29
-rw-r--r--keyboards/mechlovin/adelais/keymaps/via/keymap.c29
2 files changed, 56 insertions, 2 deletions
diff --git a/keyboards/mechlovin/adelais/keymaps/default/keymap.c b/keyboards/mechlovin/adelais/keymaps/default/keymap.c
index 7848a5709b..19c298d4a4 100644
--- a/keyboards/mechlovin/adelais/keymaps/default/keymap.c
+++ b/keyboards/mechlovin/adelais/keymaps/default/keymap.c
@@ -29,4 +29,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ),
-}; \ No newline at end of file
+};
+
+#ifdef ENCODER_ENABLE
+void encoder_update_user(uint8_t index, bool clockwise) {
+ if (index == 0) {
+ if (clockwise) {
+ tap_code(KC_VOLU);
+ } else {
+ tap_code(KC_VOLD);
+ }
+ }
+ else if (index == 1) {
+ if (clockwise) {
+ tap_code(KC_LEFT);
+ } else {
+ tap_code(KC_RGHT);
+ }
+ }
+ else if (index == 2) {
+ if (clockwise) {
+ tap_code(KC_UP);
+ } else {
+ tap_code(KC_DOWN);
+ }
+ }
+}
+
+ #endif \ No newline at end of file
diff --git a/keyboards/mechlovin/adelais/keymaps/via/keymap.c b/keyboards/mechlovin/adelais/keymaps/via/keymap.c
index 03636d02b3..d44a4e9382 100644
--- a/keyboards/mechlovin/adelais/keymaps/via/keymap.c
+++ b/keyboards/mechlovin/adelais/keymaps/via/keymap.c
@@ -41,4 +41,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ),
-}; \ No newline at end of file
+};
+
+#ifdef ENCODER_ENABLE
+void encoder_update_user(uint8_t index, bool clockwise) {
+ if (index == 0) {
+ if (clockwise) {
+ tap_code(KC_VOLU);
+ } else {
+ tap_code(KC_VOLD);
+ }
+ }
+ else if (index == 1) {
+ if (clockwise) {
+ tap_code(KC_LEFT);
+ } else {
+ tap_code(KC_RGHT);
+ }
+ }
+ else if (index == 2) {
+ if (clockwise) {
+ tap_code(KC_UP);
+ } else {
+ tap_code(KC_DOWN);
+ }
+ }
+}
+
+ #endif \ No newline at end of file