How do I know if a shift is clicked using RawInput?

I use RawInput to work with keystrokes. I find it difficult to determine if a key with a key is pressed.

From RawInputStructureRawKeyboard , I can get a keystroke, but I'm not sure how to go about things, if the keys are pressed simultaneously.

RI.Data.keyboard.VKey (gets the key code)

I try to separate Shift for each user / keyboard, because at the moment when one user / keyboard shifts everything that does, the same with Capslock. Simultaneous typing becomes very dirty.

How do I know if a shift is pressed along with another key? Am I looking for it in the correct structure or should I look elsewhere?

+5
source share
2 answers

There is no such thing as pressing two keys at the same time. One goes down and then another. You should be notified separately. When the shift key is pressed or released, set or clear the flag in your program to remember its current state.

, . . GetKeyState, GetAsyncKeyState, . ( , , , , , .)

+6

:

  1. Shift , true
  2. , 1
  3. , , , Shift
  4. Shift false.
0

All Articles