-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
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
Allow TOUCH_BUTTONS to be swapped #15100
Allow TOUCH_BUTTONS to be swapped #15100
Conversation
Marlin/src/lcd/dogm/u8g_dev_tft_320x240_upscale_from_128x64.cpp
Outdated
Show resolved
Hide resolved
4758db6
to
2aef83d
Compare
I prefer narratives over proses. |
fbddcbc
to
30372c7
Compare
a44cb4e
to
7e85a68
Compare
7e85a68
to
a3a2d94
Compare
#endif | ||
if (touch_arrows) { | ||
next_button_update_ms = ms + 50; // Set delay for repeat | ||
encoderDiff = (ENCODER_STEPS_PER_MENU_ITEM) * (ENCODER_PULSES_PER_STEP) * encoderDirection; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This value should be different when navigating a menu versus when editing a value. But perhaps on the touch display the "pulses per step" is always set to 1…?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm… By default the ENCODER_PULSES_PER_STEP
falls back to 5. If the TOUCH_BUTTONS
are the only encoder, then this can be set to 1 to slightly simplify the code. Is it possible for TOUCH_BUTTONS
to exist alongside a regular click-wheel encoder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thinkyhead , I propose this code. The reason is to prepare full area touchscreen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A full touch-screen is going to need an entirely different approach and won't go through this "button" nonsense. Sorry about trouncing BTN_D
. An oversight.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At present the vertical touch coordinate alone isn't going to very useful since we have a variety of screen layouts in Marlin. Every single screen layout type will need to have its own method to interpret touches and pass them on to the correct handlers. In cases where we only have a touch screen and no other buttons, we don't need to have up/down buttons on the screen unless something will actually be moved up/down. For menus, it will be better to have square buttons instead of textual menu items where possible, and textual menu items will need to be spaced apart more so that touches are less likely to invoke the wrong item. It will be better to write a new handler for these events rather than keep hacking everything on top of the rotary encoder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, i had the "slider" picture in my head, the component name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://youtu.be/ClhTLofXOnA Check this out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very good yep, but as i said before, this is not the upscale dogm anymore...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the bare-bones text in a simple line-box for the menu items. Color-coding by type is also cool, where yellow might mean "editable," and so on. If there were more buttons than could fit on the screen, it would get a pager, I suppose. But the nice thing about such a bare-bones approach is that it may encourage people to want to make it more interesting. But can it do all the languages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://youtu.be/ClhTLofXOnA Check this out.
Hi Can you provide the config files for MKS robin TFT
I've simplified the code so it passes the |
913f9d1
to
ee4b53c
Compare
I think return Value from touch.read_button should be coordinate only, to make the code universal for all type of display mode. then we make a function in MarlinUI that determine what button is touched in that position. |
try to git diff tpruvot/master Marlin/src/feature/touch/ I had to add this function for the calibration "app", basically :
|
Else, just tested the PR as one commit, and the behavior is fully reversed.. Menus are reversed and buttons - + do the opposite as what they should do... for values To be short: cant be worst misconfigured, reversed arrows position and also -/+ |
Its working on my MKS Robin mini. But the code is a mesh now. @tpruvot , can you message me on discord ? |
if i (only) set REVERSE_ENCODER_DIRECTION, arrows are ok, but values editing are reversed. Also, im not sure its related, but the ok/menu button often go down now... i need more tests without the commit and/or double check the default X calibration.. |
Fix required to set "minus" negative by default, fix both cases.. but remains the OK problem, only the OK seems to have EN_B position conflict on the touchscreen
|
@tpruvot, change
Have same effect with REVERSE_ENCODER_DIRECTION, cause it just switch between EN_A and EN_B our LCD touch work with REVERSE_ENCODER_DIRECTION enabled (=marlin default) I test, the code is ok now. Except you need to switch from |
i dont want a + on the left, its fully illogic |
The new changes in Marlin make the touchscreen erratic. Keep the "inverted" arrows for REVERSE_MENU_DIRECTION Partially reverts/fix commit 6b05d5d. - STD_ENCODER_PULSES_PER_STEP 1 make weird menu "rollback" on "untouch" - touch_buttons variable seems required to avoid bad points for now..
The new changes in Marlin make the touchscreen erratic. Keep the "inverted" arrows for REVERSE_MENU_DIRECTION Partially reverts/fix commit 6b05d5d. - STD_ENCODER_PULSES_PER_STEP 1 make weird menu "rollback" on "untouch" - touch_buttons variable seems required to avoid bad points for now.. + handle arrows in priority may avoid some bad clicks, but doesnt really change things..
The new changes in Marlin make the touchscreen erratic. Keep the "inverted" arrows for REVERSE_MENU_DIRECTION Partially reverts/fix commit 6b05d5d. - STD_ENCODER_PULSES_PER_STEP 1 make weird menu "rollback" on "untouch" - touch_buttons variable seems required to avoid bad points for now.. + handle arrows in priority may avoid some bad clicks, but doesnt really change things..
For Prusa Model Printer, then
The Toolhead will move UP when EN_B ("+" Button Pressed)
For Hypercube Printer, then
Bed will move DOWN when EN_B ("+" Button Pressed).
Therefore the UP and DOWN sign at touch button can make user confused.
The Solution is to enable REVERSE MENU DIRECTION and change the Button Icon accordingly.
We also need to seperate Encoder Handling that processed at update_buttons(). Therefore the process should be done before processing input from touch screen.