Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / keyboard input help, please

Author
Message
Dracula
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: DBP Recreation of Castle Csejthe
Posted: 1st Nov 2006 22:58 Edited at: 1st Nov 2006 23:01
Hello,

I am working on keyboard interface for my program. It works if I type at a slow to moderate speed, but If I type at my usual (lighing fast) speed, I get tons of missed strokes. Will someone please take a look at this code and tell me how I might be able to avoid the missed strokes. I have it inside a loop, because it will endup being a function in a game, so with that on top of this little bit of code, I imagine it may be even slower! I've run this with and without sync, it makes no apparent change in speed.



Thanks for any help!!!

D
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 1st Nov 2006 23:20
Instead of inkey$() or scancode() use:
entry$() (incorrectly listed as entyr$() in the DBC help files)
and clear entry buffer on the very next line...

entry string messes-up with non-printing characters like Backspace, cursors, control, or more simply: any key that isn't a letter, number, or symbol.

You have to check these manually with inkey$() or scancode(), and clear entry buffer before you read entry$() to get rid of them, otherwise a vertical line is displayed where that character was pressed...
Dracula
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: DBP Recreation of Castle Csejthe
Posted: 1st Nov 2006 23:43
Thank you, Simsmall. I am going to give that a try!

Login to post a reply

Server time is: 2024-09-25 11:33:02
Your offset time is: 2024-09-25 11:33:02