Reading the backspace key.
BlitzMax Forums/BlitzMax Beginners Area/Reading the backspace key.
| ||
Hello! I have a question that one (or several) of you may be able to answer in a heartbeat. I'm having trouble reading the "Backspace" key on my standard us keyboard. I've tried "KeyHit(KEY_BACKSPACE)", "if GetChar() = 8". Neither of them work. The key just gets ignored. -Jim |
| ||
try using this code to find the scancode for it:Graphics 640,480,0,0 While Not KeyDown(KEY_ESCAPE) Cls For Local a:Int = 1 To 256 If KeyDown(a) Then DrawText(a, 10, 10) Next Flip Wend End |
| ||
I had the same problem... here Never got a response so not sure if it's *really* easy and nobody wanted to embarrass me. |
| ||
Strangest thing. KeyDown works, but not KeyHit. Could this be a bug? |
| ||
can you post an example? keyhit works for me: Graphics 640,480,0,0 While Not KeyDown(KEY_ESCAPE) If KeyHit(KEY_BACKSPACE) Then Print "bs" Wend |
| ||
Got it figured out! Thanks! |
| ||
Hold on, my code from months ago *WAS* rubbish...Graphics 640,480 Local t$ While Not KeyHit( KEY_ESCAPE ) Local c=GetChar() If c=8 t = Left$(t,(Len(t)-1)) If c<>8 And c<>0 t:+Chr(c) Cls DrawText t,0,0 Flip Wend |