Java Code Examples for android.hardware.input.InputManager#getInstance()

The following examples show how to use android.hardware.input.InputManager#getInstance() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: KeyCharacterMap.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
/**
 * Loads the key character maps for the keyboard with the specified device id.
 *
 * @param deviceId The device id of the keyboard.
 * @return The associated key character map.
 * @throws {@link UnavailableException} if the key character map
 * could not be loaded because it was malformed or the default key character map
 * is missing from the system.
 */
public static KeyCharacterMap load(int deviceId) {
    final InputManager im = InputManager.getInstance();
    InputDevice inputDevice = im.getInputDevice(deviceId);
    if (inputDevice == null) {
        inputDevice = im.getInputDevice(VIRTUAL_KEYBOARD);
        if (inputDevice == null) {
            throw new UnavailableException(
                    "Could not load key character map for device " + deviceId);
        }
    }
    return inputDevice.getKeyCharacterMap();
}
 
Example 2
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
public Object createStaticService() {
    return InputManager.getInstance();
}
 
Example 3
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
public Object createStaticService() {
    return InputManager.getInstance();
}
 
Example 4
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
public Object createStaticService() {
    return InputManager.getInstance();
}
 
Example 5
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
public Object createStaticService() {
    return InputManager.getInstance();
}
 
Example 6
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
public Object createStaticService() {
    return InputManager.getInstance();
}
 
Example 7
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 4 votes vote down vote up
public Object createStaticService() {
    return InputManager.getInstance();
}
 
Example 8
Source File: SystemServiceRegistry.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
@Override
public InputManager createService() {
    return InputManager.getInstance();
}