Skip to content

Commit

Permalink
keyboard: turn around key selection
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank0587 committed Jan 30, 2022
1 parent 38e836d commit 94eee50
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Marlin/src/lcd/e3v2/jyersui/dwin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5008,13 +5008,15 @@ void CrealityDWINClass::Keyboard_Control() {
}
EncoderState encoder_diffState = Encoder_ReceiveAnalyze();
if (encoder_diffState == ENCODER_DIFF_NO) return;
if (encoder_diffState == ENCODER_DIFF_CW && key_selection < keyboard_size) {
if (encoder_diffState == ENCODER_DIFF_CW) {
Draw_Keys(key_selection, false, uppercase, locked);
key_selection++;
if (key_selection > keyboard_size) key_selection = 0;
Draw_Keys(key_selection, true, uppercase, locked);
}
else if (encoder_diffState == ENCODER_DIFF_CCW && key_selection > 0) {
else if (encoder_diffState == ENCODER_DIFF_CCW) {
Draw_Keys(key_selection, false, uppercase, locked);
if (key_selection == 0) key_selection = keyboard_size+1;
key_selection--;
Draw_Keys(key_selection, true, uppercase, locked);
}
Expand Down

0 comments on commit 94eee50

Please sign in to comment.