How to send keyboard Ctrl+Shift+n keystrokes

Sep 15, 2011 at 1:10 AM

Hello,

I was wondering if anybody know to to use the KeyboardInput in White to press Ctrl+Shift+n. I appreciate your help.

Alan

Sep 15, 2011 at 12:27 PM

Hi

Try

Keyboard keyboard = Keyboard.Instance;

keyboard.HoldKey(KeyboardInput.SpecialKeys.CONTROL);

 keyboard.HoldKey(KeyboardInput.SpecialKeys.SHIFT);
 keyboard.Enter(ā€œnā€);

keyboard.LeaveKey(KeyboardInput.SpecialKeys.CONTROL);

 keyboard.LeaveKey(KeyboardInput.SpecialKeys.SHIFT);
 
 
be careful with such tests, in Teardown you should call keyboard.ReleaseAllKeys().
 
It might be that your machine works unexpected if test crash without releasing the hold keys
 

Sep 15, 2011 at 3:48 PM
Hi Throndorin,
Thank you for your reply. I did test the code you have provided and is working. Thank you very much.
Alan