This topic describes how your application can receive input from a mouse.

The user can interact with your application using a connected mouse.

Figure 1. Mouse

Figure 1. Mouse


Interaction with the application using a mouse is enabled by default. If you want to disable it in your application, add the following line to the "config.xml" file:

<tizen:setting pointing-device-support='disable' />

The supported mouse events are described in the W3C Mouse Events.

To receive notifications for mouse events, for example, the click event:

  1. Create a listener for the click event. The listener is notified each time the element is clicked.

    <div id='button' ... onclick='handleKeyClick();'> ... </div>


    document.getElementById('button').addEventListener('click', handleKeyClick);
  2. Define the listener:

    function handleKeyClick () {
      // Something you want to do