try ontouch method
get x and y coordinate   of the area clicked
and do as you want on the clicked event

On Mar 21, 4:39 pm, Rich E <reakina...@gmail.com> wrote:
> 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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to