[android-developers] Re: How to post a new key event?
I opened a bug report to track this: http://code.google.com/p/android/issues/detail?id=578 On Mar 26, 4:29 pm, Cheryl Sedota <[EMAIL PROTECTED]> wrote: > Hi, I am not trying to listen for the "onKeyDown" event in my keyboard > view class or keyboard activity - I want the EditText control that is > in the same viewgroup as my keyboard view to listen for and respond to > it. Do I have to explicitly set EditText views as focusable? I > wouldn't think so because I can type on the Android off-screen > keyboard and the text shows up in the EditText view just fine. > > On Mar 26, 3:50 pm, Rui Martins <[EMAIL PROTECTED]> wrote: > > > Is your keyboard event handle, "onKeyDown(...) method, returning the > > correct values when they process a specific key ? > > Do you call the super.onKeyDown(...) and return it's result, when you > > don't process a key that you don't recognize ? > > > Does commenting the onKeyDown(...) method make the EditText Control, > > work correctly again ? > > > Maybe you are just forgetting to call the following on your view: > > > setFocusable( true ); // Make sure we get keys > > > NOTE: without Focus you don't receive any keyboard input ! > > > On 26 mar, 18:26, Cheryl Sedota <[EMAIL PROTECTED]> wrote: > > > > I am developing an on-screen keyboard activity and need to post a key > > > event to Android. I can't figure out how to do it. > > > > I've intercepted some key events to see what Android methods are on > > > the stack, and it seems that I need to call getParent() from my view > > > until I get to the view root (android.view.ViewRoot, which is not an > > > accessible class in Android application code) and then call this > > > method: > > > > public void dispatchKey(KeyEvent event) > > > > ... I tried calling that method on my view root object using java > > > reflection and passed the key event object that I created. That call > > > was successful but no new text shows up in my EditText control which > > > is located within the keyboard activity. > > > > My first goal is for the EditText control that is located within the > > > keyboard activity (which maintains focus even while the key image is > > > pressed) to show the text that I have entered using the keyboard. > > > > My second goal is for an EditText control that is in the Activity > > > behind my keyboard activity to show the text that I have entered using > > > the keyboard. > > > > I appreciate any help anyone can provide!! > > > Cheryl- Hide quoted text - > > > - Show quoted text - > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to post a new key event?
Hi, I am not trying to listen for the "onKeyDown" event in my keyboard view class or keyboard activity - I want the EditText control that is in the same viewgroup as my keyboard view to listen for and respond to it. Do I have to explicitly set EditText views as focusable? I wouldn't think so because I can type on the Android off-screen keyboard and the text shows up in the EditText view just fine. On Mar 26, 3:50 pm, Rui Martins <[EMAIL PROTECTED]> wrote: > Is your keyboard event handle, "onKeyDown(...) method, returning the > correct values when they process a specific key ? > Do you call the super.onKeyDown(...) and return it's result, when you > don't process a key that you don't recognize ? > > Does commenting the onKeyDown(...) method make the EditText Control, > work correctly again ? > > Maybe you are just forgetting to call the following on your view: > > setFocusable( true ); // Make sure we get keys > > NOTE: without Focus you don't receive any keyboard input ! > > On 26 mar, 18:26, Cheryl Sedota <[EMAIL PROTECTED]> wrote: > > > > > I am developing an on-screen keyboard activity and need to post a key > > event to Android. I can't figure out how to do it. > > > I've intercepted some key events to see what Android methods are on > > the stack, and it seems that I need to call getParent() from my view > > until I get to the view root (android.view.ViewRoot, which is not an > > accessible class in Android application code) and then call this > > method: > > > public void dispatchKey(KeyEvent event) > > > ... I tried calling that method on my view root object using java > > reflection and passed the key event object that I created. That call > > was successful but no new text shows up in my EditText control which > > is located within the keyboard activity. > > > My first goal is for the EditText control that is located within the > > keyboard activity (which maintains focus even while the key image is > > pressed) to show the text that I have entered using the keyboard. > > > My second goal is for an EditText control that is in the Activity > > behind my keyboard activity to show the text that I have entered using > > the keyboard. > > > I appreciate any help anyone can provide!! > > Cheryl- Hide quoted text - > > - Show quoted text - --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---
[android-developers] Re: How to post a new key event?
Is your keyboard event handle, "onKeyDown(...) method, returning the correct values when they process a specific key ? Do you call the super.onKeyDown(...) and return it's result, when you don't process a key that you don't recognize ? Does commenting the onKeyDown(...) method make the EditText Control, work correctly again ? Maybe you are just forgetting to call the following on your view: setFocusable( true ); // Make sure we get keys NOTE: without Focus you don't receive any keyboard input ! On 26 mar, 18:26, Cheryl Sedota <[EMAIL PROTECTED]> wrote: > I am developing an on-screen keyboard activity and need to post a key > event to Android. I can't figure out how to do it. > > I've intercepted some key events to see what Android methods are on > the stack, and it seems that I need to call getParent() from my view > until I get to the view root (android.view.ViewRoot, which is not an > accessible class in Android application code) and then call this > method: > >public void dispatchKey(KeyEvent event) > > ... I tried calling that method on my view root object using java > reflection and passed the key event object that I created. That call > was successful but no new text shows up in my EditText control which > is located within the keyboard activity. > > My first goal is for the EditText control that is located within the > keyboard activity (which maintains focus even while the key image is > pressed) to show the text that I have entered using the keyboard. > > My second goal is for an EditText control that is in the Activity > behind my keyboard activity to show the text that I have entered using > the keyboard. > > I appreciate any help anyone can provide!! > Cheryl --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~--~~~~--~~--~--~---