Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atlantis ak81_ve encoder behaviour enhancement & fixes #16503

Merged
merged 3 commits into from
Mar 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions keyboards/atlantis/ak81_ve/ak81_ve.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ led_config_t g_led_config = { {
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8,
4, 4, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
4, 4, 4, 1, 1, 4, 1, 1, 1,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
} };
#endif
Expand All @@ -52,9 +52,30 @@ bool encoder_update_kb(uint8_t index, bool clockwise) {
return false;
}
if (clockwise) {
tap_code(KC_VOLD);
} else {
tap_code(KC_VOLU);
switch (get_highest_layer(layer_state)) {
case 0:
tap_code(KC_VOLU);
break;
case 1:
rgb_matrix_step();
break;
default:
tap_code(KC_VOLU);
break;
}
}
else {
switch (get_highest_layer(layer_state)) {
case 0:
tap_code(KC_VOLD);
break;
case 1:
rgb_matrix_step_reverse();
break;
default:
tap_code(KC_VOLD);
break;
}
}
return true;
}
Expand Down
1 change: 0 additions & 1 deletion keyboards/atlantis/ak81_ve/ak81_ve.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#pragma once
#include "quantum.h"
#include "encoder_actions.h"

#define LAYOUT( \
K000, K001, K002, K003, K004, K005, K006, K007, K008, K010, K011, K012, K013, K014, \
Expand Down
8 changes: 4 additions & 4 deletions keyboards/atlantis/ak81_ve/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
#define UNUSED_PINS

/* Encoder pins */
#define ENCODERS_PAD_A { B0 }
#define ENCODERS_PAD_B { E6 }
#define ENCODERS_PAD_A { E6 }
#define ENCODERS_PAD_B { B0 }
#define ENCODER_RESOLUTION 4
#define ENCODERS 1
#define ENCODERS_CCW_KEY { { 3, 5 } } // Note: array is { col, row )
#define ENCODERS_CW_KEY { { 4, 5 } } // Note: array is { col, row )
#define ENCODERS_CCW_KEY { { 4, 5 } } // Note: array is { col, row )
#define ENCODERS_CW_KEY { { 3, 5 } } // Note: array is { col, row )

/* LED pins */
#define LED_CAPS_LOCK_PIN D4
Expand Down