Issue with touch interfacing #4848
Replies: 1 comment
-
Posted at 2022-06-19 by @thyttan I believe you should remove the listener used for selecting mode once you've made the selection, in your example function(n, event). I don't know, but I suspect you might need to break function(n, event) out into a function with it's own name to make it work, maybe
and then your code would be something like
I'm not 100% on these things though - but I think that's basically how it works. This is relevant I think: http://www.espruino.com/Reference#l_Object_removeListener I hope I'm not leading you astray with this :P Posted at 2022-06-19 by pranjal @thyttan It works exactly as I want it to work. Thank you very much, I have been stuck on this for days and it finally works!! Posted at 2022-06-19 by @thyttan Nice! I just recently learned about removing listeners myself - it was something of a revelation. :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-06-19 by pranjal
I wanted to implement touch individually for these features. I posted this on the forum and they suggested I implement it in this manner.
The issue now is that once I am on the working screen, if I click on the middle portion of the touch screen it takes me to the jogging screen. My main issue is that once I choose the walking option, the screen should remain there even if I click at some other part of the screen and do not jump to the jogging and cycling screen.
I have written the function names in the if-else condition in order to make the code a bit more readable for the sake of this doubt.
Thank you in advance.
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions