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 / entry() for non-character keys?

Author
Message
Aurum Knight
17
Years of Service
User Offline
Joined: 15th Jul 2008
Location: the suburbs of nowhere
Posted: 2nd Jul 2011 18:03 Edited at: 2nd Jul 2011 18:04
Hey, is there a way to get the input for non-character keys like the left arrow key, delete, or anything else otherwise not returned by ENTRY(), that allows for repeating when you hold it down long enough?

I suppose I could just do it manually by adding some sort of timer, but I'd rather do it in a way that corresponds to the repeat speed of the windows settings' speed the user has.
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 2nd Jul 2011 19:27 Edited at: 2nd Jul 2011 19:28
Probably the best way is the way you describe with KEYSTATE() and TIMER(). You can find the current keyboard speed in the registry under HKEY_CURRENT_USER\Control Panel\Keyboard (see attached image). Just load that up and make up a timer formula based on the keyboard speed setting. If you want help reading/writing in the registry just let me know.

Aurum Knight
17
Years of Service
User Offline
Joined: 15th Jul 2008
Location: the suburbs of nowhere
Posted: 2nd Jul 2011 20:37
Oh cool, I always wondered where those values were.

Hmm, it seems Get Registry$ doesn't work...


This comes up blank...
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 2nd Jul 2011 22:21 Edited at: 2nd Jul 2011 22:24
That's weird... it didn't work for me either.

Even the old school method didn't work:


The above should create a file called RegCheck.reg with all the data from that registry entry but it doesn't work at all.

Aurum Knight
17
Years of Service
User Offline
Joined: 15th Jul 2008
Location: the suburbs of nowhere
Posted: 2nd Jul 2011 23:24
Hmm, that's weird. I looked around on the forums and it seems there are some problems with the Get Registry$ command

I'm probably just going to pick the values myself. Even if I had those windows values, I still don't know how many milliseconds those values would translate to, they seem to just be arbitrary numbers without any time in milliseconds. I guess it doesn't matter so much that this matches Windows, so long as it's usable.

Thanks for the help though
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 3rd Jul 2011 01:23
Np. You could always add the delay as a setting in your own program thus eliminating the need to see what windows is set at.

Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 4th Jul 2011 00:36 Edited at: 4th Jul 2011 00:36
Get Registry$() can only return from HKEY_LOCAL_MACHINE (or if it was HKEY_LOCAL_USER) I believe.
There should be some dll's around that will let you read and write to the other folders as well.


"Why do programmers get Halloween and Christmas mixed up?"
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 4th Jul 2011 10:41
What scares me is the old school method (using REGEDIT itself) won't export that information when it should no matter where it's located in the registry. It still saves anywhere in the registry though.

Login to post a reply

Server time is: 2026-07-11 02:36:43
Your offset time is: 2026-07-11 02:36:43