"Game Controller" does not call back on all axis

Questions about deployment and use of Air Manager Instruments

Moderators: russ, Ralph

Message
Author
Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

"Game Controller" does not call back on all axis

#1 Post by Tetrachromat »

I'm exploring the new feature in AM 4, which supports game controllers.

I tried with the most simple one I have, the Logitech/Saitek Rudder Pedals. Just three axis.

The issue is that
- axis 0 (left toe brake) does work. Input is received after adding the controlle, and input changes with left pedal action between (between -1.0 and +1.0)
- axis 2 (right toe brake) does not work properly. Input is received only once after adding the controller, on pedal action input is never received (no callback)
- axis 1 (rudder) does not provide any input at all. The callback function is never called for this axis. Not after adding the controller and never on rudder action.

The rudder panels have been working with different simulators for years. Windows game controller calibration tool is showing all inputs.

instrument code is:

Code: Select all

-- MSFS Game Controller
-- Saitek Pro Flight Rudder Pedals¨

local controller = "Flight Rudder Pedals"

local axis = {} 
axis[0] = { event = "AXIS_LEFT_BRAKE_SET",  range =  16383 }
axis[1] = { event = "AXIS_RUDDER_SET",      range =  16383 }
axis[2] = { event = "AXIS_RIGHT_BRAKE_SET", range =  16383 }

function callback(type, index, input)
  log("Game controller callback with type = " .. type .. ", index = " .. index .. ", input = " .. tostring(input))
  if type == 0 then
    event = axis[index].event
    output = math.floor(axis[index].range * var_cap(input, -1.0, 1.0) )
    fs2020_event( event, output )
  end
end

if game_controller_add(controller, callback) then
  log("Game Controller added: " .. controller)
end
-- END 
Paul

Tetrachromat
Posts: 236
Joined: Sun Feb 14, 2021 6:55 pm

Re: "Game Controller" does not call back on all axis

#2 Post by Tetrachromat »

In the meantime I have been doing the same testing for all my game controllers
- Saitek X52 Pro Flight HOTAS
- Saitek Flight Yoke System
- Saitek Throttle Quadrant

All of them function in AM / AP without issues.

So what is the difference from the Rudder Pedals? The rudder pedals do not have any type '1' input (no buttons), just 3 axis.

Does the 'game controller' get stuck searching for type '1' input? Just a wild guess ...

Anybody with the Saitek Rudder Pedals on the forum? Would be nice if he/she can run the code I provided above. Just to make sure it's me / my setup and not a bug in AM.

Thanks

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: "Game Controller" does not call back on all axis

#3 Post by Sling »

It seems this is still broke. I reported this exact same problem when it was first released. Note that I have different rudder pedals (still 3 axis only, no buttons) but get a similar result. My right toe brake works fully. The left toe brake reports once but does nothing after that and the yaw axis reports nothing at all. Note that for my pedals index 0 is the right toe brake.

https://siminnovations.com/forums/viewt ... ler#p30543

User avatar
Corjan
Posts: 2933
Joined: Thu Nov 19, 2015 9:04 am

Re: "Game Controller" does not call back on all axis

#4 Post by Corjan »

Hi,


Would you mind verifying in windows itself if it works correctly, and that it in fact sees 3 axis and 0 inputs?


We might have a rudder panel laying around that I can use to test, not sure,

Corjan

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: "Game Controller" does not call back on all axis

#5 Post by Sling »

Indeed Windows reports exactly that. 3 axis only. X,Y & Z. In my case the axis are mapped as follows.

X = right toe brake
Y = left toe brake
Z = rudder

User avatar
Corjan
Posts: 2933
Joined: Thu Nov 19, 2015 9:04 am

Re: "Game Controller" does not call back on all axis

#6 Post by Corjan »

Hi,


We don't have one of the office at the moment.
We are probably going to buy one this week.


I'll get back to this topic when I have news,

Corjan

User avatar
Corjan
Posts: 2933
Joined: Thu Nov 19, 2015 9:04 am

Re: "Game Controller" does not call back on all axis

#7 Post by Corjan »

Hi,


Just tested it, and found the issue (I think).
For some reason, the library I use ignores the first two axis and wont report them changing.

I have no idea why, it feels like I don't understand how it should work :)

Anyways, I changed it to not ignore them, and now it works.


Will be in AM 4.1 BETA when it releases,

Corjan

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: "Game Controller" does not call back on all axis

#8 Post by Sling »

Thanks again. I’ll also check this one when the new beta hits.

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: "Game Controller" does not call back on all axis

#9 Post by Sling »

Another one confirmed working now.

However, is there an error with the wiki details. The main API page and the page for game_controller_add() both show a syntax with 3 arguments. What is index in this context as its not mentioned in the arguments table or the example.

Tony

User avatar
Corjan
Posts: 2933
Joined: Thu Nov 19, 2015 9:04 am

Re: "Game Controller" does not call back on all axis

#10 Post by Corjan »

Hi,

Yeah, the index shouldn't be there. The wiki is updated.

Corjan

Post Reply