Jump to content
The simFlight Network Forums

Recommended Posts

I purchased a 64 button card from Leo Bodnar only to find out later about the 32 button limit with FSUIPC per device. I thought if I limit the total buttons to 32 spread across the whole card it would work okay but it looks like they all have to be allocated to buttons 1-32 as none of my buttons from 33-64 are working. I have soldered the card into a circuit board so it is not a simple process to reallocate each of the buttons. Is there a way to force the use of the buttons with numbers above 32 thought the ini file or similar?

Regards

Glenn

 

Share this post


Link to post
Share on other sites

Hi,,

the structure of the used windows API checks only for the first buttons 0 to 31 (your buttons 1 to 32). It means any possible button above that is not seen, so there is no way to force something as Windows itself doesn't look for it in the first place.

Thomas

Share this post


Link to post
Share on other sites
6 hours ago, glennav8r said:

I thought if I limit the total buttons to 32 spread across the whole card it would work okay but it looks like they all have to be allocated to buttons 1-32 as none of my buttons from 33-64 are working. I have soldered the card into a circuit board so it is not a simple process to reallocate each of the buttons. Is there a way to force the use of the buttons with numbers above 32 thought the ini file or similar?

The entire number of buttons can be read and interpreted (best sent to "virtual  buttons" for assignment) by using a Lua plug-in.

A suitable Lua plug-in is provided, as an example, in your FSUIPC documents subfolder -- in the "Example Lua plug-ins" zip file. Look for "HidDemo.lua". That handles many axes and up to 256 buttons on a device, mapping them to "virtual buttons" in FSUIPC which will be seen in the Buttons & Switches tab and can be assigned there.

All you should have to do is change these two lines:

Vendor = 0x16C0
Product = 0x05B5

