Can't get keycode from virtual keyboard

Hello,

I wanna ask about SHIELD’s virtual keyboard.

I couldn’t retrieve the keycodes from virtual keyboard. Because when I wanna type, I press [A] button and Android will always return [A] button’s keycode (96).
I just need to get ENTER keycode, because i wanted to close my virtual keyboard when I press ENTER.

I’ve tried use this method:

  • dispatchKeyEvent
  • dispatchKeyEventPreIme
  • onKeyUp
  • onKeyDown

but none of them return me keycodes from virtual keyboard. They only return keycodes from Gamepad.

Anyone can help me?

Hello,
Update :
Already solved this, by intercept it right before overriden onKeyUp.

private void AppendInput(CharSequence cs)
    {
        ....
	if(s_deviceName.contains("nvidia") || s_deviceName.contains("shield")	
	{
	  if((int)cs.charAt(0) == 10) // ENTER KEY
	  {
		this.HideKeyboard();
	  }
	}
	....
    	
    }