Jump to content
  • Advertisement

Archived

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

SubUrban

directinput - release mode

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

Hi! I compiled my game in release mode and noticed a problem. My arrow keys and num keys stoped working. If I put my code on A-Z everything works fine. Anyone knows what I should look for to solve this? thanks!

Share this post


Link to post
Share on other sites
Advertisement
This is a problem which is appearing quite frequently on these pages. Basically, you will be storing the input data in a ''char'' datatype instead of an ''unsigned char''. This means the most significant bit is being interpreted as a sign-bit, giving you the wrong value (a negative value) when it is set.

So, changing the variable/array the data is written to into an unsigned char will fix it.

Cheers,
John

Share this post


Link to post
Share on other sites
thanks!
I noticed there where something wrong since I got a compile warning, but I just changed the char to int..does it matter? is char 32bit? (I may just have been miss informed but I thought I should always try to use 32bits datatypes for (maybe a very minor) increase in speed)

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!