Get these values either from the FSUIPC log file, or possibly easier by using HidScanner (a small usitility in this thread:

The other lines which you might want to change are:

Device = 0  -- Multiple devices of the same name need increasing Device numbers.

-- Logging on or off (to see when numbers you are getting)
Logging = false

-- Polling rate in number of polls per second
Pollrate = 25

 

but this won't be needed for a simple button mapping.

Pete

 

Share this post


Link to post
Share on other sites

I found this topic, but am having some difficulties.  The only LUA have used before is from the Aerosoft F-14 that automatically installed the files.  I have the new Honeycomb Yoke that has >32 buttons, with the buttons over 32 being Magneto Left, Magneto Both, and Starter.  I am using FSUIPC 5 in P3D v4.4

I copied the file HidDemo.lua from the Modules\FSUIPC Documents\Example LUA Plugins to the Modules folder.  I renamed this AlphaYoke.  From the FSUIPC5 file opened in Notepad, the relevant section is:

      156 Product= Alpha Flight Controls
      156    Manufacturer= Honeycomb Aeronautical
      156    Serial Number= 96BB380E061A3B00
      156    Vendor=294B, Product=1900 (Version 0.16)
      156    GUIDs returned for product: VID_294B&PID_1900:
      156       GUID= {3571F1B0-E9F5-11E9-8001-444553540000}
      156       Details: Btns=35, POVs=(0, 0, 0, 0), Cal=x00000000, Max=R0,U0,V0,X255,Y255,Z0

I edited only new AlphaYoke.lua file to:

...

Vendor = 294B
Product = 1900
Device = 0  -- Multiple devices of the same name need increasing Device numbers.

-- Logging on or off (to see when numbers you are getting)
Logging = false

-- Polling rate in number of polls per second
Pollrate = 25

...

If I understood correctly, I should now see buttons 32-35 registers in the Buttons + Switches tab when I pressed them.  Am I misunderstanding something, or doing something wrong?

Share this post


Link to post
Share on other sites
16 hours ago, John Dowson said:

Is your lua running? You need to add it to the [Auto] section of your FSUIPC5.ini file - see page 40 of the Advanced User manual.

John

Thank you, and in short, no I had not found that section of the manual.  Nor do I think the LUA is running still.

To FSUIPC5.ini, I hadded

[Auto]

1=Lua AlphaYoke

The file AlphaYoke.lua is in the P3D\Modules folder.

I do not get any effect utilizing these buttons over 32. My FSUIPC log file is below and I see the LUA referenced, but it says "malformed number" near the vendor ID:

********* FSUIPC5, Version 5.15 (27th November 2018) by Pete Dowson *********
Running inside Prepar3D v4
Module base=7FFA1F600000
Windows 10 Pro 64 Bit reported as Build 18362, Release ID: 1903 (OS 10.0)
Prepar3D.exe version = 4.4.16.27077
Reading options from "F:\Prepar3D v4\Modules\FSUIPC5.ini"
Checking the Registrations now ...
User Name="Eric Szczesniak"
User Addr="eszczesniak@gmail.com"
FSUIPC5 Key is provided
WIDEFS7 not user registered, or expired
        0 System time = 21/10/2019 20:40:38
        0 FLT path = "C:\Users\Eric Szczesniak\Documents\Prepar3D v4 Files\"
        0 Using DialogMode
        0 FS path = "F:\Prepar3D v4\"
       78 ---------------------- Joystick Device Scan -----------------------
       78 Product= Saitek Pro Flight Quadrant
       78    Vendor=06A3, Product=0C2D (Version 2.2)
       78    GUIDs returned for product: VID_06A3&PID_0C2D:
       78       GUID= {F308E0B0-E99E-11E8-8002-444553540000}
       78       Details: Btns=9, POVs=(0, 0, 0, 0), Cal=x00000000, Max=R0,U0,V0,X255,Y255,Z255
       78       GUID= {F94A49A0-E99E-11E8-8003-444553540000}
       78       Details: Btns=9, POVs=(0, 0, 0, 0), Cal=x00000000, Max=R0,U0,V0,X255,Y255,Z255
       78 Product= vJoy - Virtual Joystick
       78    Manufacturer= Shaul Eizikovich
       78    Serial Number= 2.1.8
       78    Vendor=1234, Product=BEAD (Version 2.24)
       78    GUIDs returned for product: VID_1234&PID_BEAD:
       78       GUID= {B47CD7A0-57D2-11E9-8002-444553540000}
       78       Details: Btns=8, POVs=(0, 0, 0, 0), Cal=x00000000, Max=R32767,U32767,V32767,X32767,Y32767,Z32767
       78 Product= Saitek Pro Flight Quadrant
       78    Manufacturer= Saitek
       78    Vendor=06A3, Product=0C2D (Version 2.2)
       94 Product= MFG Crosswind V2
       94    Manufacturer= MFG
       94    Serial Number= MFG500001
       94    Vendor=16D0, Product=0A38 (Version 33.1)
       94    GUIDs returned for product: VID_16D0&PID_0A38:
       94       GUID= {5D1C51B0-E843-11E8-8006-444553540000}
       94       Details: Btns=2, POVs=(0, 0, 0, 0), Cal=x00000000, Max=R4096,U0,V0,X4096,Y4096,Z0
      157 Product= Alpha Flight Controls
      157    Manufacturer= Honeycomb Aeronautical
      157    Serial Number= 96BB380E061A3B00
      157    Vendor=294B, Product=1900 (Version 0.16)
      157    GUIDs returned for product: VID_294B&PID_1900:
      157       GUID= {3571F1B0-E9F5-11E9-8001-444553540000}
      157       Details: Btns=35, POVs=(0, 0, 0, 0), Cal=x00000000, Max=R0,U0,V0,X255,Y255,Z0
      157 Product= Throttle - HOTAS Warthog
      157    Manufacturer= Thrustmaster
      157    Vendor=044F, Product=0404 (Version 1.0)
      157    GUIDs returned for product: VID_044F&PID_0404:
      157       GUID= {6B1B22B0-E8E7-11E8-8002-444553540000}
      157       Details: Btns=32, POVs=(0, 0, 0, 0), Cal=x00000000, Max=R16383,U1023,V0,X1023,Y1023,Z16383
      157 -------------------------------------------------------------------
      157 Device acquired for use:
      157    Joystick ID = 1 (Registry okay)
      157    1=Saitek Pro Flight Quadrant
      157    1.GUID={F308E0B0-E99E-11E8-8002-444553540000}
      157 Device acquired for use:
      157    Joystick ID = 5 (Registry okay)
      157    5=Saitek Pro Flight Quadrant
      157    5.GUID={F94A49A0-E99E-11E8-8003-444553540000}
      157 Device acquired for use:
      157    Joystick ID = 3 (Registry okay)
      157    3=vJoy Device
      157    3.GUID={B47CD7A0-57D2-11E9-8002-444553540000}
      157 Device acquired for use:
      157    Joystick ID = 0 (Registry okay)
      157    0=MFG Crosswind V2
      157    0.GUID={5D1C51B0-E843-11E8-8006-444553540000}
      157 Device acquired for use:
      157    Joystick ID = 4 (Registry okay)
      157    4=Alpha Flight Controls
      157    4.GUID={3571F1B0-E9F5-11E9-8001-444553540000}
      157 Device acquired for use:
      157    Joystick ID = 2 (Registry okay)
      157    2=Throttle - HOTAS Warthog
      157    2.GUID={6B1B22B0-E8E7-11E8-8002-444553540000}
      157 -------------------------------------------------------------------
      172 LogOptions=00000000 00000001
      172 -------------------------------------------------------------------
      172 SimConnect_Open succeeded: waiting to check version okay
      172 Opened separate AI Traffic client okay
      172 ### PDKmodeHelper callback registered!
     6250 Running in "Lockheed Martin® Prepar3D® v4", Version: 4.4.16.27077 (SimConnect: 4.4.0.0)
     6250 Initialising SimConnect data requests now
     6250 FSUIPC Menu entry added
     6250 ... Using Prepar3D with Academic License
     6282 C:\Users\Eric Szczesniak\AppData\Local\Lockheed Martin\Prepar3D v4\Prepar3D_Default.fxml
     6282 F:\Prepar3D v4\SimObjects\Airplanes\IRIS Raptor Driver\Raptor.air
    13000 ### The user object is 'F-22 Raptor - 525th Fighter Squadron'
    13000 ### Mode is NORMAL
    13516 ### Mode: PAUSE on
    51438 Loading Complete ...
    51532 ### Mode is NORMAL
    52235 User Aircraft ID 1 supplied, now being used
    52250 Aircraft loaded: running normally now ...
    53110 System time = 21/10/2019 20:41:31, Simulator time = 20:40:46 (01:40Z)
    53110 Aircraft="F-22 Raptor - 525th Fighter Squadron"
    66266 F:\Add-ons\A2A\SimObjects\Airplanes\A2A_C182\C182.air
    66844 Aircraft="C182_VH-DLL"
    68407 -------------------- Starting everything now ----------------------
    68453 *** LUA Error: F:\Prepar3D v4\Modules\AlphaYoke.lua:14: malformed number near '294B'
    68469 ASN active function link set
    68469 Ready for ActiveSky WX radar with additional data
    69532 Advanced Weather Interface Enabled
    88594 === Closing session: waiting for DLLStop to be called ...

Share this post


Link to post
Share on other sites

Hi,

 

There is an error in your routine in line no 14. It's simply not executing:

68453 *** LUA Error: F:\Prepar3D v4\Modules\AlphaYoke.lua:14: malformed number near '294B'

Rgds
Reinhard

Share this post


Link to post
Share on other sites

Thank you! This is working now!

What I think will be one last question.  Now with this LUA running, buttons 1-32 register briefly as H 31 (H just happens to be the letter for this Yoke) and then 65 61 (65 I presume to be the virtual device).

I currently have buttons 1-32 programmed under the "H" device, with only 33-35 under "65".  Does it matter which device they are programmed under?  For momentary contact buttons, it seems probably not.  But what about "repeat while held" buttons?  At least watching through FSUIPC, it seems there's a small, but noticeable delay from when H X is displayed to 65 Y populates through the LUA.  Perhaps none of this matters, but I was just curious what the recommended process would be to avoid problems. 

Share this post


Link to post
Share on other sites
10 hours ago, ESzczesniak said:

Does it matter which device they are programmed under?

You have to program under the device the button press is received.

 

10 hours ago, ESzczesniak said:

there's a small, but noticeable delay from when H X is displayed to 65 Y populates through the LUA

Not sure what you mean by this, but I would expect a small delay if the button press is going via lua + virtual buttons.

10 hours ago, ESzczesniak said:

Perhaps none of this matters

Probably not! You could look into tuning the ButtonRepeat rate if the delay is an issue, but this would affect all buttons. Best just to try and adjust for your needs if needed.

John

Share this post


Link to post
Share on other sites
4 hours ago, John Dowson said:

You have to program under the device the button press is received.

I may not have explained this well.  The same button pressed just once registers first under the physical hardware device, then a moment later under the virtual device created by the LUA.  I have tested on the ramp, and it does not seem to matter if it's programmed through the physical hardware device or the virtual device.  The only thing I haven't tested yet is trim, which is a repeat while held scenario.  I will have to test this later and see. 

Share this post


Link to post
Share on other sites
2 minutes ago, ESzczesniak said:

The same button registers first under the physical hardware device, then a moment later under the virtual device created by the LUA

Ah, ok. That makes sense. But presumably for only the first 32 buttons (0-31). The remaining buttons would only send via the virtual device.

I don't think the repeat rate will be a problem using virtual buttons, but, as you say, just try and see.

John

Share this post


Link to post
Share on other sites
2 hours ago, John Dowson said:

Ah, ok. That makes sense. But presumably for only the first 32 buttons (0-31). The remaining buttons would only send via the virtual device.

I don't think the repeat rate will be a problem using virtual buttons, but, as you say, just try and see.

John

 

Had a chance to test this now and it all seems to work.  Thank you for your help!

Share this post


Link to post
Share on other sites

With LINDA you can assign all 35 Buttons without any virtual Button.

Andrew from LINDA answered to me:

Quote

Thank you for the feedback. LINDA extracts the number of axis and buttons directly from the device. It just needs the button reference to initiate the assigned function. Obviously, FSUIPC has a built in limit. If you feed this back to the FSUIPC support forum I am sure that the developer will make the necessary changes for this new device.

 

Share this post


Link to post
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...

×
×
  • 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.