Approaching /click from a DirectX angle

A forum for feature requests/discussions and user submitted patches that improve MQ2

Moderator: MacroQuest Developers

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Wed Apr 09, 2003 5:50 am

Has anyone looked into the SendInput function detailed here?

http://msdn.microsoft.com/library/defau ... dinput.asp

This can be used to insert events into the mouse and keyboard input stream.

Since I work on the Unix side of things I don't know much about programing in a windows environment but this looked promising.

Sorry for posting this again but it looked like the other forum was not being used anymore.

Thanks

Vaft
a lesser mummy
a lesser mummy
Posts: 69
Joined: Fri Mar 07, 2003 6:39 am

Post by Vaft » Wed Apr 09, 2003 6:39 am

Grimjack,

SendInput only works for applications that use the windows interface. It is easy to send mouse/keyboard input to a windows application.. But it's not so easy for a directx app.

When I first started playing with trying to figure out /click, I succeeded in making an app that automatically logs in to everquest for me, typing out my login info, then clicking connect, but it doesn't work after directx is initialized.

Directx reads raw data from the mouse, it skips over all of the windows API crap, so trying to synth a click is pretty much hopeless from that angle. (for someone of my programming experience, anyway.)

People have told me that the only way to get it to work is to write my own mouse vxd, and that is way above my capability. I assume that is how xylobot does it, although I've never looked at it myself.

User avatar
grimjack
Macro Author
Macro Author
Posts: 525
Joined: Thu Nov 07, 2002 6:51 am
Contact:

Post by grimjack » Wed Apr 09, 2003 9:13 am

Thanks for the reply. I had been reading up on some of the windows API functions and saw that. At first I had thought there was no way it would have been missed by you guys and wasn't going to bother with posting it untill I saw a Q.and A. on msdn that was somthing like this:

Q: Is there any way to generate a keystroke from a background application so that all other DirectInput applications could get it?

John Thornton
A: SendInput on Win2k. Write a driver on 9x.

I don't use 9x myself and thought that might be a workaround for users using 2k or XP. I don't come from a MS background myself so a lot of this is new to me.

Thanks again for the information. I know now it's a dead end hehe.

Non M$ Coder
a lesser mummy
a lesser mummy
Posts: 43
Joined: Sun Apr 13, 2003 8:00 pm

Post by Non M$ Coder » Tue Apr 15, 2003 4:57 pm

I am not a widows programmer, but here are a couple of thoughts/observations:

First, im pretty sure eqw does a pass through of all key strokes and clicks (pretty sure clicks too) to eq, since it intercepts cntl-alt-r etc. If this is the case, it should be workable to pass clicks through eqw shouldn't it?

Second, I know in win2k you can grab kvm if you are an admin. At work, since windows has no concept of remote log in, when they want to install something or trouble shoot remotely, they get kvm. At the same time you still have kvm, so if you are also moving the mouse its a tug of war. What this tells me are that the hooks are in place to throw in keyboard and mouse events where you will. I don't know if this works when you are using directx, but I would immagine it would.

The driver idea was the first one I thought of, writing a driver that could take a signal to produce a click, but writing drivers is a royal pain from what I've heard.

If I get some time (which aint looking to likely), ill try to dig into this some more. My suspicion is that there is an easy way to add clicking back in, and I think the trade skills have been made unprofittable. Personally, I want clicks for fishing (cobalt cod's) and doing some of the pedantic combines necessary to raise my skills. Fishing is the worst though since you dont do anything for 10 sec while witing for a result, but then you have to click again in 10 sec, so you are pretty much glued to the keyboard.

Eric



--edit-- kvm = keyboard video mouse