Main > Main Forum

Gamepad Emulator why not?

<< < (6/15) > >>

JODY:
Got it to compile OK in Dev-C++ but the program wouldn't run.  Tried the executable on the site and receive the same error.  I've got Win XP.

Error says:

CreateFile failed with error code 2 trying to open \\.\PPJoyIOCTL1 device

I'll look into it more when I get time.  There isn't much to the code.  Would need keyboard intercept code to join in with it and then do a GUI frontend.

cobelli:
JODY - first off, no nned to compile, the exe is included. Also, you are getting that error because you do not have the ppjoy software installed and running.

Howard_castro - You are correct that it is difficult, but the hard part has already been done for us. PPjoy is a program originally intended for controller hacks. Natively, it accepts input over the lpt port and sends it out through directx. SO to windows, it looks EXACTLY like a joystick. You can configure it in control panel, it has drivers to run it, etc.. Tested with a few 3d apps and they all recognize it fine. The problem with the software is that we aren't taking input over the lpt port, but rather the keyboard port. However, this can be solved. PPjoy has a virtual mode in which it accepts ioctl calls. Now all we need is a program that captures keystrokes and sends the output to ppjoy. As previously stated, an example of such a program is available from ppjoy. Problem is that it doesn't capture keys while in the background. It has to be the active program in order to perform its task. Not good for gaming.

The solution: I have contacted the amazing author of ppjoy, and he is going to whip up the necessary prog for us! YAY! However, I didn't want to push the envelope by asking for it to be easy, so we may still need to do some work afterwards to make it user configurable.

allroy1975:

--- Quote from: cobelli on August 27, 2003, 11:03:42 pm ---The solution: I have contacted the amazing author of ppjoy, and he is going to whip up the necessary prog for us! YAY! However, I didn't want to push the envelope by asking for it to be easy, so we may still need to do some work afterwards to make it user configurable.

--- End quote ---

LOL!  I had been in contact for a few days with the author.  He had told me that someone else was looking for the same thing.  Must have been you!  anyway, about 5 minutes before you posted this I e-mailed him and asked him how much I'd have to pay him to write it for me...lol

Anyway, that's totally sweet that he's agreed to do it for us.  He said it shouldn't be too hard.  He must be pretty smart/good if he did the hard part for us already.  :)

Anyway..I'm pretty excited...  glad that something might actually come of this hair brained idea.  :D

Matt

cobelli:
Deon (the author of ppjoy) came through! He is amazing! Wrote us a nice app that uses the DIrectinput API to capture the keyboard strokes and pass them on to PPJoy. It's fully configurable (not so easily, though, as you need the decimal value of the key) and in my testing, works great. The one problem, though, is each instance of the prog only supports 1 joystick. A workaround is to just launch the app 4 times, but I emailed Deon about it and hopefully he can add multiple joystick functionality to the program. UPDATE: In the zip is a batch file that will run PPjoyKEY 4 times, each time specifying a different INI file. Multi-joy support is too much more to ask from Deon. Hopefully, though, he will figure out how to minimize the programs to the system tray, so there will be a little less clutter. Thanks again, Deon, very cool. It took me a little figuring to get it working, so I zipped up all the necessary files and included instructions :) Enjoy! AND THANKS DEON!!!

---------------------------------------
Keyboard to Joystick emulation

First off, this would not be possible without the amazing work of  Deon van der Westhuysen. THANK YOU THANK YOU THANK YOU!

This procedure relies on two programs, both written by Deon. The first is PPjoy. This application takes input over the lpt port and outputs it as a windows joystick. It can, however, also be run in virtual mode in which it instead accepts input through ioctl calls. Therefore, the second program is PPjoyKEY which takes keystrokes as input and outputs to ppjoy through the aforementioned ioctl process.

Instructions:
1. Run the setup program in the PPjoy folder
2. Launch the PPjoy configurator
3. Click "add"
4. Select "virtual port" from the "parralel port" dropdown
5. Select the controller number from the controller number dropdown.
6. Click "add"
Repeat for each controller.
7. Run "key2joy.bat" from the main folder.

This is a little batch file I wrote that simply launches PPjoyKEY 4 times, each time specifying a different INI file. I created the INI files to ease the installation procedure. The keys are mapped as follows:

               UP     DOWN      LEFT     RIGHT    B1     B2     B3    --BINGO! Either that, or I was attempting to say "before" but it was too many letters to type--    B5    B6    B7    B8
Joy1        1            2            3          4          5       6       7       8      9    0        -      =
Joy2        q            w           e          r           t        y       u       i       o     p        [       ]
Joy3        a            s            d          f            g       h       j        k     l       ;        '
Joy4        z             x           c           v           b       n      m       ,     .       /        

You can however specify your own configuration by using the decimal equivalent of the key (ESC is 1 and the increase accross row).

Have fun!
- Mike Cobelli
-------------------------------------------------------------------------


Since it won't fit on the forum, You can get all the files from my website http://hostfreedom.com/key2joy.zip

cobelli:
Slightly better news! While it would be a pain for Deon to write the software to support 4 controllers at once, and he has done enough for us all ready, he did point me in the right direction for a better solution. A batch file! While I had actually tried this already, I didn't know of the "start" command, and therefore the 4 instances were running sequencially, not concurently. Anyway, in the zip file you will find key2joy.bat. Running this will launch PPjoyKEY four times, each time loading a different one of the ini files. Enjoy!
- Cobelli

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version