Discuss Scratch

han614698
Scratcher
1000+ posts

Mouse/Key Press Emulation Blocks

bump
starlightsparker
Scratcher
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
Scratcher
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?
starlightsparker
Scratcher
1000+ posts

Mouse/Key Press Emulation Blocks

DangerPuppy10 wrote:

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?
mobile testing on pc games maybe
han614698
Scratcher
1000+ posts

Mouse/Key Press Emulation Blocks

han614698 wrote:

bump
han614698
Scratcher
1000+ posts

Mouse/Key Press Emulation Blocks

han614698 wrote:

han614698 wrote:

bump
han614698
Scratcher
1000+ posts

Mouse/Key Press Emulation Blocks

han614698 wrote:

han614698 wrote:

han614698 wrote:

bump

Last edited by han614698 (May 18, 2024 17:12:42)

han614698
Scratcher
1000+ posts

Mouse/Key Press Emulation Blocks

han614698 wrote:

(#147)

han614698 wrote:

han614698 wrote:

han614698 wrote:

bump
doggy_boi1
Scratcher
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
Scratcher
1000+ posts

Mouse/Key Press Emulation Blocks

doggy_boi1 wrote:

(#149)
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?
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.
han614698
Scratcher
1000+ posts

Mouse/Key Press Emulation Blocks

bump
doggy_boi1
Scratcher
1000+ posts

Mouse/Key Press Emulation Blocks

han614698 wrote:

doggy_boi1 wrote:

(#149)
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?
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.
fair
han614698
Scratcher
1000+ posts

Mouse/Key Press Emulation Blocks

bump now i can have real scratchblocks in the OP
cake__5
Scratcher
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:
<mouse down?>
<(mouse down) = [1]>
replace top with bottom:
<touching [mouse-pointer v] ?>
<touching [mouse-pointer-emulated v] ?>
replace top with bottom:
point in direction/go to/glide (1) secs to [mouse-pointer v]::motion
point in direction/go to/glide (1) secs to [mouse-pointer-emulated v]::motion
replace top with bottom:
mouse x/y::sensing reporter
([x/y v] of [mouse-pointer-emulated v])
replace top with bottom (bottom is in mouse-pointer-emulated):
move mouse pointer to x: (x) y: (y)::#0080ff
go to x: (x) y: (y)
replace top with bottom (bottom is in mouse-pointer-emulated):
click::#0080ff
click::my blocks
define click
set [mouse down v] to [1]
wait (0) secs
set [mouse down v] to [0]
BigNate469
Scratcher
1000+ posts

Mouse/Key Press Emulation Blocks

cake__5 wrote:

big snip
But that's a lot of work, especially in larger projects where it may not be immediately obvious where the key sensing blocks are.

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
Scratcher
100+ posts

Mouse/Key Press Emulation Blocks

BigNate469 wrote:

cake__5 wrote:

big snip
But that's a lot of work, especially in larger projects where it may not be immediately obvious where the key sensing blocks are.

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.
its called editing the json file :)
BigNate469
Scratcher
1000+ posts

Mouse/Key Press Emulation Blocks

cake__5 wrote:

BigNate469 wrote:

cake__5 wrote:

big snip
But that's a lot of work, especially in larger projects where it may not be immediately obvious where the key sensing blocks are.

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.
its called editing the json file :)
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.
--ORI0N--
Scratcher
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.

Powered by DjangoBB