Update default Planck layout to be more in line with standard conventions
authorDrashna Jaelre <drashna@live.com>
Sat, 6 Oct 2018 14:57:55 +0000 (07:57 -0700)
committerJack Humbert <jack.humb@gmail.com>
Tue, 9 Oct 2018 19:21:37 +0000 (15:21 -0400)
keyboards/planck/keymaps/default/config.h
keyboards/planck/keymaps/default/keymap.c

index fbd2fdb27203a0173868424b918a2397e3c5f396..6fa31cc8a76f0017f5a7cbe5541ba14a3fa156f7 100644 (file)
@@ -1,7 +1,4 @@
-#ifndef CONFIG_USER_H
-#define CONFIG_USER_H
-
-#include "config_common.h"
+#pragma once
 
 #ifdef AUDIO_ENABLE
     #define STARTUP_SONG SONG(PLANCK_SOUND)
@@ -40,4 +37,3 @@
 // Most tactile encoders have detents every 4 stages
 #define ENCODER_RESOLUTION 4
 
-#endif
index cffa5a5df5156e658ccc7c060815b8eeafd1aff2..0b787cd122c6dd6ebfe5876ab3fb28aa3e5e96a8 100644 (file)
@@ -14,8 +14,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "planck.h"
-#include "action_layer.h"
+#include QMK_KEYBOARD_H
 #include "muse.h"
 
 extern keymap_config_t keymap_config;
@@ -276,11 +275,21 @@ void encoder_update(bool clockwise) {
     }
   } else {
     if (clockwise) {
-      register_code(KC_PGDN);
-      unregister_code(KC_PGDN);
+      #ifdef MOUSEKEY_ENABLE
+        register_code(KC_MS_WH_DOWN);
+        unregister_code(KC_MS_WH_DOWN);
+      #else
+        register_code(KC_PGDN);
+        unregister_code(KC_PGDN);
+      #endif
     } else {
-      register_code(KC_PGUP);
-      unregister_code(KC_PGUP);
+      #ifdef MOUSEKEY_ENABLE
+        register_code(KC_MS_WH_UP);
+        unregister_code(KC_MS_WH_UP);
+      #else
+        register_code(KC_PGUP);
+        unregister_code(KC_PGUP);
+      #endif
     }
   }
 }