How to press shortcuts containing numpad keys? [message #1815683] |
Tue, 08 October 2019 07:26  |
Eclipse User |
|
|
|
I want to test the shortcut Ctrl+Numpad_Subtract in my editor. I tried
SWTBotEditor editor = bot.editorByTitle("my.editor");
SWTBotTree tree = editor.bot().tree(0);
tree.pressShortcut(Keystrokes.CTRL, KeyStroke.getInstance("NUMPAD_SUBTRACT"));
This doesn't work. Other shortcuts without numpad keys work fine with the code above, e.g. Ctrl+M. Is this a bug or is there any trick to test shortcuts containing numpad keys?
|
|
|
Re: How to press shortcuts containing numpad keys? [message #1815708 is a reply to message #1815683] |
Tue, 08 October 2019 11:04   |
Eclipse User |
|
|
|
Hi Matthias,
What you're doing seems correct, also equivalent to:
tree.pressShortcut(Keystrokes.CTRL, KeyStroke.getInstance(0, SWT.KEYPAD_SUBTRACT));
However, it does not work because AWTKeyboardStrategy in SWTBot is missing the natural key mapping for this key. (I assume you are using AWT keyboard)
It could be added (and, at the same time, Keystrokes.KEYPAD_SUBTRACT so you can use it directly). We should add all the other keypad keystrokes too...
Can you submit a patch, or else write a bug report?
Thanks,
Patrick
|
|
|
|
Powered by
FUDForum. Page generated in 0.04836 seconds