1

I'm writing a small program for add mouse inputs to another program. For this when mouse scrolls up I must send LeftShift+UpArrow and when mouse scrolls down I must send LeftShift+DownArrow. How can I send this?

I can't use Shift, it must be LeftShift.

halil12
  • 85
  • 1
  • 9

2 Answers2

0

You can use SendKeys though I recommend avoiding it if there's any better method.

 SendKeys.Send("+{DOWN}");

That's 'shifted down arrow'... I don't see a specific left-shift option on the key list, sorry.

mcmonkey4eva
  • 1,359
  • 7
  • 19
0

You could use scancodes to determine which shift key is being pressed, I think left-shift is 44 on most keyboards, whikle right-shift is 56 or 57. That's not a constant, however, as different keyboard layouts produce different scancodes, so you would have to ask the user to press the left shift key and then get the scancode and store it for that user. Later use of the application would compare the keypress scancode to that value.

Ive edited this to add this link to an indepth treatment of scancodes:

simulating key press event using SendInput with C#

Community
  • 1
  • 1
John Faulkner
  • 990
  • 7
  • 10