| View previous topic :: View next topic |
| Author |
Message |
bob
Joined: 01 Oct 2006 Posts: 2
|
Posted: Sun Oct 01, 2006 5:03 pm Post subject: Combining keyboard with mouse |
|
Is it possible to perform something like a mouse click while SHIFT/CONTROL/ALT key is pressed?
Bob |
|
| Back to top |
|
 |
admin Site Admin
Joined: 05 Jul 2006 Posts: 351
|
Posted: Sun Oct 01, 2006 6:24 pm Post subject: |
|
| bob wrote: |
| Is it possible to perform something like a mouse click while SHIFT/CONTROL/ALT key is pressed? |
I'm sorry, we have some undocumented features, but the answer is yes:
Code: click into code to enlarge
form.SendKeys("{SHIFTDOWN}{CTRLDOWN}{ALTDOWN}");
Application.Sleep(100);
Mouse.Click(MouseButtonType.LeftButton);
form.SendKeys("{SHIFTUP}{CTRLUP}{ALTUP}");
or
Code: click into code to enlarge
Application.SendKeys("{SHIFTDOWN}{CTRLDOWN}{ALTDOWN}");
Application.Sleep(100);
Mouse.Click(MouseButtonType.LeftButton);
Application.SendKeys("{SHIFTUP}{CTRLUP}{ALTUP}");
Jenö Herget
Ranorex Team |
|
| Back to top |
|
 |
bob
Joined: 01 Oct 2006 Posts: 2
|
Posted: Mon Oct 02, 2006 6:26 pm Post subject: |
|
Thanks for the help.
This seems the C code to me, I am using python. What I have tried in python is:
Code: click into code to enlarge
app = R.FormGetActive()
R.ControlSendKeys(app,"e")
R.ControlSendKeys(app,"{SHIFTDOWN}")
R.Sleep(1000)
R.MouseClick(R.MOUSE_LEFT_BUTTON,1)
with
Code: click into code to enlarge
import RanorexPython as R
However the "e" and mouseclick are received, but the SHIFTDOWN is not (also when i manually click afterward, any ideas? |
|
| Back to top |
|
 |
admin Site Admin
Joined: 05 Jul 2006 Posts: 351
|
Posted: Mon Oct 02, 2006 8:57 pm Post subject: |
|
You should use HWND=0 for the CTRL, ALT and SHIFT keys:
Code: click into code to enlarge
Ranorex.ControlSendKeys(textBox,'abc')
Ranorex.ControlSendKeys(0,'{SHIFTDOWN}')
Ranorex.ControlSendKeys(textBox,'efg')
Ranorex.ControlSendKeys(0,'{SHIFTUP}')
Gabor Herget
Ranorex Team |
|
| Back to top |
|
 |
|