Screen
KaiOS devices have a QVGA resolution screen, all of which are in portrait mode. Only one device as of October 10, 2020 is landscape default.
Rotating the screen
There are two ways to do this.
Method 1
You can rotate the screen by calling screen.orientation.lock(ori), where ori is either portrait or landscape. Portrait is the device's normal orientation, and landscape is by default the device rotated sideways in a counter-clockwise motion.Possible values are:
| portrait-primary | ![]() |
| portrait-secondary | ![]() |
| landscape-primary | ![]() |
| landscape-secondary | ![]() |
Here's some code that will rotate the screen all around.
function rotate() { switch(screen.orientation.type) { case 'portrait-primary': screen.orientation.lock('landscape-primary'); break; case 'landscape-primary': screen.orientation.lock('portrait-secondary'); break; case 'portrait-secondary': screen.orientation.lock('landscape-secondary'); break; case 'landscape-secondary': screen.orientation.lock('portrait-primary'); break; } }
Method 2
You can set an orientation in the manifest.webapp.
"orientation": "landscape"Possible values are the same as in method 1.
Fullscreen
The default screen size for application that aren't fullscreen is 240x394 in portrait, or 320x214 in landscape. To find out how use the entire screen, refer to this page.
page revision: 7, last edited: 07 Oct 2020 19:40



