Example usage for android.view InputDevice isVirtual

List of usage examples for android.view InputDevice isVirtual

Introduction

In this page you can find the example usage for android.view InputDevice isVirtual.

Prototype

public boolean isVirtual() 

Source Link

Document

Returns true if the device is a virtual input device rather than a real one, such as the virtual keyboard (see KeyCharacterMap#VIRTUAL_KEYBOARD ).

Usage

From source file:com.goodhustle.ouyaunitybridge.OuyaUnityActivity.java

private ArrayList<Device> checkDevices() {
    //Get a list of all device id's and assign them to players.
    ArrayList<Device> devices = new ArrayList<Device>();
    int[] deviceIds = InputDevice.getDeviceIds();

    for (int count = 0; count < deviceIds.length; count++) {
        InputDevice d = InputDevice.getDevice(deviceIds[count]);
        if (!d.isVirtual()) {
            Device device = new Device();
            device.id = d.getId();//  w w w. ja v  a  2s  .c o m
            device.player = OuyaController.getPlayerNumByDeviceId(device.id);
            if (device.player != DEVICE_NOT_OUYACONTROLLER_COMPATIBLE) {
                device.name = d.getName();
                devices.add(device);
            }
        }
    }
    return devices;
}