top

Mouse

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

Note

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' />

If a mouse pointer is shown on your application and your application does not act according to mouse clicks, a serious defect will be reported when your application is verified by Samsung.

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>
    

    or

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

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