Hi

Actually, I have the same problem:
  
http://groups.google.com/group/android-developers/browse_thread/thread/5fc2f9fa02b9f436
Apologies for the duplicate post.

Here's what I've seen so far: AFAI can tell, SoftKeyboard shows how to
implement the triple-state (lowercase -> single-char caps -> sticky
caps) logic for the shift softkey, but not how to connect the software
keyboard shift state with the hardware keyboard shift state.  Also
went through the LatinIME and PinyinIME sources in Git, and the API
docs, to no avail.  Furthermore, as far as I can tell, PinyinIME does
try to track the hardware keyboard state and make the software
keyboard shift state match, but it does so by tracking hardware
keyboard shift onKeyDown events.  In the emulator, I managed to get
the states out of sync (on a real G1 this is not possible, because the
soft and hard keyboards are never accessible at the same time).

Alternatively, if there is a way to reset the hardware keyboard shift
state, that would also help (then the state can be accurately tracked
by monitoring shift keycodes in onKeyDown()).

Finally, same question for querying or resetting the hardware keyboard
alt state (i.e., the state indicated by a caret or triangle at the top
of the cursor, as opposed to the bottom of the cursor).

I may be missing something obvious, but I'm a bit lost at the moment,
so any specific pointers would really be appreciated!

Thanks in advance!
Spiros

On May 13, 1:27 am, Dianne Hackborn <hack...@android.com> wrote:
> I am pretty sure the SoftKeyboard sample code shows how to handle this.
>
> On Tue, May 12, 2009 at 10:18 PM, e21u...@gmail.com <e21u...@gmail.com>wrote:
>
>
>
>
>
>
>
> > hi,
>
> > when hardware keyboard goes into CAPSLOCK mode - for example when in
> > emulator
> > Shift key is pressed twice i can see cursor in view changed and
> > pressing key A gives 'A')
>
> > is there any way that application or IME can detect it?
>
> > by looking on KeyEvent sent they look the same for capslock or no
> > shift ...
> > for example a
> > onKeyDown keyCode=29 event=KeyEvent{action=0 code=29 repeat=0 meta=0
> > scancode=30 mFlags=8}
> > onKeyUp keyCode=29 event=KeyEvent{action=1 code=29 repeat=0 meta=0
> > scancode=30 mFlags=8}
> > and A
> > onKeyDown keyCode=29 event=KeyEvent{action=0 code=29 repeat=0 meta=0
> > scancode=30 mFlags=8}
> > onKeyUp keyCode=29 event=KeyEvent{action=1 code=29 repeat=0 meta=0
> > scancode=30 mFlags=8}
>
> > is there some other listener or flag that can be checked?!
>
> > i can see also left Shift key events but no state ...
> > onKeyDown keyCode=59 event=KeyEvent{action=0 code=59 repeat=0 meta=65
> > scancode=42 mFlags=8}
> > onKeyUp  keyCode=59 event=KeyEvent{action=1 code=59 repeat=0 meta=0
> > scancode=42 mFlags=8}
>
> > my observations so far are that state of shift in IME and hardware
> > keyboard are not connected
> > and hardware keyboard does not notify IME about its state changes?
> > that is a bit confusing ...
>
> > is that correct? i
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and
> answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to