Skip to main content
gamedev.net
🔒 Locked

Keyboard Hook problem

Started by Ranthalion Jul 22, 2003 at 7:56 PM 1 replies 550+ views
Original Post
Ranthalion
Ranthalion
I have a keyboard hook set up. I''m monitoring for Alt+L. The hook picks up the Alt+L well enough, but it executes the code for it twice.

        //PRESSED IS A BOOL THAT IS ASSIGNED FALSE AT APP INIT

	if (hooked->vkCode==0x4C && hooked->flags & LLKHF_ALTDOWN)
			if(!PRESSED)
			{
				messageBox(NULL, "BOO","BOO", MB_OK);
				PRESSED=TRUE;
				GetPassword();
				if (result==TRUE)
					UnlockStation();
				Sleep(20);
				PRESSED=FALSE;
			}
I''ve tried using a BOOL flag to prevent it from being executed twice, but this doesn''t seem to help either... Am I doing something wrong? How could I fix this?
Ranthalion
Ranthalion
Good idea about just posting a message. Thanks for your help AP.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.