summaryrefslogtreecommitdiff
path: root/keyboards/linworks/whale75/whale75.c
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2021-08-19 17:14:07 +0000
committerQMK Bot <hello@qmk.fm>2021-08-19 17:14:07 +0000
commitaf3673a5b6985f4364210c3656f323624c2e1962 (patch)
tree99c1d69f2793cbb33e694234b1d427c2260e8f96 /keyboards/linworks/whale75/whale75.c
parenta85126b79ec4a21b0a162cfe5afc28d48eee4774 (diff)
parent48a8682438d5708636c3260adfb6a75ac89ed05a (diff)
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'keyboards/linworks/whale75/whale75.c')
-rw-r--r--keyboards/linworks/whale75/whale75.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/keyboards/linworks/whale75/whale75.c b/keyboards/linworks/whale75/whale75.c
index 4bce30adf3..ef86e0268a 100644
--- a/keyboards/linworks/whale75/whale75.c
+++ b/keyboards/linworks/whale75/whale75.c
@@ -14,3 +14,29 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "whale75.h"
+
+#if defined(ENCODER_ENABLE)
+bool encoder_update_kb(uint8_t index, bool clockwise) {
+ if (!encoder_update_user(index, clockwise)) { return false; }
+ if (index == 0) {
+ /* The switch case allows for different encoder mappings on different layers, "default" map gets applied for all unspecified layers */
+ switch(get_highest_layer(layer_state)){
+ case 1:
+ if (clockwise) {
+ tap_code(KC_MNXT);
+ } else {
+ tap_code(KC_MPRV);
+ }
+ break;
+ default:
+ if (clockwise){
+ tap_code(KC_VOLU);
+ } else{
+ tap_code(KC_VOLD);
+ }
+ break;
+ }
+ }
+ return true;
+}
+#endif