My GetKey() won't work in text mode.
Archives Forums/BlitzPlus Bug Reports/My GetKey() won't work in text mode.
| ||
When I use GetKey() and press a key, nothing happens. This code continually prints 0s no matter what I do. Repeat Print GetKey() Forever The blitz docs example code won't display anything either. I just updated Blitz, so it should work. My waitkey dosn't work either. However, if I enable graphics mode, they both work. Why? EDIT: KeyDown() won't work either. |
| ||
Try this: repeat a=getkey() if a<>0 then print a until keydown(1)<>0 end |
| ||
The console doesn't respond to key presses, except enter when the input command is called. Use graphics mode for GetKey(). |
| ||
It's because there's nothing to slow it down. The GetKey() displays something, but it isn't on the screen for long enough to be rendered by the monitor. Through in a "delay 100" and you'll be able to see it. |
| ||
As far as i know, GetKey wont work in the Console If you have a Graphis/CreateWindow it will work Graphics 300, 300, 32, 2 SetBuffer BackBuffer() Repeat localChar = GetKey() If localChar > 0 Then currentText$ = Chr$(localChar) ascii = localChar EndIf Text 0, 0, "ASCII Code: " + ascii Text 0, 10, "LETTER: " + currentText$ Flip Cls Until KeyDown(1) End |