Discuss Scratch
- Discussion Forums
- » Suggestions
- » Allow the mouse-pointer to be in multiple places at once (touchscreen)
- 46009361
-
1000+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
Hi! I want to make it so that users can select whether the stage can hold one or multiple mouse-pointer positions at the same time. If multiple, the three blocks (mouse x), (mouse y), and <mouse down?> will report a list. The first mouse-pointer will be marked as item 1 in each list, the second as #2, etc — and you can insert these blocks (only these) into the dropdowns. However, if you switch the setting from multiple to one, Scratch should automatically remove it from the list dropdown to prevent the thing from breaking. You also shouldn't be able to just edit the JSON file (project.json), because Scratch should also check and then remove it if needed. This is how it would look like:
when green flag clickedActually, there should now be three settings instead of two: one-touch, two-touch, and multi-touch. For everything except for one-touch, the three mouse-pointer blocks should be treated as lists of numbers/booleans converted into strings, instead of reporting a number or boolean. When you have a block like this, though:
wait until <mouse down?>
wait (0.3) secs
if <<(item (1) of <mouse down?> :: list) = [true]> and <<(item (2) of <mouse down?> :: list) = [true]> and <(length of <mouse down?>) = [2]>>> then
broadcast [mobile v]
else
broadcast [desktop v]
end
<touching [mouse-pointer v] ?>It will also be reported as a list as well. True if the first touch is touching the sprite, otherwise false, on #1 in the list. The same for #2 (except that it's on a different position in a list), #3, the twentieth touch, etc.
Last edited by 46009361 (March 6, 2020 20:15:31)
- 46009361
-
1000+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
Bump
Last edited by 46009361 (Dec. 20, 2020 21:39:00)
- imfh
-
1000+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
I wouldn’t want this as part of default Scratch. However, I wouldn’t mind it was part of an extension. Personally I think that it would be really neat if Scratch had some sort of mobile extension which allowed access to the gyroscope and other mobile sensors.
- 46009361
-
1000+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
default Scratch. …Is it possible to make this part of the default Scratch website, though? I wouldn’t want this as part of
- imfh
-
1000+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
What I mean is that I think it would be better for there to be dedicated blocks for detecting touches. I think it would be both a lot easier for the Scratch Team to program and more intuitive.default Scratch. …Is it possible to make this part of the default Scratch website, though? I wouldn’t want this as part of
Maybe something like this:
(touch x (1) ::sensing)
(touch y (1) ::sensing)
(# of touches ::sensing)
Or alternatively like this:
when screen touched (touch x::sensing) (touch y::sensing) ::sensing hat
when touch moved (touch x::sensing) (touch y::sensing) ::sensing hat // Maybe old position, change, or speed too?
when touch released (touch x::sensing) (touch y::sensing) ::sensing hat
- 46009361
-
1000+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
What I mean, however, is if it is possible for this to actually be implemented — due to the limitations of HTML, CSS, and JavaScript coding.What I mean is that I think it would be better for there to be dedicated blocks for detecting touches. I think it would be both a lot easier for the Scratch Team to program and more intuitive.default Scratch. …Is it possible to make this part of the default Scratch website, though? I wouldn’t want this as part of
Last edited by 46009361 (Feb. 26, 2021 07:30:21)
- imfh
-
1000+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
Yep, both multitouch detection and gyroscope detection are possible.What I mean, however, is if it is possible for this to actually be implemented — due to the limitations of HTML, CSS, and JavaScript coding.What I mean is that I think it would be better for there to be dedicated blocks for detecting touches. I think it would be both a lot easier for the Scratch Team to program and more intuitive.default Scratch. …Is it possible to make this part of the default Scratch website, though? I wouldn’t want this as part of
https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Multi-touch_interaction
https://developer.mozilla.org/en-US/docs/Web/API/Gyroscope
Last edited by imfh (March 5, 2020 01:51:32)
- Maximouse
-
1000+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
Support. This should be in a “multitouch” extension.
- 46009361
-
1000+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
I already know that gyroscope is possible (there's already a physical device extension for it, which not everyone has, and it doesn't detect directly from the device) because of Google's bubble level, but we should also have a block as to whether or not the user has granted permission in advance for the gyroscope one. Yep, both multitouch detection and gyroscope detection are possible.
https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Multi-touch_interaction
https://developer.mozilla.org/en-US/docs/Web/API/Gyroscope
- --Explosion--
-
1000+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
Support! I personally don't use mobile for scratch, but I think this would be very usefull! Also, perhaps make another extention for mobile controls?
- 46009361
-
1000+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
We can already check if the mouse-pointer is down and what its x and y values are at any given moment. …make another extention for mobile controls?
- Maximouse
-
1000+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
But on mobile, the “mouse pointer” can be on multiple positions at once.We can already check if the mouse-pointer is down and what its x and y values are at any given moment. …make another extention for mobile controls?
- 46009361
-
1000+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
Yep, both multitouch detection and gyroscope detection are possible.I read the multi-touch article, and there seems to be three modes: one-finger-touch, two-finger-touch, and more-than-two-finger-touch. So, I will now edit the OP in order to make it three settings instead of two.
https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Multi-touch_interaction
https://developer.mozilla.org/en-US/docs/Web/API/Gyroscope
- Sheep_maker
-
1000+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
Would require first class lists, which aren't a thing on Scratch yet
No, that's just their example. JavaScript can detect an unlimited number of pointers (pens, mouse cursors, and fingers). There doesn't need to be specific settings for itYep, both multitouch detection and gyroscope detection are possible.I read the multi-touch article, and there seems to be three modes: one-finger-touch, two-finger-touch, and more-than-two-finger-touch. So, I will now edit the OP in order to make it three settings instead of two.
https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Multi-touch_interaction
https://developer.mozilla.org/en-US/docs/Web/API/Gyroscope
- 46009361
-
1000+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
Bump again.
I hope it is at least 24 hours. I'll look at the post timestamps after posting this.
I hope it is at least 24 hours. I'll look at the post timestamps after posting this.
- TedtheFluffy
-
4 posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
I agree with this. It is very annoying to have to let go of the joystick in order to push the attack button.
- dominic305
-
500+ posts
Allow the mouse-pointer to be in multiple places at once (touchscreen)
An extension for it would be great! I wouldn’t want this as part of default Scratch. However, I wouldn’t mind it was part of an extension. Personally I think that it would be really neat if Scratch had some sort of mobile extension which allowed access to the gyroscope and other mobile sensors.
- Discussion Forums
- » Suggestions
-
» Allow the mouse-pointer to be in multiple places at once (touchscreen)