Hi,

I'm trying to figure out how to capture keyboard input from a View, without
subclassing EditText or something similar (the reason is that I have a
complex bit of drawing to do, in which the text does not at all go in a
horizontal direction, nor does it ever start at a consistent location.. so I
figured that I would try to use a more direct route).

I am able to show the keyboard from my View by first calling
setFocusableInTouchMode(true) in my onCreateMethod, then calling:

   InputMethodManager imm =
(InputMethodManager)getContext().getSystemService(Context.
INPUT_METHOD_SERVICE);

imm.showSoftInput(this, InputMethodManager.SHOW_FORCED);


I call this from onTouchEvent(), in order to get the location of the touch
within the view.


This is where I get stuck.  When I implement onKeyDown or onKeyUp in the
View, I only get a callback when the done or back button is hit on the
keyboard.  I need to know which key of the soft keyboard is pressed, so that
I can draw that character in my View.  I also tried to setOnKeyListener for
a key listener, but it also only gets a callback when the done or back
buttons are pressed on the soft keyboard.


Any suggestions on how to proceed are gratefully appreciated.



Best,

Rich

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to