Input hangs
Blitz3D Forums/Blitz3D Programming/Input hangs
| ||
Hello, I'm writing a textbased adventure using Print and Input. Irregularly, but frequent, the program hangs on Input. Has anybody else experienced this? I'm using Vista, btw. |
| ||
Depends what you mean by 'hangs'? When you use Input(), program execution is halted until you press Enter (i.e. the Input function has completed). This is normal. Or did you mean something else? |
| ||
Perhaps try your own custom Input solution. It's much more fun this way. |
| ||
No, not the usual Input behaviour. The cursor disappears, and the program doesn't respond to the keyboard or the close button. I tried both debug and runtime. It doesn't happen every time, but quite often. I never experienced anything like this, but then again, I haven't used Input that often in Blitz3D. The reason for using Input, is that I am writing an example for a computer programming course for beginners. |
| ||
out of curiosity, when is the last time you reset your computer ? |
| ||
Input isn't a good example for backward compatibility in DirectX. I also experienced problems, eg. the Question was printed black on black (regardless of Color), so the users had no idea what to enter. I remember there was a command to turn of DirectInput, maybe this was only for the Mouse? I don't recall, but this one is definitely missing in the Manual: EnableDirectInput 1 ( or 0 I assume) |
| ||
out of curiosity, when is the last time you reset your computer ? Actually, today. I booted, checked my email and wrote the program. the users had no idea what to enter. :)Jfk, thanks for the EnableDirectInput suggestion. I'll try it. And backwards compatibility.. right. Well, I am setting the graphicsmode to 1024x768, but I didn't specify the output buffer. Perhaps sometimes the Input cursor somehow ends up on the BackBuffer for some reason. I'll throw in a SetBuffer FrontBuffer() as well and see how it goes. |
| ||
Well one thing that you could do is give a warning that the person should restart their computer or the game might not work properly. Simple fix. |
| ||
Well one thing that you could do is give a warning that the person should restart their computer or the game might not work properly. Simple fix. Post-install excepted, have you ever seen a game tell you to do that every time you play it? |
| ||
here is a test program does it run ok?a$="I know you are but what am I?" While True Print a$+"["+b$+"]" b$=Input("?") Wend |
| ||
I have the same problem happening sometimes. I've written a Maze Generator, where the user must input how big the maze should be. Sometimes as soon as I hit the enter key (after inputting the value), the program hangs and won't go further. I know the maze generator works perfectly, because after the input statement, I printed the value to the screen, before the generator does it's work, and that line doesn't show up when Input hangs. So it's definately a problem with the Input function. |
| ||
Skidracer, I can't seem to reproduce the error at will. It randomly occurs. I tested your program numerous times, but both your and my program seem to work normally today. My version is basically the same, with two differences: I use Graphics 800, 600, 0, 2, some Goto's and more Print statements, so the screen scrolls more often. The symptoms are: Input cursor dissapears, program doesn't respond to keyboard input. Almost like the focus is gone. Clicking on the window's caption and moving it a bit around seems to help sometimes. And in some situations, the cursor reappears after a few seconds. |
| ||
maybe a trojan or key loger is catching your inputs :) |