#53475 - Cidrick - Thu Sep 08, 2005 5:15 pm
I'm writing a program and I've run into an issue that I can't quite figure how to get around. My code is something like this
This partially works. If I'm holding down the A key and then press or hold right, it does what I want it to. However, if I'm holding down the A key, then press right and let go, for whatever reason (keysHeld() & KEY_A) becomes false. It seems that if you're holding down two keys and you let go of one, it thinks you're letting go of both of them.
Am I missing something or is this an issue with the devkit?
Code: |
...
if (keysHeld() & KEY_A) { if (((keysHeld() & KEY_DOWN)||(keysDown() & KEY_DOWN))) { // move down code here } else if (((keysHeld() & KEY_UP)||(keysDown() & KEY_UP))) { // move up code here ... |
This partially works. If I'm holding down the A key and then press or hold right, it does what I want it to. However, if I'm holding down the A key, then press right and let go, for whatever reason (keysHeld() & KEY_A) becomes false. It seems that if you're holding down two keys and you let go of one, it thinks you're letting go of both of them.
Am I missing something or is this an issue with the devkit?