Hi,
I want to press Ctrl+F2 key event in my application.
Can anyone suggest me that how to press the Ctrl+F2 event.
Thankyou.
How to press a key(Keyboard.Press) intstead of a click
-
- Posts: 82
- Joined: Fri Oct 24, 2014 10:58 am
- Location: Bucharest
Re: How to press a key(Keyboard.Press) intstead of a click
Hi ejji09,
Did you tried Add New Action > Key Shortcut? Choose that and replace 'X' with Ctrl+F2.
Hope it helps?
Did you tried Add New Action > Key Shortcut? Choose that and replace 'X' with Ctrl+F2.
Hope it helps?
Lucian Teodorescu
NetSun Software
NetSun Software
Re: How to press a key(Keyboard.Press) intstead of a click
Am using code module.
I want to press the key event Ctrl+F2 in code module, I think you you gave me the answer for recording module.
I want to press the key event Ctrl+F2 in code module, I think you you gave me the answer for recording module.
Re: How to press a key(Keyboard.Press) intstead of a click
You did not specify you look for code in your initial post
Anyway, do you know you could examine code of each recorded action and even convert recorded actions to UserCode? Just select the recording action and press Ctrl+Enter. This shortcut should redirect you to code behind the selected recording action. Another way is to right click the selected action and from the appeared context menu select View Code.

Anyway, do you know you could examine code of each recorded action and even convert recorded actions to UserCode? Just select the recording action and press Ctrl+Enter. This shortcut should redirect you to code behind the selected recording action. Another way is to right click the selected action and from the appeared context menu select View Code.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: How to press a key(Keyboard.Press) intstead of a click
Am using code module to write my test case and for the keypress event i used the syntax as
code:
and it worked fine, but after the completion of the test case i was unable to type anything, all the keys in keyborad are not functioning and when i press the control key then all keysare working again and then i was able to type.
code:
Code: Select all
Keyboard.Press("{ControlKey down}{F2}");
Re: How to press a key(Keyboard.Press) intstead of a click
Yes, it's because you probably never called {ControlKey up} in your code? In other words, if you want to use Keyboard.Press like you did, you must always use {ControlKey down} {ControlKey up} sequence. Otherwise, the Ctrl key remains stuck in down position.
Or use the code behind the suggested Key Shortcut, which looks like this:
Or use the code behind the suggested Key Shortcut, which looks like this:
Code: Select all
Keyboard.Press(System.Windows.Forms.Keys.F2 | System.Windows.Forms.Keys.Control, Keyboard.DefaultScanCode, Keyboard.DefaultKeyPressTime, 1, true);
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration