Bee Eee Blog

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
Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...