getKeyText Issue
Posted: Thu Jan 05, 2006 7:54 pm
I am trying to code a feedback which evaluates the keyboard input. I have searched the forums and the tutorial and have made it nearly work, but am now stumped.
This is supposed to play a cheering sound if you press A and an oops sound if you press any other key. I can only get oops to run. I pirated code from the turorial and created a txtguy actor to see what the return data looks like and the key names appear on screen as expected.
I am new to C and am guessing this is a data type issue. Thanks for any help!
Rob
The code is:
This is supposed to play a cheering sound if you press A and an oops sound if you press any other key. I can only get oops to run. I pirated code from the turorial and created a txtguy actor to see what the return data looks like and the key names appear on screen as expected.
I am new to C and am guessing this is a data type issue. Thanks for any help!
Rob
The code is:
- Code: Select all
int keyCode = getLastKey();
if(getKeyText(keyCode) == "A"){
PlaySound2("data/cheer.wav", 1.000000, 1, 0.000000);
}
else{
PlaySound2("data/oops.wav", 1.000000, 1, 0.000000);
}
strcpy(textguy.text, getKeyText(keyCode));