Jump to content
The simFlight Network Forums

Saitek Switch Panel and Mouse Macros


Recommended Posts

FSUIPC Version: 3.98a

FS Version: 9.1

Hardware: Saitek Switch Panel

Hardware Driver: SPAD (version 0.41)

Aircraft: PIC 737

OS: Windows XP (SP3)

Hi All!

I wonder if anyone can help. I'm trying to program the Saitek switch panel's Master Battery switch. It's a rocker switch (like a light switch - up and down positions).

I've had some success with it so far - I created a mouse macro, which worked when tested using the TAB key, and also worked when I assigned it to a "regular" push button on my CH Yoke. (press the yoke button = Battery On. Press the yoke button again = Battery Off).

I then sent a virtual joystick button from SPAD ("Event when switched ON"), (Joystick 64, button 0) to FSUIPC and assigned the macro to this virtual joystick button in FSUIPC.

I then assigned another virtual button in SPAD ("Event when switched OFF"), (Joystick 64, button1 ) and assigned the macro to this button in FSUIPC.

This is what happens:

1. When I move the SAITEK switch panel Master Battery switch to the "Up" (on) position, the Master battery switches on in the sim.

2. When I move the SAITEK switch panel Master Battery switch to the "Down" (off) position, nothing happens in the sim (ie: battery stays on)

3. If I then move the SAITEK switch panel Master Battery switch back to the "Up" (on) position, the Master battery switches on in the sim, and... repeat from step 2.

Have I misunderstood the concept of Virtual Joystick buttons and mouse macros, or am I missing something?

Any advice gratefully received!

Thanks

Nige

Link to comment
Share on other sites

I then sent a virtual joystick button from SPAD ("Event when switched ON"), (Joystick 64, button 0) to FSUIPC and assigned the macro to this virtual joystick button in FSUIPC.

I then assigned another virtual button in SPAD ("Event when switched OFF"), (Joystick 64, button1 ) and assigned the macro to this button in FSUIPC.

This is what happens:

1. When I move the SAITEK switch panel Master Battery switch to the "Up" (on) position, the Master battery switches on in the sim.

2. When I move the SAITEK switch panel Master Battery switch to the "Down" (off) position, nothing happens in the sim (ie: battery stays on)

3. If I then move the SAITEK switch panel Master Battery switch back to the "Up" (on) position, the Master battery switches on in the sim, and... repeat from step 2.

Erseems something missing between 2 and 3? If the battery switch is already on, how can you tell if step 3 switches it on?

What is "SPAD" doing with virtual buttons?

Have I misunderstood the concept of Virtual Joystick buttons and mouse macros, or am I missing something?

I don't know what you are thinking, but a virtual button is a bit which signifies "on" or "pushed" when it is 1 and "off" or "released" when it is 0. This is exactly the same as how real buttons are seen inside software -- Windows provides their status as an array of bits, just like the virtual buttons. Therefore they can be used in an identical manner.

I've no idea what SPAD is doing though -- why not use FSUIPC's logging to show you (and me)?

It seems rather odd to me that you talk about ("Event when switched ON"), (Joystick 64, button 0) for one action but ("Event when switched OFF"), (Joystick 64, button1 ). Why are you using two separate virtual buttons, but taking note only of one being turned on and the other being turned off? You must surely realise that initially ALL virtual buttons are "off" (why would they be otherwise?) so your step 2 can't do anything the first time. In both cases you'd have to press twice for any new action, wouldn't you -- to turn the button on then off, or vice versa?

Wouldn't it be far easier to simply program the same virtual button for both on and off changes?

Oh, and what is wrong with the standard FS Master Battery control? Doesn't this aircraft take any notice of FS's battery switch?

Regards

Pete

Link to comment
Share on other sites

Peter,

Thanks for your reply.

The aircraft doesn't take any notice of FS's standard battery switch, no. Otherwise I wouldn't be attempting to use a far more complex method of trying to achieve what I want!

With regard to the switch - In short, only moving the rocker to the "UP" position does anything - ie: If the battery is off, then the UP switch turns it on. My typo at step 3 (sorry) it should say "off" where it says on. The down movement of the switch doesn't trigger anything.

By default, the SAITEK switch panel uses standard FS controls for its functions. SPAD allows one to use either keyboard shortcuts or virtual buttons to modify this behaviour. Since I can find no keyboard command for the PIC 737 Master battery, and the default behaviour of the panel does nothing, I had thought that a way around the issue would be to use a virtual button and a mouse macro.

I have tried assigning the same Virtual Button to the macro, but with the same effect.

The plane is loaded cold and dark, so the Master Battery is OFF. The rocker switch on the panel is in the down (Off) position. I press the rocker to move it to the up (ON) position and the Master Battery turns ON. I then press the switch to the Down (off) position and nothing happens. I then press the rocker to move the switch to the up (On) position and the battery turns off. So, yes I have to rock the switch twice for anything to happen.

The SPAD option "Event when switched ON" refers to the physical position of the button on the panel (on = Up position). The option allows one to assign either a keyboard shortcut or a virtual button (to bypass the default behaviour). I have assigned this to Joystick 64, button 0, which in FSUIPC is in turn assigned to the MasterBattery mouse macro.

The "Event when switched OFF" refers to the physical position of the button when it it "down" (off). I have also assigned this to Joystick 64, button 0, and have also tried assigning it to Joystick 64, button 1 as per my original post.

I'll send a log later. Do you need all options ticked for the log, or just specific ones?

Thanks again

Nige

Link to comment
Share on other sites

Peter,

The penny just dropped!

I started the log (buttons and key presses) and could clearly see that when I move the switch to the up ("on") position, FSUIPC detected a PRESS of button 64,0 and ran the macro.

I could also see that when I moved the switch to the down ("off") position, FSUIPC recorded a RELEASE of button 64,0.

So, I assigned the same macro to the release option of button 64,0 and all works fine.

Sorry to have bothered you. I had failed to grasp the logic, but I'm there now!

Thanks

Nige

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.