Advertisement

How to detect if shiftkey left and right isn't pressed

Started by April 24, 2000 11:12 AM
5 comments, last by jairam 24 years, 7 months ago
Do you know a way how to code in C an event for detecting if the shiftkey left and right isn''t pressed? Thanks.
Is it in Windows or DOS. Are you using DirectInput?

Can´t help until I know where to help.
Advertisement
It is in windows 95. I am not using directinput.
Could you give more information about directinput
in relation to solving the problem, please.
Use the Api-function:

if (GetAsyncKeyState(VK_SHIFT) & 0x80)
{
// Key is down
}
else
{
// Key is up
}
You probably know of the WM_KEYDOWN case in winprocedure, which detects if a key is pressed, well just use WM_KEYUP to see if it''s released
How to solve the problem using Directinput?

The not pressed detection must be at the same time,
about the shift left key + shift right key.
Both shift keys have seperate unique functions.
Advertisement
Hi,

The shift left and right key are working. They have both an unique function. Only the problem is when both shift keys are pressed at the same time, one of the flippers (shift key) wil stick in the high animation position.

I found a possible solution for this bug:
> detection if one of the unique shift keys left and right isn''t pressed.
It''s about releasing left or right shift while both shifts are pressed

I got a clue a while ago from someone a clue about the API function. But it isn''t possible with the W9x API, unfortunately.

Does someone know how to solve this bug, please. I heard something about using direct input. How to use this. Can you make an code example related with this problem.

I am looking forward to your reply.

Kind Regards,

Diepek

This topic is closed to new replies.

Advertisement