title: Android - Drawing text on canvas via soft keyboard input
body: <p>I'm making a custom view that can be annotated with typical paint tools like draw, shape dropping, or writing text. I've implemented all of the tools that would fall under the "Drawing" category, but text entry is giving me a lot of trouble. I would very much prefer to avoid creating EditTexts on top of this view as an approach. There seem to be a lot of conflicting answers to questions about this topic out there. </p>
  
  <p>What I want to do:</p>
  
  <ul>
  <li>Tap anywhere in the custom view and open keyboard / indicate that text can be entered</li>
  <li>Get keyboard input - preferably any kind of keyboard. <a href="https://stackoverflow.com/questions/10616567/how-to-listen-the-keypress-in-the-soft-keyboard">How to listen to keypress in the soft keyboard</a> seems to have some contention about what works for hard or soft keyboards. </li>
  <li>Take the keyboard input, and draw it on my canvas after the user enters any character. </li>
  <li>Allow the user to edit that text</li>
  <li>Allow the user to move the text</li>
  </ul>
  
  <p>I've tried overriding onKeyUp() and intercepting each keypress. The android docs suggest that editable text should be entered using DynamicLayout, so I've been attempting to use dynamicLayout.draw(canvas). I can open the soft keyboard, but even after setting my view to focusable and requesting focus, the onKeyUp() does not fire. 
  I've seen several answers to questions that warn against using anything but an EditText for text entry due to complexity and issues with custom keyboards. Surely someone knows how to do this?</p>
  
  <p><strong>What would be a huge help to me, is a basic overview of what goes into displaying user entered text on a canvas as it is entered.</strong> A high level step by step of what to do would be fine. Even just details on where to look to figure out the first three steps above would be greatly appreciated. </p>