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

Option to reverse the click-wheel direction in menus #3114

Merged
merged 4 commits into from
Mar 18, 2016

Conversation

thinkyhead
Copy link
Member

In answer to #1720. Add an option to reverse the menu navigation direction using the click-wheel.

Currently in Marlin: When navigating menus on the LCD you rotate clockwise to move the menu highlight down and counter-clockwise to move the menu highlight up.

Background: Some users have noted that if the click wheel is located to the right of the screen, the edge of the wheel next to the screen will be moving in the opposite direction from the menu navigation. Previously it has been suggested to simply change the pin numbers so that the wheel is reversed, but this results in problems with editing values. So we needed a way to be able to turn this behavior on and off, or to have the menus interpret the wheel direction in a different way from other code.

Investigation: We quickly uncover that there is a single place in the code where wheel pulses are turned into changes in the encoder value, and functions can pre-set the encoder value to whatever they want before reading changes to it. Menu functions, for example, use the current encoder value to decide what to highlight and when to scroll.

The Solution: 1. Add the ability to reverse the direction of the wheel at the lowest level. 2. Reverse the direction in most instances – whenever START_MENU is applied. Set it forward for the editing of values, status screen, and any other non-menu contexts.

See also MarlinFirmware/MarlinDev#384

@thinkyhead thinkyhead changed the title Fix a bug in menu_edit_type that lost place in the menu Option to reverse the click-wheel direction in menus Mar 9, 2016
@@ -1381,7 +1429,7 @@ static void lcd_control_volumetric_menu() {
lcd_implementation_drawedit(editLabel, _strFunc(((_type)((int32_t)encoderPosition + minEditValue)) / scale)); \
if (isClicked) { \
*((_type*)editValue) = ((_type)((int32_t)encoderPosition + minEditValue)) / scale; \
lcd_goto_menu(prevMenu, prevEncoderPosition); \
lcd_goto_menu(prevMenu, false, prevEncoderPosition); \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After editing return to the selected line in the menu.

@thinkyhead thinkyhead force-pushed the rc_reverse_lcd_menu branch 3 times, most recently from 824ea6a to d3cdb01 Compare March 9, 2016 12:02
@AnHardt
Copy link
Member

AnHardt commented Mar 9, 2016

Wow! Congratulations.

@thinkyhead
Copy link
Member Author

Only 1394 issues ago? That's what I call turnaround.

thinkyhead added a commit that referenced this pull request Mar 18, 2016
Option to reverse the click-wheel direction in menus
@thinkyhead thinkyhead merged commit d56c6af into MarlinFirmware:RCBugFix Mar 18, 2016
thinkyhead added a commit that referenced this pull request Mar 19, 2016
@thinkyhead thinkyhead deleted the rc_reverse_lcd_menu branch March 24, 2016 07:42
@jbrazio jbrazio modified the milestone: 1.1.0 Jul 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants