PDA

View Full Version : Is there an 'offset' to send joystick button command over network?



Suggy
08-18-2007, 06:35 AM
Here is the set up:

1) Seatbelt sign switch connected to OpenCockpits IO card running on a networked computer (non FS2004 computer).

2) Opencockpit software reads the switch and turns on the seatbelt sign in AST's Airbus software.

The above works well.

However, what I also want to do is make FSUIPC interpret it as a joystick button that has been pressed.

The reason I want to do this is assign this keypress to a Hotkey within FS2004. This is because I am running FS Flightkeeper and using a Hotkey you can play a 'put on your seatbelt' anouncement.

Is there an 'offset' I can use in the OpenCockpit software to send that mimics a joystick button.

The only other solution I can think of is to also wire the switch to a hacked usb joystick and plug the joystick in. That way, FSUIPC wil definiely see the keystroke. But this is a last resort.

Any ideas?

Thanks,

Darren Sugden

Suggy
08-18-2007, 08:38 AM
..it's OK. I fugured out a solution by using pmSounds.

For those who may not be familiar with this programme, it's free and can be downloaded from Project Magenta's website.

It's very simple but powerful.

In effect, you can get the software to play any wave sound as a result of a change in any offset.

So for example, my fasten seatbelt switch is connected to the Opencockpit interface card (switch number 187).

So when switch 187 is toggled, I have assigned the pmsound offset 0x5564 to that switch. The value you give the offset 0x5564 to send is entirely up to you but it has to be the same as you specify in the 'soundlist' file found in the pmSounds main directory. I gave mine a value of 12.

I copied a 'fasten seat belt' wave file over to the 'Sounds' directory in the main pmSounds folder and called it 'seatbelton'.

I added the 'seatbelton' file to the reference list in the 'pmsounds' configuration file by typing 'File=seatbelton.wav' at the bottom of the list. This means that this file can be selected from the pmSounds main menu.

The last part was to open the 'sounlist' file in the main pmSounds folder and enter the sound file you would like playing when offset 0x5564 is trigured with the given value. So I added the following line to the file:

seatbelton,12

This means that when 0x5564 is trigured with a value of 12, then the 'seatbelton' wave file will be played.

Given this, there are so many possibilities open to you in triggering sounds to any input.

I hope this might be useful to some one!

Right, I am going to scavenge the Intrernet fo a 'no smoking' annoucement and get that to be triggured when my no smoking seat belt sign is activated!

Regards,

Darren Sugden