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.

DarkBASIC Professional Discussion / Smooth text input

Author
Message
Valdez515
17
Years of Service
User Offline
Joined: 4th Jul 2009
Location: United Kingdom
Posted: 23rd Dec 2011 23:12 Edited at: 23rd Dec 2011 23:13
I wanted to use D3DFunc and request a text input from the user like so:



vtp represents "Vertical text position", ie. where the text should be along the y axis.

The issue is that at high typing speeds, two of the same characters in a row are not counted, adjusting this means often several characters are printed by unintentionally.

Is there any way to achieve the same effect as the "Input" command? How does that work?

[Insert witty remark here]
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 23rd Dec 2011 23:32 Edited at: 23rd Dec 2011 23:34
Hi Valdez

You are able to use the entry buffer to get input from the user. Here's an example:



TheComet

Valdez515
17
Years of Service
User Offline
Joined: 4th Jul 2009
Location: United Kingdom
Posted: 23rd Dec 2011 23:53
Thanks. I'll use that.

As a side note, if anyone here knows how the keyboard actually operates in such a way, I'd be interested to hear it.

[Insert witty remark here]
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 24th Dec 2011 00:11
Quote: "As a side note, if anyone here knows how the keyboard actually operates in such a way, I'd be interested to hear it."


Hmm, well every motherboard has an I/O controller which communicates with external devices. Whenever it gets input from a device, it is written to an input buffer. This runs separately from anything that the CPU is doing. Every once in a while the CPU will decide to check if something is in the input buffer. If so, it reads it in for further processing.

So if the CPU is too busy to read and the user has a ridiculous typing speed, the input buffer will still capture all of the information you typed in.

TheComet

Valdez515
17
Years of Service
User Offline
Joined: 4th Jul 2009
Location: United Kingdom
Posted: 24th Dec 2011 01:23
Interesting. Thanks.

[Insert witty remark here]

Login to post a reply

Server time is: 2026-07-09 20:54:55
Your offset time is: 2026-07-09 20:54:55