How to enable emulated cursor in KaiOS app?

316 views Asked by At

I went through the official docs of KaiOS and did the following to enable emulated cursor on a particular page(component) in react.js. I ran the project in chrome, KaiOS simulator but not on a real device.

Added following in manifest.webapp

"type": "privileged", // or "certified"
  "permissions": {
    "spatialnavigation-app-manage": {}
  }

And tried doing this in particular page:

useEffect(() => {
    window.navigator.spatialNavigationEnabled = true;
      return () => {
        window.navigator.spatialNavigationEnabled = true;
      };
    }
  }, []);

But gives this error: Property 'spatialNavigationEnabled' does not exist on type 'Navigator'.

What am I missing here? What should I do it to enable cursor effectively?

2

There are 2 answers

2
chrmcpn On

I got the cursor enabled adding the property

"cursor": true,

In the root of the manifest.

1
akhilesh On
"permissions": {
    "spatialnavigation-app-manage": {}
  }

In the code where you want to enable the cursor, add the following code in the function:

navigator.spatialNavigationEnabled = true;