Discuss Scratch
- Discussion Forums
- » Suggestions
- » Mouse/Key Press Emulation Blocks
- han614698
-
1000+ posts
Mouse/Key Press Emulation Blocks
The blocks I'm suggesting are:
I'm also suggesting this block:
These blocks, specifically the first few, would make testing easier and would be easy to activate code while a game is playing WITHOUT having to deal with broadcasting.
The other dropdowns would be the other keys. Also, note that the dropdown is OVAL instead of rectangular, for putting in join blocks to make enter, /, <, >, etc. keys.
emulate (space v) key press and wait::eventsWhen those blocks is clicked (or hit in the code), it will trigger all of the “key pressed” blocks of a certain key.
emulate (space v) key press::events
I'm also suggesting this block:
emulate cursor click at x: () y: ()::eventsThis would do exactly what it says - simulate a mouse click in a set position.
These blocks, specifically the first few, would make testing easier and would be easy to activate code while a game is playing WITHOUT having to deal with broadcasting.
The other dropdowns would be the other keys. Also, note that the dropdown is OVAL instead of rectangular, for putting in join blocks to make enter, /, <, >, etc. keys.
Last edited by han614698 (Nov. 8, 2024 02:58:13)
- han614698
-
1000+ posts
Mouse/Key Press Emulation Blocks
removed
Last edited by han614698 (Sept. 22, 2021 23:19:46)
- -EmeraldThunder-
-
1000+ posts
Mouse/Key Press Emulation Blocks
I support. This would be good for testing without having to edit large amounts of code.
If it is implemented however I recommend you change the text to.
Trigger event key (space v) press
If it is implemented however I recommend you change the text to.
Trigger event key (space v) press
- han614698
-
1000+ posts
Mouse/Key Press Emulation Blocks
Sure, thanks. I support. This would be good for testing without having to edit large amounts of code.
If it is implemented however I recommend you change the text to.
Trigger event key (space v) press
- -EmeraldThunder-
-
1000+ posts
Mouse/Key Press Emulation Blocks
Please tell us why you support. Support!
- Maximouse
-
1000+ posts
Mouse/Key Press Emulation Blocks
An even better name might be I support. This would be good for testing without having to edit large amounts of code.
If it is implemented however I recommend you change the text to.
Trigger event key (space v) press
simulate (space v) key press :: control
I think it should press the key for one frame, so “key pressed?” blocks that run in the next frame would return true. There could also be blocks blocks that press and release the key:
simulate (space v) key press start :: control
simulate (space v) key press end :: control
- han614698
-
1000+ posts
Mouse/Key Press Emulation Blocks
What category do you suggest? I was thinking about events, but you're saying control.An even better name might be I support. This would be good for testing without having to edit large amounts of code.
If it is implemented however I recommend you change the text to.
Trigger event key (space v) presssimulate (space v) key press :: control
I think it should press the key for one frame, so “key pressed?” blocks that run in the next frame would return true. There could also be blocks blocks that press and release the key:simulate (space v) key press start :: control
simulate (space v) key press end :: control
Also, what do you think of the hat block?
- scratchastroLOL
-
1000+ posts
Mouse/Key Press Emulation Blocks
so what about
Trigger event key (space v) press and wait :: events
- han614698
-
1000+ posts
Mouse/Key Press Emulation Blocks
Compromises; great idea! so what aboutTrigger event key (space v) press and wait :: events
- Chiroyce
-
1000+ posts
Mouse/Key Press Emulation Blocks
An even better name might be
key down (space v) key press :: control
key up (space v) key press :: control
press key (space v) for () seconds :: control
- han614698
-
1000+ posts
Mouse/Key Press Emulation Blocks
Maybe, but you might want to add a simulate in there like so: An even better name might bekey down (space v) key press :: control
key up (space v) key press :: control
press key (space v) for () seconds :: control
simulate key down (space v) key press :: controlThese are getting a bit long, though, but that's another suggestion. (To make it so you can scroll either way on the blocks palette).
simulate key up (space v) key press :: control
simulate press key (space v) for () seconds :: control
- 1Oaktree2
-
1000+ posts
Mouse/Key Press Emulation Blocks
Cool idea for testing, especially if the key isn't working, or you want to make a mobile version
Then again:
Then again:
when [..v] key pressed
Simulate [.. v]
Last edited by 1Oaktree2 (March 3, 2021 14:54:24)
- the2000
-
1000+ posts
Mouse/Key Press Emulation Blocks
You can do that with broadcasts already. Then again:when [..v] key pressed
Simulate [.. v]
- han614698
-
1000+ posts
Mouse/Key Press Emulation Blocks
Last edited by han614698 (April 1, 2022 11:28:36)
- the2000
-
1000+ posts
Mouse/Key Press Emulation Blocks
I have the right to remain with my stance on the suggestion unstated.the2000, do you support or not. What are your ideas, especially about the hat block. You can do that with broadcasts already.
Anyway, this would be useful, but I'm not sure if it would belong in the main palette. Since there already is an extension with only two blocks (Translate IIRC) I don't think that it would be too out of place to make this an extension. Or they could just be hidden blocks, IDK. This could make an easy way to create mobile controls, which would be nice.
- han614698
-
1000+ posts
Mouse/Key Press Emulation Blocks
Ok, thanks. Do you like the hat block?I have the right to remain with my stance on the suggestion unstated.the2000, do you support or not. What are your ideas, especially about the hat block. You can do that with broadcasts already.
Anyway, this would be useful, but I'm not sure if it would belong in the main palette. Since there already is an extension with only two blocks (Translate IIRC) I don't think that it would be too out of place to make this an extension. Or they could just be hidden blocks, IDK. This could make an easy way to create mobile controls, which would be nice.
- Chiroyce
-
1000+ posts
Mouse/Key Press Emulation Blocks
Can you change the title to
“Key press emulation blocks” or something more technically understandable ?
“Key press emulation blocks” or something more technically understandable ?
- the2000
-
1000+ posts
Mouse/Key Press Emulation Blocks
Seems like it would sorta ruin the point to differentiate between real and simulated inputs? You could just use broadcasts for every purpose that the hat would come in handy for. I'm not sure why it's a rounded drop-down, either.Ok, thanks. Do you like the hat block? Anyway, this would be useful, but I'm not sure if it would belong in the main palette. Since there already is an extension with only two blocks (Translate IIRC) I don't think that it would be too out of place to make this an extension. Or they could just be hidden blocks, IDK. This could make an easy way to create mobile controls, which would be nice.
- han614698
-
1000+ posts
Mouse/Key Press Emulation Blocks
Last edited by han614698 (April 1, 2022 11:29:06)
- Discussion Forums
- » Suggestions
-
» Mouse/Key Press Emulation Blocks