microsoft / microsoft/pxt-microbit
on touched, on released, unexpected behaviour
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 804
- Forks
- 721
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 2
Description
Describe the bug
Using on touched and on released doesn't seem to operate with simple behaviour, as I would expect.
To Reproduce
Use this code for a dead-man's-handle (train driver) in the makecode simulator

Expected behaviour
I expect when I touch P0 to see a smiley to let me know the train is safe to drive, and when I release my touch on P0 it scrolls 'STOP THE TRAIN'
Desktop (please complete the following information):
Mac OSX 10.10.5 Google Chrome
Additional context
I am porting some simple scripts from Touch Develop in to makecode for one of our content partners. This was a lovely and simple example in Touch Develop, but it seems really hard to get it to work reliably in MakeCode.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the P0 touch/release example in the MakeCode simulator described in the issue, using the screenshot as the available reproduction. Compare the observed event behavior with the expected smiley-on-touch and “STOP THE TRAIN” on-release sequence; done means those transitions are reliable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100