10 messages in com.googlegroups.google-desktop-developerRe: capture SHIFT in edit component?| From | Sent On | Attachments |
|---|---|---|
| pop | 28 May 2008 14:32 | |
| Benjamin [API Guru] | 28 May 2008 14:51 | |
| pop | 28 May 2008 19:46 | |
| Bijoy Thangaraj | 28 May 2008 20:08 | |
| pop | 28 May 2008 20:25 | |
| pop | 28 May 2008 20:27 | |
| Bijoy Thangaraj | 28 May 2008 21:59 | |
| Benjamin [API Guru] | 28 May 2008 23:13 | |
| pop | 29 May 2008 05:14 | |
| Bijoy Thangaraj | 29 May 2008 06:05 |
| Subject: | Re: capture SHIFT in edit component?![]() |
|---|---|
| From: | Bijoy Thangaraj (jspl...@gmail.com) |
| Date: | 05/29/2008 06:05:30 AM |
| List: | com.googlegroups.google-desktop-developer |
Oh!. Thanks guys...
On Thu, May 29, 2008 at 5:44 PM, pop <pop....@gmail.com> wrote:
Cool! The combination of onkeyup/onkeydown/onkeypress works great as Benjmin mentioned above.
So Bijoy should update the blog then. :-)
Thanks for your guys help!
Pop
var isShift = false; function edit1_onkeypress() { gadget.debug.trace("key=="+event.keyCode); if (event.keyCode === 9) { if (isShift) { edit3.focus(); } else { edit2.focus(); } event.returnValue = false; } }
function edit1_onkeydown() { if (event.keyCode === 16) { gadget.debug.trace("shift key down"); isShift = true; event.returnValue = false; } }
function edit1_onkeyup() { if (event.keyCode === 16) { gadget.debug.trace("shift key up"); isShift = false; event.returnValue = false; } }
On May 29, 2:13 am, "Benjamin [API Guru]" <code...@gmail.com> wrote:
You should use onkeyup and onkeydown instead of keypress. When you see shift in the onkeydown event you set isShift to true, onkeyup you set it to isShift to false. When you see tab in the onkeydown or onkeyup function you can then jump backwards.
Benjamin
On May 29, 5:27 am, pop <pop....@gmail.com> wrote:
It seems SHIFT+TAB will not work then.
One thing I found is CTRL+TAB will insert an TAB in the Edit but seems will not trigger the keyPress() event.
Please advise.
Thanks,
POP
On May 28, 11:09 pm, "Bijoy Thangaraj" <jspl...@gmail.com> wrote:
As you said, Shift and Ctrl keys are not applicable for edit areas. Check out my blog post for a quick reference:
http://googledesktopapis.blogspot.com/2008/03/tip-keycode-quick-refer...
However, Shift + 'any alphabetic key' does return the keyCode for the capitalized alphabet in edit areas.
On Thu, May 29, 2008 at 8:16 AM, pop <pop....@gmail.com> wrote:
It seems in the Edit component, the SHIFT key is never captured by KeyPressed event. I am wondering if there is an attribute in event to reflect that SHIFT is pressed but I can not find it.
Please advise.
Thanks,
Pop
On May 28, 5:51 pm, "Benjamin [API Guru]" < code...@gmail.com> wrote:
Shift is triggered like any other key. You would have to save the shift state yourself. Seehttp:// code.google.com/p/desktopgadgets/source/browse/trunk/TetrisGad... for a list of keycodes.
Best regards, Benjamin
On May 28, 11:32 pm, pop <pop....@gmail.com> wrote:
Is it possible to capture SHIFT in edit's keyPress() event?
It seems I can only have event.keyCode.
I would like to capture "SHIFT+TAB"
Thanks,
Pop
-- Thanks and Regards, Bijoy Thangarajhttp://www.gdgadgets.com
-- Thanks and Regards, Bijoy Thangaraj http://www.gdgadgets.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Desktop Developer Group" group.
To post to this group, send email to Goog...@googlegroups.com
To unsubscribe from this group, send email to
Goog...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Google-Desktop-Developer?hl=en
-~----------~----~----~----~------~----~------~--~---




