@@ -58,16 +58,18 @@ void MenuTouchScreenManager::sendEvent(float locationX, float locationY, float t
5858}
5959
6060void MenuTouchScreenEncoder::touched (const TouchNotification &evt) {
61- serlogF4 (SER_TCMENU_DEBUG, " Touch at (x,y,mode)" , evt.getCursorPosition ().x , evt.getCursorPosition ().y , evt.isWithinItem ())
6261 if (evt.isWithinItem ()) {
6362 MenuItem *theItem = evt.getEntry ()->getMenuItem ();
63+ serlogF4 (SER_TCMENU_DEBUG, " Item Touched (x,y,item)" , evt.getCursorPosition ().x , evt.getCursorPosition ().y , theItem->getId ());
64+
6465 if (menuMgr.getCurrentEditor () && theItem != menuMgr.getCurrentEditor ()) {
6566 // stop editing, selected outside of item
6667 menuMgr.stopEditingCurrentItem (false );
6768 }
6869 else {
6970 bool wasActive = renderer->getActiveItem () == theItem;
7071 if (!wasActive) {
72+ serlogF (SER_TCMENU_DEBUG, " Activating item" );
7173 // if it's not active try and activate, if it fails we can't continue.
7274 uint8_t itemIdx = renderer->setActiveItem (theItem);
7375 if (switches.getEncoder ()) {
@@ -92,9 +94,11 @@ void MenuTouchScreenEncoder::touched(const TouchNotification &evt) {
9294 }
9395 }
9496 else if (isTouchActionable (theItem) && !held) {
97+ serlogF (SER_TCMENU_DEBUG, " Touch Act" );
9598 menuMgr.onMenuSelect (false );
9699 }
97100 else if (isMenuRuntimeMultiEdit (theItem) && !theItem->isReadOnly ()) {
101+ serlogF (SER_TCMENU_DEBUG, " TMPart" );
98102 auto * dlg = renderer->getDialog ();
99103 if (dlg && !dlg->isInUse ()) {
100104 auto * menuDlg = reinterpret_cast <MenuBasedDialog*>(dlg);
@@ -105,6 +109,7 @@ void MenuTouchScreenEncoder::touched(const TouchNotification &evt) {
105109 else if (!theItem->isReadOnly ()){
106110 GridPosition::GridDrawingMode drawingMode = evt.getEntry ()->getPosition ().getDrawingMode ();
107111 if (drawingMode == GridPosition::DRAW_INTEGER_AS_UP_DOWN && wasActive) {
112+ serlogF (SER_TCMENU_DEBUG, " TUpDown" );
108113 if (menuMgr.getCurrentEditor () != theItem) menuMgr.onMenuSelect (false );
109114 int increment = 0 ;
110115 auto xPos = evt.getCursorPosition ().x ;
@@ -127,21 +132,27 @@ void MenuTouchScreenEncoder::touched(const TouchNotification &evt) {
127132 }
128133 }
129134 else if (drawingMode == GridPosition::DRAW_INTEGER_AS_SCROLL && wasActive) {
135+ serlogF (SER_TCMENU_DEBUG, " TScroll" );
130136 if (menuMgr.getCurrentEditor () != theItem) menuMgr.onMenuSelect (false );
131137 auto * analog = reinterpret_cast <AnalogMenuItem*>(theItem);
132138 float correction = float (analog->getMaximumValue ()) / float (evt.getItemSize ().x );
133139 float percentage = evt.getCursorPosition ().x * correction;
134140 analog->setCurrentValue (percentage);
135141 }
142+ else {
143+ serlogF (SER_TCMENU_DEBUG, " Touch Ignored" );
144+ }
136145 }
137146 }
138147 }
139148 else if (menuMgr.getCurrentEditor ()) {
140149 // touched outside of the item, stop editing.
141150 menuMgr.stopEditingCurrentItem (false );
151+ serlogF (SER_TCMENU_DEBUG, " TEndEdit" );
142152 }
143153 else {
144154 // deal with click completely outside of item area
155+ serlogF3 (SER_TCMENU_DEBUG, " TOut (x,y)" , evt.getCursorPosition ().x , evt.getCursorPosition ().y );
145156 }
146157}
147158
0 commit comments