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 / Username/password inputs

Author
Message
Hadou
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 19th Oct 2008 03:34
Hey again guys, been playing around with a bit of code, trying to get text imputs of user_data into fields and being able to enter/tab and move between them..

I got this code



it basically does what its ment to, the only problem is ... its alittle slow, anyone that can type maybe 30/40 words per minute can out type it.

Other would be using the SHIFT key, as the shift key counts as a key press, but doesnt have an INKEY$ value, you have to hit the key twice to as an @ symbol for example.

If there are anyways of getting around it. I tried using keystate(42/54)(l/r shiftkeys) but couldnt seem to get that to work, or perhaps even a different way of coding it, help would be a appreciated cheers.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 19th Oct 2008 17:39
Use the entry buffer$() commands instead of inkey$(); it stores all received input until you purge the buffer yourself.
Also, you can use asc() on its characters to find ie. tab pressed (which would be asc() = 9) and so on.
Check up an ASCII table (google it) for more keycodes.

"I kören hörs de brummande busarna Björnligan och Gondolen"
Hadou
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 19th Oct 2008 19:35 Edited at: 19th Oct 2008 22:45
Hahah thanks Rudolpho, Thats exactly what I did using the buffer entry.

That solved the init problems that I had, but now I seem to have created a 'problem' (its not so much a problem, just alittle buggy.. that sometimes it double deletes, others single and with so little code my brain is going mental cos ive tried to work it out.




as you can see i remove 2 characters from the right of the word.. if I dont it seems to add a space in somewhere then stops being able to delete.

If someone could have a quick flash over the code and probbly find where the +" " is coming from if appreciate it.


P.s If anyone has any idea why/if its not possible to use keystates within the functions, or if the button has to be pressed while the function is running.. lemmie know.

Login to post a reply

Server time is: 2024-11-24 19:55:13
Your offset time is: 2024-11-24 19:55:13