GetKey() Help.

Blitz3D Forums/Blitz3D Programming/GetKey() Help.

Sounded simple enough.

I wanted to make a key-remap feature for my game. Gamasutra even noted it as a "Twinkie Denial Condition", meaning that it was a big no-no for today's games not to include a key-remap. Well, at least for games that use more than the mouse and maybe a button.

Anyways, I managed to use GetKey in order to grab all of those ASCII characters on the keyboard for remapping. It grabs them fine, and I use manual trapping using KeyDown() to grab all the other non-important keys such as Shift, Ctrl , Alt and the likes.

Unfortunately, in my game, GetKey isn't giving me anything. Not when I hold the key, and not when I tap it. Nothing, ever.

I made this line of code into my editor to make sure it wasn't some coding bug of my remapping options:

DebugLog Chr(GetKey())

No luck, it simply is making new lines constantly in the debug log.

I used this code to see if the correct key was hit. I'm simplifying it as the actual variables differ.
Tag$ ;stores the string representation of the character
     ;simple 1 len ASCII for ASCII characters, names like
     ;"R SHIFT" and "L ALT" for others
scan ;stores the ASCII code for ASCII characters and the
     ;scancode for non ASCII characters
If (KeyHit(scan) And Len(tag$) > 1) Or (GetKey() = scan And Len(tag$) = 1)
   IonKey = True
EndIf



Is GetKey somehow restrictive on time. If it is I am really going to have to think, as I don't want to have to individually make a comparison chart for every keyboard character to each scancode.