selmer

Hi to all

I have been told that I can register alternative input devices to the DirectX such that a game that runs will see my input instead of the standard devices that are connected on the machine. To be more specific, I want to use a client that receives a user input (game pad, mouse etc.) from a remote machine and gives it to the Direct Input, such that the game that runs on the local machine thinks that an action was taken locally.

I have browsed through the DirectX SDK Documentation and also searched for an answer in the web, but I haven't figured out anything yet. Could anyone from this site clear this issue for me please Is what I am trying to do feasible

I really thank you for your time
Theofilos


Re: Game Technologies: General Declaring alternative input devices

The ZMan

For DirectInput to see any kind of a device you need a driver for that device. I've never seen a driver that allows the kind of network redirect you are talking about. I suppose there is some chance you can grab the underlying windows events from the remote machine and push them to the local machine, but I'm not sure if DirectInput would respond to them without an actualy physical device attached.

Where did you get the information this could be done






Re: Game Technologies: General Declaring alternative input devices

selmer

Hi

Many thanx for the immediate reply.
Actually, I am doing a project which, among others, involves the feasibility of this operation, which is kind of crusial for the project. A guy from my university told me that maybe this could be done, without being really sure about it.

Since you mentioned the need for the existence of physical devices, do you think that I could trick in some way the local machine to believe that my input (events) comes from the local physical devices Can I relate my input to that of the physical devices in a top level or should I go down to "interrupt level" (and really mess up everything :-))

Theofilos





Re: Game Technologies: General Declaring alternative input devices

The ZMan

I'm speculating wildly here but hey its a university project so pushing the envelope is expected :-)

DirectInput sits on top of the windows messages, though it uses raw input see http://msdn.microsoft.com/library/default.asp url=/library/en-us/winui/winui/windowsuserinterface/userinput/rawinput/rawinputreference/rawinputmessages/wm_input.asp. So I wonder if you could grab the raw messages from the machine the device is attached to (not using DirectInput becuase that removes the raw messages), transferred them over the network and then post them into the message pump in your app. Maybe DirectInput on this computer would see them as coming from an attached device. This may not make all DirectInput functions work as some of them are looking for registered devices on the machine so they will be searching for hardware setup information which won't be there so you might have to fake that too. I'm not sure if you would need a fake device driver to handle this part - if so then you need to find a device driver forum as this one probably won't be much help :-)






Re: Game Technologies: General Declaring alternative input devices

selmer

Hi again

Actually, while browsing through several forums to find an answer, I came across the raw input you mention and I was thinking whether I could, indeed, use this to achieve my goals. Maybe I could enumerate all of the devices to find the type I want (eg. a keyboard) and register "on top of" it my virtual input device (if the system would allow me to do this). Then, I could inject my raw input into the Direct Input like coming from that device.

In my previous posts I failed to give you the whole view of what I am trying to do. So, I want to have a DirectX game running localy, send the game view (frames) to a remote machine, receive the remote user's reaction and inject this reaction to the Direct Input so that the game will see it and proceed based on it. Pretty tough, eh :-)

Hope it won't take me long to find the way.
Thanx again for the prompt support.
Keep up the good work.

Theofilos




Re: Game Technologies: General Declaring alternative input devices

selmer

Hi again after all these days

Actually, I did my job by transforming the RAWINPUT structure into an INPUT structure and use the sendinput() function to insert it into the keyboard or mouse input stream. This works fine since the messages are passed to a low level of the OS, so I also see the pointer of Windows moving. Now I am trying to see whether I can acquire a handler on the transmitted RAWINPUT structure in order to be able to use the postmessage() function and post the input only to the Game and not to the whole OS. This, of course will work only if the Game processes the WM_INPUT messages. I have posted a related message on the win32.programmer.ui newsgroup.

Regards