View Poll Results: Is it even possible to do it? (post why)
- Voters
- 2. You may not vote on this poll
-
April 2nd, 2004, 07:03 AM
#1
Hijacking keyboard and mouse datastream
Hi!
Im currently (trying) to learn C++
I just had a pause (as i was overwhelmed) and to get me started again my brother gave me this challenge.
Simply put, he needs a program that runs in the background, and when he then click a button (example 'b') it should for a short period (1-2 secs) take over his keyboard and mouse, clicking specific buttons and the right mouse button.
After that, it should return control to him.
If somebody could please send me a source code with documentation and a few pointers about how it works, then i'll do the rest.
Email: [email protected]
Or just reply here, i'll watch this thread for some time (a week or so, max)
Last edited by TCR_A1; April 2nd, 2004 at 07:06 AM.
-
April 2nd, 2004, 09:01 AM
#2
Please, anybody got a clue?
If so, just a little clue and i'll be happy.
Give me something to work with!
-
April 2nd, 2004, 09:05 AM
#3
I'll give you the hint....Look for "Hooks"..."System Hooks" "Keyboard Hooks" "Mouse Hooks"
Have phun!
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
April 2nd, 2004, 09:51 AM
#4
sounds interesting, i'll look for it.
BTW, that doenst stop y'all to contribute!
Hints? Clues? SOLUTIONS?
-
April 2nd, 2004, 11:51 AM
#5
Seached on it.
A little confused, but i think i manage...
However, this only detects systemwide keyboard and mouse INPUT, but how to change that input through manipulation?
So that when i run the program, everytime i hit 'b' the program will hit 'g' 'LeftClick' 'n' 'LeftClick' 'F5' son on so forth.
How is this possible, if it is?
-
April 2nd, 2004, 12:12 PM
#6
Simply hange the key within the handler.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
April 2nd, 2004, 12:19 PM
#7
Sounds simple, all in one sentence.
..
Didnt understand
Understand, im COMPLETELY new to C++, i only know how to do things like getting to program to calculate, accept input and doing loops and variebles so on and so on.
So, i would REALLY like some background info, including a sample source code doing what im asking for, with comments and documentation 
Hey, my brother just said he would pay me 100 DKK (Danske Kroner) Danish valuta
For it!
Rocks... if i can get it to work
-
April 2nd, 2004, 12:42 PM
#8
i give you just one little implementation 
Code:
while ( true )
{
if ( GetAsyncKeyState(VK_ESCAPE) )
{
MessageBox(0, "***? The Escape button was pressed!", "*omfg*", 0);
}
}
Have fun
-
April 2nd, 2004, 12:50 PM
#9
errr, thanks
What i meant was, that when i - example - press the button 'b' with the program running in the BACKGROUND the program will press 'f' 'u' 'c' 'k' 'Enter' in the program currently in front (chat joke)
So, it detects im hitting 'b' even through the program is running in the background (something about dlls and system wide... i figure that out later) and then it injects DIRECTLY into the keyboard input steam what i ask it to.
So that logically effects the program that is focused/in front.
Let me be more specific.
My big brother needs a program to use with Diablo 2 LoD, becouse EVERYTIME he joins a game he have to activate over 6 spells, 2 of them 3 times, so he asked me - thinking i was the big computer programmer (not) - to program him a program that detects him pressing 'b' and then it would fire off all his skill shortcuts encompanied by the mouse clicks needed to fire off the "spells"/skills.
I thought "why not" "easy money" (he would gibe me 100 DKK) i just take up learning C++ again and see what i can do.
Well, it was soon revealed to be more complicated then expected....
So i seached, seached and then asked here.
Oh, and btw NoHero, what liberies(SP!) should i use for that implantmentation? (include <stdio.h> blah blah...)
Last edited by TCR_A1; April 2nd, 2004 at 12:56 PM.
-
April 2nd, 2004, 01:33 PM
#10
Anyone know how to do this?
-
April 2nd, 2004, 10:02 PM
#11
Keyboard hook, eat the b key and put out the rest of them that you need. I've posted examples in the past.
-
April 4th, 2004, 03:08 AM
#12
I do not know if the hook approach may work in games, since games are using DirectInput.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|