Combining keys like ctrl+c

Feb 23, 2010 at 6:04 PM

How can I do this? I've tried this with the KeyIn methode of the textbox element and with keyboard.HoldKey() but nothing works.

here is an example I've tried

var keyboard = White.Core.InputDevices.Keyboard.Instance;
keyboard.HoldKey(KeyboardInput.SpecialKeys.CONTROL);
keyboard.HoldKey(KeyboardInput.SpecialKeys.SPACE);
keyboard.LeaveKey(KeyboardInput.SpecialKeys.CONTROL);
keyboard.LeaveKey(KeyboardInput.SpecialKeys.SPACE);

Can someone hlep me out?

regards

Armin

Feb 23, 2010 at 9:37 PM

Can you try:

White.Core.InputDevices.AttachedKeyboard kbd = mainWin.Keyboard;
            kbd.HoldKey(White.Core.WindowsAPI.KeyboardInput.SpecialKeys.CONTROL);
            kbd.PressSpecialKey(White.Core.WindowsAPI.KeyboardInput.SpecialKeys.SPACE);

Feb 24, 2010 at 7:34 AM
Edited Feb 24, 2010 at 8:23 AM

I agree,

YourUIItem.Click();
Keyboard.Instance.HoldKey(White.Core.WindowsAPI.KeyboardInput.SpecialKeys.CONTROL);
Keyboard.Instance.PressSpecialKey(White.Core.WindowsAPI.KeyboardInput.SpecialKeys.SPACE);
Keyboard.Instance.LeaveAllKeys();

Nov 1, 2010 at 6:10 PM

But how do I generate Ctrl-C?

Nov 2, 2010 at 7:52 AM

 

Hi

we use this:

Keyboard keyboard = Keyboard.Instance; keyboard.HoldKey(KeyboardInput.SpecialKeys.CONTROL); 
Thread.Sleep(50); keyboard.Enter("c"); Thread.Sleep(50);
keyboard.LeaveKey(KeyboardInput.SpecialKeys.CONTROL);

 

in some cases a short Thread.Sleep(50) is useful to be sure the method works on each machine independent from machine performance.

 

Throndorin

Nov 2, 2010 at 8:09 AM

Ah right.  One must use a lower-case "c", rather than "C".  Thanks for the help!

Coordinator
Nov 21, 2010 at 4:41 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.