Special Keys on KaiOS

Posted by Tom Barrasso on

Handle special keys (soft keys, volume, camera) on KaiOS

Why it matters. A great user experience on KaiOS starts with directional navigation and proper keyboard handling.

Dive deeper. Not all devices support the same hard keys, and while most have a T9 layout, some like the JioPhone 2 have full QWERTY keyboards.

Special Keys

KeyKey CodeCodeDescription
SoftLeft0F13Left Soft Key (LSK), typically performs action
SoftRight0F15Right Soft Key (RSK), typically opens options menu
MicrophoneToggle0N/ALaunch the Voice Assistant (VA) via voice-assistant Web Activity
Enter13HomeSelect the currently-focused element
Backspace8KeyBGo to previous page
GoBack0N/AGo to previous back (KaiOS Smart Touch only)
BrowserBack0N/AGo to previous page (web browser only)
VolumeUp182AudioVolumeUpRaise volume
VolumeDown183AudioVolumeDownLower volume
Call0N/ALaunch the call screen or accept current action
EndCall95PowerCancel the current action or close app
Power95PowerToggle screen on/ off; long-press to power down
Camera0N/AOpen Camera app
HeadsetHook0N/AOpen Music app
LaunchWebBrowser0F14Launch Browser app
LaunchMail0N/ALaunch Email app
Message0KeyALaunch SMS app
Notification0N/AOpen Notification panel
Symbol224F17Toggle symbol input (i.e. #, *, -, +, @, etc)

Always use the KeyboardEvent#key property, as many keys lack a keyCode, and the code property changes based on keyboard layout and device configuration. Keep in mind that many keys are limited to certain devices, although every KaiOS device has d-pad navigation as well as LSK and RSK.

Pro Tip: use Feature Detection to check if the device has hardware camera or volume buttons.

Using Special Keys

Here are a few ideas for how to use special keys:

Volume

  • For an eReader app, scroll the page up or down
  • For an image gallery, zoom in or out
  • For a calendar app, toggle day/ week/ month view

Soft Keys

  • For a game, perform an action like A or B buttons
  • For an image gallery, pan the image right or left
  • For an app, open options or launch search page

Warning: Never block the user from leaving your app. Although KaiOS allows apps to intercept important navigational keys like Backspace and Power, users can typically long-press these keys to terminate your app.

Voice Assistant

There is one setting, voice-assistant.enabled, and two device preferences, dom.microphonetoggle.supported and dom.microphonetoggle.hardwareKey, that control the Voice Assistant (VA). Typically long-pressing Enter will trigger the MicrophoneToggle event, launching the voice-assistant activity that includes a single data element, from, that is either Homescreen, System, or the name of the app or website that the user was on before triggering the VA.

Conclusion

It’s easy to overlook special keys, but directional navigation and soft keys are important at delivering a top-notch user experience on KaiOS. If you need support adapting your website or PWA for easy navigation on KaiOS, contact the author from the About page.