PDA

View Full Version : how do I check if the shift key is depressed?



09-27-2003, 11:00 AM
How can I check if the shift key is depressed? It isn't registered by glutKeyboardFunc or glutSpecialFunc, and shift-arrow key is the same code as just arrow key.

Nick Nougat
09-27-2003, 11:25 AM
You can use the win32 function
GetKeyState()

with parameter VK_LSHIFT VK_RSHIFT or just VK_SHIFT for any of both shift keys

it's defined as:

SHORT GetKeyState(
int nVirtKey // virtual-key code
);

09-27-2003, 12:53 PM
great, thanks

Jan
09-28-2003, 06:15 AM
You know what "depressed" really means, donīt you?

I think itīs really nice of you, that you care for the feelings of your keyboard http://www.opengl.org/discussion_boards/ubb/wink.gif http://www.opengl.org/discussion_boards/ubb/biggrin.gif

Jan.