Discuss Scratch
- Discussion Forums
- » Suggestions
- » Mouse/Key Press Emulation Blocks
- starlightsparker
-
1000+ posts
Mouse/Key Press Emulation Blocks
as a mobile user, support. I’ve always wanted to test pc games but can’t, so with this it’s easier to test pc games on mobile
Last edited by starlightsparker (March 9, 2024 17:02:55)
- DangerPuppy10
-
1000+ posts
Mouse/Key Press Emulation Blocks
I mean, this would be very confusing. I still don't quite understand this.
Ok, so; this would simulate a button being pressed. And this would also simulate a mouse being at a certain point. But, I'm still confused. Why would we need this?
Ok, so; this would simulate a button being pressed. And this would also simulate a mouse being at a certain point. But, I'm still confused. Why would we need this?
- starlightsparker
-
1000+ posts
Mouse/Key Press Emulation Blocks
mobile testing on pc games maybe I mean, this would be very confusing. I still don't quite understand this.
Ok, so; this would simulate a button being pressed. And this would also simulate a mouse being at a certain point. But, I'm still confused. Why would we need this?
- han614698
-
1000+ posts
Mouse/Key Press Emulation Blocks
bump
Last edited by han614698 (May 18, 2024 17:12:42)
- doggy_boi1
-
1000+ posts
Mouse/Key Press Emulation Blocks
Im not reading through 8 pages of discussion, so i probably missed something but, why not just click at xy yourself or press the arrow key? And for mobile support, why not just use broadcasts?
- han614698
-
1000+ posts
Mouse/Key Press Emulation Blocks
(#149)It's mainly for testing. The clicking was the sub-suggestion, the main one was emulating key presses for mobile devices - saves a lot of time with broadcasts, specifically for platformers.
Im not reading through 8 pages of discussion, so i probably missed something but, why not just click at xy yourself or press the arrow key? And for mobile support, why not just use broadcasts?
- doggy_boi1
-
1000+ posts
Mouse/Key Press Emulation Blocks
fair(#149)It's mainly for testing. The clicking was the sub-suggestion, the main one was emulating key presses for mobile devices - saves a lot of time with broadcasts, specifically for platformers.
Im not reading through 8 pages of discussion, so i probably missed something but, why not just click at xy yourself or press the arrow key? And for mobile support, why not just use broadcasts?
- han614698
-
1000+ posts
Mouse/Key Press Emulation Blocks
bump now i can have real scratchblocks in the OP
- cake__5
-
100+ posts
Mouse/Key Press Emulation Blocks
i have workaround!
create sprite called “mouse-pointer-emulated” with a costume that looks like cursor
replace top with bottom:
create sprite called “mouse-pointer-emulated” with a costume that looks like cursor
replace top with bottom:
<mouse down?>replace top with bottom:
<(mouse down) = [1]>
<touching [mouse-pointer v] ?>replace top with bottom:
<touching [mouse-pointer-emulated v] ?>
point in direction/go to/glide (1) secs to [mouse-pointer v]::motionreplace top with bottom:
point in direction/go to/glide (1) secs to [mouse-pointer-emulated v]::motion
mouse x/y::sensing reporterreplace top with bottom (bottom is in mouse-pointer-emulated):
([x/y v] of [mouse-pointer-emulated v])
move mouse pointer to x: (x) y: (y)::#0080ffreplace top with bottom (bottom is in mouse-pointer-emulated):
go to x: (x) y: (y)
click::#0080ff
click::my blocks
define click
set [mouse down v] to [1]
wait (0) secs
set [mouse down v] to [0]
- BigNate469
-
1000+ posts
Mouse/Key Press Emulation Blocks
But that's a lot of work, especially in larger projects where it may not be immediately obvious where the key sensing blocks are. big snip
I agree, this would be useful for testing (and playing) projects on mobile devices, as well as porting projects to mobile devices as you can simply emulate a keypress rather than find every instance of a key sensing block or hat block and replace it with messages and variables.
- cake__5
-
100+ posts
Mouse/Key Press Emulation Blocks
its called editing the json file :)But that's a lot of work, especially in larger projects where it may not be immediately obvious where the key sensing blocks are. big snip
I agree, this would be useful for testing (and playing) projects on mobile devices, as well as porting projects to mobile devices as you can simply emulate a keypress rather than find every instance of a key sensing block or hat block and replace it with messages and variables.
- BigNate469
-
1000+ posts
Mouse/Key Press Emulation Blocks
Editing the .json file would probably take more time than just going through the editor and manually replacing things, because there's actually a lot of data that you have to fill in (correctly) per block.its called editing the json file :)But that's a lot of work, especially in larger projects where it may not be immediately obvious where the key sensing blocks are. big snip
I agree, this would be useful for testing (and playing) projects on mobile devices, as well as porting projects to mobile devices as you can simply emulate a keypress rather than find every instance of a key sensing block or hat block and replace it with messages and variables.
- --ORI0N--
-
100+ posts
Mouse/Key Press Emulation Blocks
Mobile support could be so much easier, and so would custom keybinds with these blocks.
I'd love to see these implemented.
I'd love to see these implemented.
- Discussion Forums
- » Suggestions
-
» Mouse/Key Press Emulation Blocks