Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » PressShortcut
PressShortcut [message #509768] Mon, 25 January 2010 10:49 Go to next message
Thomas Py is currently offline Thomas PyFriend
Messages: 6
Registered: January 2010
Junior Member
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 14:08 Go to previous message
Pascal G is currently offline Pascal GFriend
Messages: 157
Registered: July 2009
Senior Member
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: Fri Apr 19 10:00:38 GMT 2024

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

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

Back to the top