Skip to main content
gamedev.net
🔒 Locked

directinput - release mode

Started by SubUrban Sep 30, 2002 at 2:57 AM 1 replies 300+ views
Original Post
SubUrban
SubUrban
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!
John Reynolds
John Reynolds
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
John ReynoldsCreative Asylum Ltdwww.creative-asylum.com
SubUrban
SubUrban
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)

Topic Locked

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

Sign in to reply to this topic.