Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SWTBot » PressShortcut
PressShortcut [message #509768] Mon, 25 January 2010 05:49 Go to next message
Thomas Py is currently offline Thomas Py
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 09:08 Go to previous message
Pascal G is currently offline Pascal G
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: Thu Aug 21 18:12:30 EDT 2014

Powered by FUDForum. Page generated in 0.02530 seconds