# How to distinguish 'p5 WEB' smartphone computer?

**URL:** <https://discourse.processing.org/t/how-to-distinguish-p5-web-smartphone-computer/41334>\
**Category:** Coding Questions\
**Created:** [March 17, 2023, 5:59pm UTC](https://discourse.processing.org/t/how-to-distinguish-p5-web-smartphone-computer/41334 "2023-03-17T17:59:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [March 17, 2023, 5:59pm UTC](https://discourse.processing.org/t/how-to-distinguish-p5-web-smartphone-computer/41334/1 "2023-03-17T17:59:27Z")

</div>

How to distinguish ‘p5 WEB’ smartphone computer?

1. What you are currently using is a computer or mobile.  
Can I get device information?
2. If it’s mobile, I want it to be fixed in portrait.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [March 17, 2023, 11:27pm UTC](https://discourse.processing.org/t/how-to-distinguish-p5-web-smartphone-computer/41334/2 "2023-03-17T23:27:47Z")

</div>

> **[Screen.orientation - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/Screen/orientation)**
>
> The orientation read-only property of the
> Screen interface returns the current orientation of the screen.

> **[ScreenOrientation - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation)**
>
> The ScreenOrientation interface of the Screen Orientation API provides information about the current orientation of the document.

---

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [March 18, 2023, 9:18am UTC](https://discourse.processing.org/t/how-to-distinguish-p5-web-smartphone-computer/41334/3 "2023-03-18T09:18:06Z")

</div>

@GoToLoop

[Screen.orientation]  
The orientation read-only property of the Screen interface returns the current orientation of the screen.

thank you for the reply. Is it correct to receive the information above? Is it correct that it cannot be fixed?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [March 18, 2023, 9:27am UTC](https://discourse.processing.org/t/how-to-distinguish-p5-web-smartphone-computer/41334/4 "2023-03-18T09:27:49Z")

</div>

> [@GWAK](#):
>
> Is it correct that it cannot be fixed?

What do you mean by “it can’t be fixed”?  
Just open a browser’s console and type in: `screen.orientation`

This is what I get from my laptop’s browser [SlimJet](https://www.slimjet.com/):  
ScreenOrientation {angle: 0, type: ‘landscape-primary’, onchange: null}

---

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [March 18, 2023, 11:49am UTC](https://discourse.processing.org/t/how-to-distinguish-p5-web-smartphone-computer/41334/5 "2023-03-18T11:49:45Z")

</div>

@GoToLoop

thank you so much.  
I solved it.
