Languages

Menu
Sites
Language
How to customize UI like volume

When user press volume key up or down, the volume ui will show,

whatever the screen is at any app. I want to customize menu ui,

when user press "M" key on keyboard, the menu ui will show.

Whatever the screen is at any app, like the volume key.

Is that possible?

Responses

4 Replies
s arefin

Hi, 

You can do this kind of senario on your own app.

I have tried implementing a key press event which gives the facility to user to press ‘m’ on keyboard and get a menu of options as a popup. Here’s the sample code snippet below, please check if it comes to a benefit to you:

var mainPage = document.querySelector('#main');

    mainPage.addEventListener("click", function() {

    document.getElementById("inputField").focus();

    });

    document.getElementById ("inputField").addEventListener('keyup', function(e){

        console.log("keyCode:"+e.which);

        if(e.which===77)

        {

             console.log("m");

             var popup = document.querySelector("#moreoptionsPopup");

             window.tau.openPopup(popup);

        }

    });

陳 佳豪

Thanks for your reply, and sorry about my poor English.

The situation is showing menu when pressing "m" in everywhere.

Look like I need add this code snippet in every page, right?

I can modify the platform code, but i don't find the entry to handle the hardware key.

Do you have any suggestion ? 

Very thanks for your reply.

 

s arefin

Hi, 

For platform code, it might be difficult to get the authority and change the code. 

陳 佳豪

Hi, 

I followed the https://source.tizen.org/documentation/developer-guide/all-one-instructions, 

and executed on emulator.

I can customize the image and modify the platform,  but i am not familiar with the system.

Maybe, i can add service to receive the hardware key event, right?