Re: [SWTBot-users] question about SWTBotText.notifyKeyboardEvent(..)
Brought to you by:
kpadegaonkar
|
From: Ketan P. <ket...@gm...> - 2008-11-14 22:29:34
|
Hi Phil,
This snippet perhaps? It worked on macosx for me.
private void traverse(Display d) {
// tab ten times
for (int i = 0; i < 10; i++) {
d.post(tabDown());
d.post(tabUp());
try {
Thread.sleep(100);
} catch (InterruptedException niceTry) {
}
}
}
private Event tabDown() {
Event event = new Event();
event.type = SWT.KeyDown;
event.keyCode = SWT.TAB;
event.character = SWT.TAB;
return event;
}
private Event tabUp() {
Event event = new Event();
event.type = SWT.KeyUp;
event.keyCode = SWT.TAB;
event.character = SWT.TAB;
return event;
}
-- Ketan
Phil Quitslund wrote:
> Hey all,
>
> Looking at SWTBotText.notifyKeyboardEvent(int, char, int), I notice that after
> key down and up events are posted a setText(..) is called. Is there no other
> way? (Programmatic setting of text values doesn't feel quite right and
> generates behavior that's a bit different than the "real thing" --- notably the
> cursor does not advance...) I tried removing it and, unsurprisingly, the
> desired text was not entered/typed. My next thought was to fill in more of the
> event details. Specifically by synthesizing and posting the VerifyEvent and
> ModifyEvent that occur between the key down and up but nothing doing.
>
> Any thoughts?
>
> Thanks!
>
>
> -phil
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> SWTBot-users mailing list
> SWT...@li...
> https://lists.sourceforge.net/lists/listinfo/swtbot-users
> http://swtbot.org/ - a functional testing tool for SWT/Eclipse
>
|