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 Discussion / Is this possible?

Author
Message
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 11th Feb 2005 04:13
I need to make the computer think that the user pressed the enter key without the user actually pressing it. I wrote some interesting code that can do some really cool stuff , but the only thing is that the user has to press enter like a couple thousand times. Is there any way I can write some code to do this?

Lost in Thought
21
Years of Service
User Offline
Joined: 4th Feb 2004
Location: U.S.A. : Douglas, Georgia
Posted: 11th Feb 2005 04:32
Yes it is possible. Just write the code so the keystate of the enter key makes the stuff happen instead of using input or some other prefab code where you just absolutely have to press enter to save data. Then you make a variable and set it to 0. Go back and change the code for the enter key to include the new variable (add or var_name = 1). Then all you have to do is change the variable to 1 instead of 0 when you want it to fake pressing the enter key.

Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 11th Feb 2005 22:51
Thanks
Just one last question, whats the Scancode for "Ctrl-V" ???

New World Order
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location:
Posted: 12th Feb 2005 03:52 Edited at: 12th Feb 2005 03:56
errrmm I'm not an expert, but as far as i know, there are no scan codes for key-combinations, so i would suppose that you should have to IF's on with the CTRL one with the V

now.. i havent tried this, but i suppos it should work.

//[EDIT] i just tried it and it works perfectly. the only problem about it is that there might be difficulties if you have other tasks for the CTRL/V keys... these actions will be carried out along with the CTRL+V action

"Wise men talk because they have something to say; fools, because they have to say something." -Plato
GameVille
20
Years of Service
User Offline
Joined: 25th Oct 2004
Location:
Posted: 12th Feb 2005 18:57
Or youse the boolean operator "and":



Just change xy and xyz with the right numbers.

Germany ~~~ a undergoing state ^^
New World Order
20
Years of Service
User Offline
Joined: 31st Oct 2004
Location:
Posted: 12th Feb 2005 21:17
duh why didnt i think of that lol
that definately is a nicer way to do it

"Wise men talk because they have something to say; fools, because they have to say something." -Plato
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 13th Feb 2005 10:40
Thanks, works perfectly

Login to post a reply

Server time is: 2025-05-29 11:17:21
Your offset time is: 2025-05-29 11:17:21