Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

jairam

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

This topic is 6933 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Do you know a way how to code in C an event for detecting if the shiftkey left and right isn''t pressed? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Is it in Windows or DOS. Are you using DirectInput?

Can´t help until I know where to help.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It is in windows 95. I am not using directinput.
Could you give more information about directinput
in relation to solving the problem, please.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Use the Api-function:

if (GetAsyncKeyState(VK_SHIFT) & 0x80)
{
// Key is down
}
else
{
// Key is up
}

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!