4

I'm trying to hold down CTRL while C is pressed but I can't get it work. I've read SendKeys Class but still, it doesn't work.

Thats what I've tried:

SendKeys.SendWait("^C");
SendKeys.SendWait("{^C}");
SendKeys.SendWait("^{C}");
SendKeys.SendWait("^(C)");
SendKeys.SendWait("(^{C})");
Ali Vojdanian
  • 2,067
  • 2
  • 31
  • 47
Patryk
  • 3,042
  • 11
  • 41
  • 83

4 Answers4

8

You need to put in parenthesis. Example:

SendKeys.SendWait("^(c)");

Notice that c should be lowercase. It is case sensitive

Isma
  • 14,604
  • 5
  • 37
  • 51
Jonas W
  • 3,200
  • 1
  • 31
  • 44
2

use + instead of ^ for shift and put in parenthesis. (^ for control and + for shift; in your question you said shift). And remember c must be in lowercase.

SendKeys.SendWait("+(c)");
UserMat
  • 600
  • 4
  • 10
  • 27
PraveenVenu
  • 8,217
  • 4
  • 30
  • 39
0

You should use a lower case 'c'.

This should work just fine: SendKeys.SendWait("^c");

Silas
  • 40
  • 7
  • How is this different from [the top-voted answer](https://stackoverflow.com/a/34786914/3025856)? I get that you're not using the inner parenthesis, but in terms of functional differences, isn't your suggestion identical? – Jeremy Caney Dec 27 '21 at 00:28
  • You are right, but in my experience my answer is slightly more clear and to the point. However, it is a bit of a duplicate answer. Should I delete mine? – Silas Dec 27 '21 at 08:04
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/30677652) – eglease Dec 27 '21 at 23:07
0

If you're trying to do SHIFT while pressing C, you're using the wrong codes. ^ is CTRL. Shift is +.

norway-firemen
  • 395
  • 4
  • 21