title: Android: Practical examples on how to handle a USB keyboard keystrokes
body: <p>everybody.</p>
  <p>First of all, I want to clarify that yes, I have read the documentation for <a href="https://developer.android.com/guide/topics/connectivity/usb/accessory" rel="nofollow noreferrer">handling USB devices on Android</a>, and <a href="https://developer.android.com/training/keyboard-input/commands" rel="nofollow noreferrer">how to receive inputs from USB keyboards</a>. My problem is, I'm new to this, and I haven't been able to do anything with it yet, because I haven't been able to find any practical examples. Most searches end up fruitless for me, because none of the results are related to what I'm trying to do, and most questions people have are on how to use an Android phone/tablet in place of a USB keyboard, or how to handle soft keyboard keystrokes (you may see how this seems useful to search engines, but isn't much help to me).</p>
  <p>I have a suspicion that using <a href="https://developer.android.com/reference/java/io/BufferedReader" rel="nofollow noreferrer">BufferedReader</a> will get me somewhere, but I still don't have an exact clue how. For now, I just set a simple activity which attempts to capture USB key input using an AsyncTask to change the predefined text string of a TextView in my activity. Something which should be pretty straightforward, but I haven't managed to capture any keystrokes. I've looked up information on the <a href="https://developer.android.com/reference/java/util/Scanner" rel="nofollow noreferrer">Scanner</a> class, but this doesn't really seem to do anything, other than print results in the console output instead of being able to change text in the actual activity.</p>
  <p>Does anyone have a practical example of such a thing?</p>