Of course this is nonsense, but the program will run in the emulator on the computer, and it is necessary that the program react to key presses from the keyboard. What libraries can this be implemented in?

  • Which emulator will you use? - VAndrJ
  • If you have a Genymotion emulator, then before starting a specific device, you can disable the use of virtual keyboard in its settings. - YurySPb
  • Ok I can disable the virtual keyboard, but I can work with the real one? - Dmitry Berezhnoy

1 answer 1

Try https://www.visualstudio.com/en-us/features/msft-android-emulator-vs.aspx

As stated https://blogs.msdn.microsoft.com/visualstudioalm/2014/11/12/introducing-visual-studios-emulator-for-android/ :

you can use your computer keyboard

You can use a computer keyboard to type text in the emulator.

  • I need that when I clicked on for example on "W" a certain code was executed .. And not to type the text .. - Dmitry Berezhnoy
  • @ Dmitry Berezhnoy try @Override public boolean dispatchKeyEvent(KeyEvent event) { if(event.getKeyCode() == neededKeyCode) { //TODO необходимый код } return super.dispatchKeyEvent(event); } @Override public boolean dispatchKeyEvent(KeyEvent event) { if(event.getKeyCode() == neededKeyCode) { //TODO необходимый код } return super.dispatchKeyEvent(event); } - VAndrJ