Discuss Scratch
- redeagle55
-
Scratcher
26 posts
Adding a Mobile/Desktop Detecting Block
This discussion is about adding a block similar to this:
<on [ mobile v] ?>Or,
<on [ desktop v] ?>Please add complaints, supportive comments, or suggestions about adding this block. Thank you!
Last edited by redeagle55 (Feb. 21, 2020 00:42:00)
- minor-edit
-
Scratcher
500+ posts
Adding a Mobile/Desktop Detecting Block
How would Scratch know that it was on mobile or desktop? What about tablet?
- Skywarslord
-
Scratcher
100+ posts
Adding a Mobile/Desktop Detecting Block
How would Scratch know that it was on mobile or desktop? What about tablet?
While I don't know about the first question, as Im not a programmer. The second question can be answered easily. We can Seperate Ipad and phone. Though this may require emulators in scratch as people might need to change guis etc.
Here is my example:
<On [ Ipad] ?>
<On [ Phone] ?>
- minor-edit
-
Scratcher
500+ posts
Adding a Mobile/Desktop Detecting Block
iPad is too specific (it's a brand name). Maybe the detection should be “touchscreen” / “non-touchscreen”?
- chrdagos
-
Scratcher
500+ posts
Adding a Mobile/Desktop Detecting Block
No support because this block could be used in bad ways like
when green flag clicked
if <on [mobile v]? :: sensing> then
say [get the $#@% out of here, you phone addict!] for (2) secs
stop [all v]
else
... :: gray
end
- redeagle55
-
Scratcher
26 posts
Adding a Mobile/Desktop Detecting Block
No support because this block could be used in bad ways likePeople could do that right nowwhen green flag clicked
if <on [mobile v]? :: sensing> then
say [get the $#@% out of here, you phone addict!] for (2) secs
stop [all v]
else
... :: gray
end
- CatsUnited
-
Scratcher
1000+ posts
Adding a Mobile/Desktop Detecting Block
No support because this block could be used in bad ways likeThere are already numerous blocks out there that you could use to target specific users, such as the username block and using cloud variables to detect if someone is a scratcher or not. This is an example of the classic “No support because it could be abused” technique which is a very surface level argument, so that shouldn't be a valid reason to not include this feature.
-blocks-
How would Scratch know that it was on mobile or desktop? What about tablet?There are several methods on detecting what particular browser or OS someone's using. The globe button that outputs your browser and OS information can be a good way to detect such a thing.
- redeagle55
-
Scratcher
26 posts
Adding a Mobile/Desktop Detecting Block
No support because this block could be used in bad ways likewhen green flag clicked
if <on [mobile v]? :: sensing> then
say [get the $#@% out of here, you phone addict!] for (2) secs
stop [all v]
else
... :: gray
end
Also if someone did that anyway, someone could simply report the project
- MapleSyrup911
-
Scratcher
83 posts
Adding a Mobile/Desktop Detecting Block
iPad is too specific (it's a brand name). Maybe the detection should be “touchscreen” / “non-touchscreen”?
A problem with this is it is not uncommon to find Bluetooth keyboards for mobile or touchscreen computers/laptops.
- minor-edit
-
Scratcher
500+ posts
Adding a Mobile/Desktop Detecting Block
I guess it depends on what the purpose of the detection is. My preference is projects support both touchscreen and keyboard users. But maybe the detection of mobile or desktop is for something else.
- ThatOneWeirdDude
-
Scratcher
1000+ posts
Adding a Mobile/Desktop Detecting Block
Can`t you simply use an asking block as a workaround?
Seems like an easy fix to a whole new block
Seems like an easy fix to a whole new block
- TheFinezt
-
Scratcher
14 posts
Adding a Mobile/Desktop Detecting Block
No support because this block could be used in bad ways likeMost blocks can be used in bad ways, so that isn't an argument. Example:when green flag clicked
if <on [mobile v]? :: sensing> then
say [get the $#@% out of here, you phone addict!] for (2) secs
stop [all v]
else
... :: gray
end
when green flag clicked
forever
say [if you are reading this you're dumb lol haha]
end
Or:
when green flag clicked
ask [What is the answer to the problem on the screen?] and wait
forever
if <(answer) = [14]> then
say [You're smart!]
else
say [Wow, you're stupid.]
end
end
I think this could be added. Change “mobile” to “mobile device” or something, though. But then again,
Can`t you simply use an asking block as a workaround?You could just ask the player. It doesn't matter if they lie or not.
Seems like an easy fix to a whole new block
- Nambaseking01
-
Scratcher
1000+ posts
Adding a Mobile/Desktop Detecting Block
I feel like a mobile? boolean block would be enough, because then you could easily detect if a user is on desktop using a not operator. Because desktop is the place where Scratch is most easy to work on, so I feel like a boolean option for that would be unnecessary.
- redeagle55
-
Scratcher
26 posts
Adding a Mobile/Desktop Detecting Block
I feel like a mobile? boolean block would be enough, because then you could easily detect if a user is on desktop using a not operator. Because desktop is the place where Scratch is most easy to work on, so I feel like a boolean option for that would be unnecessary.This is where i was going when i created this discussion^
- redeagle55
-
Scratcher
26 posts
Adding a Mobile/Desktop Detecting Block
It could be used in a way so that if someone made a project, and you were on mobile, it could say, “Sorry, but this game is not supported on mobile.” That is one way it could be used but that means if someone’s is on mobile, and they have a Bluetooth keyboard, then the game would work for them, but they might not be able to play it because of a code that makes it say that. I mostly use mobile for Scratch with a Bluetooth keyboard. But a message like that might be bad for a mobile user with a Bluetooth keyboard who could play the game if it did not have a code like that.
- redeagle55
-
Scratcher
26 posts
Adding a Mobile/Desktop Detecting Block
How would Scratch know that it was on mobile or desktop? What about tablet?Answer: Well, most websites are able to detect this. For example, YouTube detects if you are on mobile so it can change what it looks like. If you are on mobile the YouTube url looks like: https//:m.youtube.com/, whereas if you’re on desktop, the url is https//:www.youtube.com/. The difference between those two urls, if you did not notice, is the mobile one starts with https//:m., and the desktop one starts with https//:www. So that means websites CAN detect if you are mobile or website, so Scratch would be able to detect if you are on mobile or desktop.
- redeagle55
-
Scratcher
26 posts
Adding a Mobile/Desktop Detecting Block
Also it could work if Scratch had only a on mobile? block.
<mobile?>
<not <mobile?>>
- redeagle55
-
Scratcher
26 posts
Adding a Mobile/Desktop Detecting Block
Let’s list some pros and cons. Quote this and list some.
Last edited by redeagle55 (Feb. 21, 2020 17:00:53)
- StevenTheSquare
-
Scratcher
100+ posts
Adding a Mobile/Desktop Detecting Block
no support. if you want to make a mobile friendly verses computer version of a project, you can just present them with two buttons to click at the start of the project. That way, the user gets to pick.
MOBILE COMPUTER
MODE MODE
or you can have: For computer mode, use arrow keys. For mobile mode, use the mouse.
or even:
MOBILE COMPUTER
MODE MODE
or you can have: For computer mode, use arrow keys. For mobile mode, use the mouse.
or even:
repeat until <<(answer) = [M]> or <(answer) = [C]>>
ask [if you are mobile, enter "M" if you are using a computer, enter "C"] and wait
end
if <(answer) = [M]> then
set [PlatformMode v] to [Mobile]
else
set [PlatformMode v] to [Computer]
end
Last edited by StevenTheSquare (March 2, 2020 17:14:34)
- redeagle55
-
Scratcher
26 posts
Adding a Mobile/Desktop Detecting Block
no support. if you want to make a mobile friendly verses computer version of a project, you can just present them with two buttons to click at the start of the project. That way, the user gets to pick.That is true, but it would make it easier to use a mobile? block. Plus, some games already do this, and it would look better and work better if you used mobile?.









