Hi I need help with the use of doing simulating key press. I've been to MSDN and seen what they said about it, but I dont fully get it what they are showing me. I know this sites good at showing/telling the use of code so I am hoping.
Hi I need help with the use of doing simulating key press. I've been to MSDN and seen what they said about it, but I dont fully get it what they are showing me. I know this sites good at showing/telling the use of code so I am hoping.
getch()
Here is a few example programs of it's use by moi.
Sent from my iPadŽ
Thanks i'll take a look at thes.
Oh... no this is not what I am talking about. Thes see what you type then echo it back. What I want to do is simulat a keypress like a marco with my programe, so that it types out on other programs also.
Last edited by adr; 12-24-2005 at 02:14 PM.
On Windows, something like this:
?Code:keybd_event( VK_RETURN, 0, 0, 0 ); keybd_event( VK_RETURN, 0, KEYEVENTF_KEYUP, 0 );
keybd_event
On NT, 2000, and XP, you're supposed to use SendInput function, but I never could figure out how to use it.
From C to shining C++!
Great graphics, sounds, algorithms, AI, pathfinding, visual effects, cutscenes, etc., etc. do NOT make a good game.
- Bubba
IDE and Compiler - Code::Blocks with MinGW
Operating System - Windows XP Professional x64 Edition
Ya I seen that used but I cant figer it out my self. Trying to understand it with NSMD but their way of showing is a little not thereXD.
How about google?
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
LOL, yes, I did try that. I also try yahoo. I dont get much help on thos that great.
You're trying to figure out how SendInput works?
Try searching this board: http://cboard.cprogramming.com/searc...earchid=289138.
[edit]
Maybe codeplug's links at the end of this thread.
[/edit]
Last edited by dwks; 12-24-2005 at 02:46 PM.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
LOL goo thinkingXD i'm looking at like 20 websits for thisXD My head isnt thinking very good.
Ok I found some new stuff on it and that I get with more working with the code. I'll check it out how ppl are setting it up on theirs and try to work with it for my use. Thanks^.^
Last edited by adr; 12-24-2005 at 03:05 PM.
Hi again, sorry I didnt want to make another post on this seeing as its the same thing as befor. Ok i've been almost everwhere trying to learn this I mean I dont have a problem LOL, but i've seem some differnt ways on how to simulate a key pressing. Like keybd_event() I can get this one, i've also seen SendInput(), SendMessage() and PostSendMessage () ,or something like that. I didnt see on much like how to use them tho, what I mean is, go in detail on them mostly. Yes i've look them up, but I had no luck on it much for how to use them. I was just asking if maybe someone could help me on the details a little on them or maybe make a little examples on them so I can see how to use them mostly.
For keybd_event() I got this working ok.
It simulates a "s" key, but even then I dont know much on whats going on in it. I do get most of it, like the top part is pressing the key then the botten part "un"press the key. The 0's I dont know much on tho. Sorry I dont mean to ask something so hug, I just like understand what something does befor using it really.Code:keybd_event(0x53, 0, 0, 0); keybd_event(0x53, 0, KEYEVENTF_KEYUP, 0);
Last edited by adr; 01-02-2006 at 04:35 PM.