Android get text from specific inputDevice
<p>With the following code I can list the inputDevices connected to Android device.</p>

<pre><code>public void onClick(View v) {
    if(v==mConnect){
        Toast.makeText(MainActivity.this, "TESTE", Toast.LENGTH_LONG).show();
        Log.d("INPUTDEVICES", "111111111111111111111");
        int[] teste;
        teste = new int[10];

        for(int i=0;i&lt;5;i++){
        teste[i]=-1;
        }

        teste = InputDevice.getDeviceIds();
        for(int i=0;i&lt;5;i++){
            Log.d("TESTE", Integer.toString(teste[i]));
            Log.d("TESTEE",InputDevice.getDevice(teste[i]).getName());
        }


    }
}

D/INPUTDEVICES( 6572): 111111111111111111111
D/TESTE   ( 6572): 1
D/TESTEE  ( 6572): Phone_key
D/TESTE   ( 6572): 3
D/TESTEE  ( 6572): ssd253x-ts
D/TESTE   ( 6572): 4
D/TESTEE  ( 6572): sun4i-keyboard
D/TESTE   ( 6572): 5
D/TESTEE  ( 6572): axp20-supplyer
D/TESTE   ( 6572): 8
D/TESTEE  ( 6572): Logitech USB Keyboard
</code></pre>

<p>Now I want to wait for text from a specific input device, in this case the input device 8 - Logitech USB Keyboard.
Can you help me with that?</p>

<p>Thanks :)</p>

<p>EDIT</p>

<p>I want something like that:</p>

<pre><code>@Override
public boolean dispatchKeyEvent(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.KEYCODE_ENTER) {
    Toast.makeText(UITestsActivity.this,
               "YOU CLICKED ENTER KEY",
                Toast.LENGTH_LONG).show();
        return true;
    }
    return super.dispatchKeyEvent(e);
};
</code></pre>

<p>but that works for all keyboard keys like 'a','b','c',...</p>
