Problem with Saitek / Logitech X56 Hotas

Report problems with documented functionality
erwin9
Posts: 3
Joined: 15 Jul 2018, 08:27

Problem with Saitek / Logitech X56 Hotas

13 Aug 2018, 09:20

A strange bug if there is :-)

System = Windows 10 64 bits - version 1803
AHK installation method = unzip in a directory
Using = AutoHotKeyU64.exe
Hotas Driver = Logitech 8.0.116.0 (latest), but not sure it really has any impact

Specifics = remember that the X56 is a Hotas, so it has two USB devices = one USB plug for the Throttle, and one USB plug for the Stick

Symptom = depending on when I start AHK (e.g. load a script) with regards to joystick plug sequence, I get at best one joystick handled (the first one plugged) or none working.
It all looks like AHK is really discovering the joysticks at start of script only, and not later, and for some reason, if it detects two joysticks, it has a problem.

Details:
For this experiment, I am using a modified version of of JoystickTest.ahk:

Code: Select all

; Modified Joystick Test Script
; http://www.autohotkey.com
; This script helps determine the button numbers and other attributes
; of your joystick. It might also reveal if your joystick is in need
; of calibration; that is, whether the range of motion of each of its
; axes is from 0 to 100 percent as it should be. If calibration is
; needed, use the operating system's control panel or the software
; that came with your joystick.

; July 6, 2005: Added auto-detection of joystick number.
; May 8, 2005 : Fixed: JoyAxes is no longer queried as a means of
; detecting whether the joystick is connected.  Some joysticks are
; gamepads and don't have even a single axis.
; May 2018 : loop to display all plugged joysticks, and not only one

; END OF CONFIG SECTION. Do not make changes below this point unless
; you wish to alter the basic functionality of the script.

; Loop, auto-detecting joysticks

#SingleInstance
SetFormat, float, 03  ; Omit decimal point from axis position percentages.
Loop
{
    TooltipMsg = Joysticks:
    JoystickNumber = 0

    Loop 16  ; Query each joystick number to find out which ones exist.
    {
        GetKeyState, JoyName, %A_Index%JoyName
        if JoyName <>
        {
            JoystickNumber = %A_Index%
            GetKeyState, joy_buttons, %JoystickNumber%JoyButtons
            GetKeyState, joy_info, %JoystickNumber%JoyInfo

            buttons_down =
            Loop, %joy_buttons%
            {
                GetKeyState, joy%A_Index%, %JoystickNumber%joy%A_Index%
                if joy%A_Index% = D
                    buttons_down = %buttons_down%%A_Space%%A_Index%
            }
            GetKeyState, JoyX, %JoystickNumber%JoyX
            axis_info = X%JoyX%
            GetKeyState, JoyY, %JoystickNumber%JoyY
            axis_info = %axis_info%%A_Space%%A_Space%Y%JoyY%
            IfInString, joy_info, Z
            {
                GetKeyState, JoyZ, %JoystickNumber%JoyZ
                axis_info = %axis_info%%A_Space%%A_Space%Z%JoyZ%
            }
            IfInString, joy_info, R
            {
                GetKeyState, JoyR, %JoystickNumber%JoyR
                axis_info = %axis_info%%A_Space%%A_Space%R%JoyR%
            }
            IfInString, joy_info, U
            {
                GetKeyState, JoyU, %JoystickNumber%JoyU
                axis_info = %axis_info%%A_Space%%A_Space%U%JoyU%
            }
            IfInString, joy_info, V
            {
                GetKeyState, JoyV, %JoystickNumber%JoyV
                axis_info = %axis_info%%A_Space%%A_Space%V%JoyV%
            }
            IfInString, joy_info, P
            {
                GetKeyState, joyP, %JoystickNumber%JoyPOV
                axis_info = %axis_info%%A_Space%%A_Space%POV%joyp%
            }
            TooltipMsg = %TooltipMsg%`n%JoyName% (#%JoystickNumber%) %joy_info%:`n%axis_info%`nButtons Down: %buttons_down%
        }
    }
    if JoystickNumber <= 0
    {
        TooltipMsg = The system does not appear to have any joystick
    }

    ToolTip, %TooltipMsg%`n`n(right-click the tray icon to exit)
    Sleep, 100
}
return
Detailed symptoms:
  1. If I start the script above, no device plugged, I get the tooltip "The system does not appear to have any joystick" => normal 8-)
    Then if I plug the stick, I get both "Microsoft PC-joystick driver (#1) RUVPD" and "Microsoft PC-joystick driver (#2)", and for #1 all axis values are fine & buttons are detected ok => so far so good 8-)
    Then if I plug the throttle, nothing more appears, the values for #2 are empty and not moving, while #1 is ok
    Then if I unplug #1, #1 values are not active any more, but nothing better happens on #2.
    Then if I plug again #1, its values reappear and buttons are detected again for a few cycles, but then AHK crashes !
    In the Winfows event log, I can see:

    Code: Select all

    Faulting application name: AutoHotkeyU64.exe, version: 1.1.29.1, time stamp: 0x5b122a60
    Faulting module name: CoreMessaging.dll, version: 10.0.17134.191, time stamp: 0x407d3bd9
    Exception code: 0xc0000005
    Fault offset: 0x0000000000054880
    Faulting process id: 0x1290
    Faulting application start time: 0x01d4330b72e871a1
    Faulting application path: M:\Produits\Elite Dangerous\AutoHotKey\AutoHotkeyU64.exe
    Faulting module path: C:\WINDOWS\SYSTEM32\CoreMessaging.dll
    Report Id: ccb8df1c-3147-48a1-9652-f322f8110652
    Faulting package full name:
    Faulting package-relative application ID:
  2. If I start the script above, no device plugged, then plug the throttle, I get "Microsoft PC-joystick driver (#1)" and "Microsoft PC-joystick driver (#2) ZRUV", and for #2 all axis values are fine & buttons are detected ok => so far so good 8-)
    But symetrically to 1), when I plug the stick, nothing appears on #1, only #2 is detected and working properly.
  3. If I plug both the throttle and the stick, and then start AHK with the script, then it shows both in the tooltip, but no value is detected = no button activity is detected / shown, axis values are only showing X and Y (normal, they are forced in the script), but at 000, and nothing for the others
  4. If I start the script after plugging only one of the stick or throttle, it acts as 1) or 2) depending on which one I plugged before starting.

Net is that I can only use AHK with buttons of the first one of the two devices I plug, and for that I must pay attention to start AHK before I plug anything, or latest after the first one plugged, else nothing is working at all.
Here I am using it with Elite Dangerous for some buttons on the throttle to manage pips, as the standard Logitech application macros do not work anymore .... https://community.logitech.com/s/questi ... nt-program ...

And no way to have it work with both devices :cry: .


Anything I am doing wrong ?
Are there traces I can activate somewhere to give more debug info on what is going on ?
Anything else you would need from me ?

Thanks, erwin9.
erwin9
Posts: 3
Joined: 15 Jul 2018, 08:27

Re: Problem with Saitek / Logitech X56 Hotas

13 Aug 2018, 15:19

Note; I tried with V2 (AutoHotkey_2.0-a098-59ec6aa.zip), and got the same symptoms, except the crash.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 27 guests