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.

Code Snippets / [DBP] Keyboard Input without the input command

Author
Message
Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 30th Jun 2007 22:59 Edited at: 1st Jul 2007 03:36
I just built this for my project, and I bet some people would benefit from it. I believe I have all my scancodes correct, if not, please correct them

Function:


Usage Example:


you'll have to setup someway to know when to update what variable, so your not accidentally updating all your variables at once, lol. You can also add more characters if you want, just add more cases with the correct scancode() and string representation of the key. I had this limited for my own project needs, but people can add whatever they want. Hope this benefits people.

edit:
if all the commands exist in DBC, then there should be no reason why it shouldn't work in DBC. If someone can test it and report, that would be awesome.

BWM


"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."
jasonhtml
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: OC, California, USA
Posted: 1st Jul 2007 01:10
an easier way would be to use the entry$ command... but nice work i guess

Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 1st Jul 2007 03:34 Edited at: 1st Jul 2007 03:35
'entry$' command?? I didn't see that anywhere in the manual...Though at least in my code you can limit the keys for the user to use, and you could even customize it in a sense.

I'm new to programing in DBP, so I have no idea what that command is.


"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 1st Jul 2007 03:35 Edited at: 1st Jul 2007 03:35
DBC doesn't have global variables.

Also, had you noticed that the last 6 Case's were all 38?

Case 38 : S_value$="X" : EndCase
Case 38 : S_value$="C" : EndCase
Case 38 : S_value$="V" : EndCase
Case 38 : S_value$="B" : EndCase
Case 38 : S_value$="N" : EndCase
Case 38 : S_value$="M" : EndCase


TDK_Man

Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 1st Jul 2007 03:38
Ah dang, I feel pretty stupid right now...I should have checked over it once more to make sure it was correct. I copied this from a separate file then from my main source, which I later changed those cases. Reason there that was because I was coping/pasting the same line.

Anyway, I'll make a better snippet post next time, promise.


"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."
Darth Vader
19
Years of Service
User Offline
Joined: 10th May 2005
Location: Adelaide SA, I am the only DB user here!
Posted: 11th Jul 2007 10:25
I made a code snippet to type using the entry$() command. I needed it so I could type in loops!
If you want I could post it?


Login to post a reply

Server time is: 2024-11-22 18:35:46
Your offset time is: 2024-11-22 18:35:46