-
Notifications
You must be signed in to change notification settings - Fork 592
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
simulator and micro:bit have different behaviour for button press event when holding button #2653
Comments
Nope - we'll be generating all the events (the simple events mode is really to supress the generation of more advanced events (click etc) which we're using MultiButton A+B etc. If the cause for this is the LONG_CLICK (and well could be - good thinking @jaustin), then also subscribing to that event might be the easiest way forward... Alternatively, LONG_CLICK is a very rarely used feature that we could consider dropping / making a compile time option. |
Seems like the simulator only checks mouse-up. |
Thanks @HelenFoster Looks like the binding to the hardware is looking for a CLICK event though: You could consider binding to the UP even there also (MICROBIT_BUTTON_EVT_UP) ? Joe |
...or expose a richer set of button events into MakeCode. ;-) |
I added DOWN and UP to the Control blocks in microsoft/pxt-microbit#468 . Didn't think it was such a good idea to add LONG_CLICK and HOLD, as that drop-down menu is getting too long now. As you say, |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi all,
On the real micro:bit, press-->hold-->release of a button does not register as a 'press' however on the simulator it appears that it does:
https://makecode.microbit.org/_eKuYe6YbzR47
This program behaves differently on the micro:bit to in the simulator when you press and hold the A button. It works fine just clicking the button.
The DAL has two kinds of event, long and short click, and I suspect we're hitting the long click
https://github.com/lancaster-university/microbit-dal/blob/9adafccbf6af5adaade378a4577802f0b47a153a/source/drivers/MicroBitButton.cpp#L123
Do we configure the buttons to use simple events?
https://github.com/lancaster-university/microbit-dal/blob/9adafccbf6af5adaade378a4577802f0b47a153a/source/drivers/MicroBitButton.cpp#L39
@finneyj may be one for you?
The text was updated successfully, but these errors were encountered: