0

I'm looking for a method to recognize a real input from a real keyboard. I'm using Android Studio. I already know that the keyboard is attached to my device. When I press a key I would like to listen to it and do a specific action. For example when I press the "B" I want to invoke an Intent, when I press "P" I want to play a video and other things like this. Thanks a lot

Twing90
  • 407
  • 2
  • 5
  • 15
  • Possible duplicate of [Finding if external usb or bluetooth keyboard attached in Android](https://stackoverflow.com/questions/12161989/finding-if-external-usb-or-bluetooth-keyboard-attached-in-android) – Abbas Apr 30 '19 at 08:42
  • Is not a duplicate because I already know that the Keyboard is attached, I would like to listen for a specific key pressed – Twing90 Apr 30 '19 at 08:48
  • Then all you have to do is set an `OnKeyListener` to the appropriate view. – Abbas Apr 30 '19 at 09:30

0 Answers0