Controlling Pixl menu with D1,D2,D3 ... instead of BTN1,2,3 ... ? #4129
Replies: 1 comment
-
Posted at 2023-01-23 by @gfwilliams Hi! The code for the Pixl's menu implementation is at https://github.com/espruino/Espruino/blob/master/libs/js/pixljs/E_showMenu.js It does exactly as you have above:
So really I'd have thought you could just do:
Immediately after calling One other option is to just overwrite the Pixl's default showMenu implementation:
And now every time edit: also, just moving this to the Pixl.js section of the forum Posted at 2023-01-26 by rchateauneu Thanks for your answer. However, if I use BTN2, and do not clearWatch BTN1,3,4 , it works fine. Therefore, I "overwrote the Pixl's default showMenu implementation", and it worked perfectly. So, I suspect some sort of conflict when changing a watch once the menu is created. Like: Anyway, it works fine now, so thanks again. Posted at 2023-01-27 by @gfwilliams Ahh, thanks! Yes, I think maybe when you go to edit a menu item and then come back, maybe there ends up being a different copy of Anyway, I'm glad that fixed it for you! Overwriting |
Beta Was this translation helpful? Give feedback.
-
Posted at 2023-01-22 by rchateauneu
I have created a menu on a Pixl, and this is normally controlled with the small buttons on the card.
I would like, instead, to control this menu with external buttons connected to D1 ... D4.
To understand what the internal events handlers of the menu really do, I tried to replace the setWatch calls by the suggestions of the link Graphical Menu:
It works for a simple menu, but not for editing the value of a number, for example.
So the questions are:
Many thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions