Example usage for android.view InputEvent getDevice

List of usage examples for android.view InputEvent getDevice

Introduction

In this page you can find the example usage for android.view InputEvent getDevice.

Prototype

public final InputDevice getDevice() 

Source Link

Document

Gets the device that this event came from.

Usage

From source file:ch.jeda.platform.android.CanvasFragment.java

private static EventSource mapDevice(final android.view.InputEvent event) {
    final android.view.InputDevice device = event.getDevice();
    final int id = device.getId();
    if (!INPUT_DEVICE_MAP.containsKey(id)) {
        INPUT_DEVICE_MAP.put(id, new EventSource(device.getName()));
    }/*  w  w  w .  jav a2  s . co  m*/

    return INPUT_DEVICE_MAP.get(id);
}

From source file:com.google.fpl.voltair.VoltAirActivity.java

private static boolean isFromSource(InputEvent event, int querySource) {
    return isSourceType(event.getDevice(), querySource);
}