Archive for January 9th, 2008
Getting the current state of keyboard and mouse.
by brian on Jan.09, 2008, under Uncategorized
Every once and a while I need to know whether the Control key is being pressed when I process a mouse event. And sometimes I need to know the mouse position when a key is hit. Of course the keyboard modifiers aren’t passed in mouse events and the mouse button state isn’t passed in the keyboard events.
No problem. For keyboard modifier state use these properties:
Control.ModifierKeys
For the mouse state use these properties:
Control.MouseButtons Cursor.Position // this one you can set :) Control.MousePosition
