Jump to content
  • Advertisement

Archived

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

BlackHC

stupid question

This topic is 5638 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

Is it neccessary to use TranslateMessage() if you're only interested in WM_KEYDOWN and WM_KEYUP messages ? Thanks BlackHC I do know that I don't know anything. [edited by - BlackHC on April 18, 2003 1:56:23 PM]

Share this post


Link to post
Share on other sites
Advertisement
That's not an answer !
I do know that this function in normally in the message loop, but is there any difference if I don't use TranslateMessage() in the MESSAGE LOOP when I'm only interested in WM_KEYDOWN and WM_KEYUP messages ?

BlackHC



I do know that I don't know anything.

[edited by - BlackHC on April 18, 2003 1:56:34 PM]

Share this post


Link to post
Share on other sites
Here's a brilliant idea for you:

Why don't you try it and see! Just think, 2 minutes of coding could give you the answer to all your questions! Isn't it ingenious?

If that's too much effort, you could read the MSDN docs to see exactly what the function does, and think for yourself whether it's necessary or not.

[edited by - micepick on April 18, 2003 12:12:03 PM]

Share this post


Link to post
Share on other sites
1. That wouldnt be just 2 minutes for me :-/
2. Yes - I looked into MSDN docs what this function and the rest of them in the message queue do.
3. And yes, I''ve also tested it and it works.
I wantet just to know if anyone perhaps knows whether there is such tricky stuff with keyboard messages like with mouse messages for example.

Well, this post wasn''t very intelligent, I do know. But I just thought that I could also post once such a question like lots of people post here every day.

BlackHC

I do know that I don''t know anything.

Share this post


Link to post
Share on other sites
You only need to use TranslateMessage if you want to check for WM_CHAR messages instead of certain combinations of WM_KEYDOWN and WM_KEYUP. There''s a similar function TranslateAccelerator that turns key press messages into menu commands.

The only similar thing for mice is client-area coordinates (relative to the top left corner of your application''s drawing area) are used in some places such as WM_MOUSE* messages, and screen coordinates (relative to the top left corner of the screen) are used in others such as the GetCursorPos function. Sometimes you need to translate between the two with the functions ScreenToClient and ClientToScreen.

Share this post


Link to post
Share on other sites
Thanks very much for your answer.
I''m just getting into the win32 user input stuff, because I always worked with DirectInput before.

BlackHC

I do know that I don''t know anything.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!