|PressShortcut [message #509768]
||Mon, 25 January 2010 05:49
| Thomas Py
Registered: January 2010
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();
it´s code i found in the forum, this ends in an "ExceptionInInitializerError" so what am i doing wrong?
plz help me !
|Re: PressShortcut [message #509817 is a reply to message #509768]
||Mon, 25 January 2010 09:08
| Pascal G
Registered: July 2009
> 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 !
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.*
Powered by FUDForum
. Page generated in 0.01992 seconds