Skip to main content



      Home
Home » Eclipse Projects » SWTBot » PressShortcut
PressShortcut [message #509768] Mon, 25 January 2010 05:49 Go to next message
Eclipse UserFriend
hello!

i´m trying to let the bot press "shift" and "f10". tried many ways but nothing works

last i tried was this ->
Keyboard k = KeyboardFactory.getAWTKeyboard();
k.pressShortcut(SWT.SHIFT|SWT.F10, '2');
it´s code i found in the forum, this ends in an "ExceptionInInitializerError" so what am i doing wrong?

plz help me !

thnx
Re: PressShortcut [message #509817 is a reply to message #509768] Mon, 25 January 2010 09:08 Go to previous message
Eclipse UserFriend
psycopy@gmx.de wrote:
> hello!
>
> i´m trying to let the bot press "shift" and "f10". tried many ways but
> nothing works
>
> last i tried was this ->
> Keyboard k = KeyboardFactory.getAWTKeyboard();
> k.pressShortcut(SWT.SHIFT|SWT.F10, '2');
> it´s code i found in the forum, this ends in an
> "ExceptionInInitializerError" so what am i doing wrong?
> plz help me !
>
> thnx

What Local is your java running with? I'm guessing something like German
due to your e-mail... well it doesn't work out of the box. You need to
provide SWTBot with a keyboard file and some other stuff which I'd
rather not explain here, since this "keyboard" feature isn't rock solid.
For example, characters typed using the AltGr key (usually right Alt)
can't be reproduced in SWTBot for now.

For an easier use, please make sure to set
SWTBotPreferences#KEYBOARD_LAYOUT to EN_US, since this is the easier
keyboard to support and it has internal support in SWTBot. Also, make
sure your OS uses the EN_US keyboard layout too during the tests (the
language bar in Windows and some similar applet in Linux), or otherwise
you could get wrong behavior.

Hope this helps.
--
Pascal Gélinas | Software Developer
*Nu Echo Inc.*
http://www.nuecho.com/ | http://blog.nuecho.com/

*Because performance matters.*
Previous Topic:[Solved] InputDialog - buttons not found
Next Topic:Is record/playback supported in latest swtbot?
Goto Forum:
  


Current Time: Tue Jul 08 03:21:01 EDT 2025

Powered by FUDForum. Page generated in 0.05108 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top