Jump to content
The simFlight Network Forums

UserInputServices.CheckForInput


kingm56

Recommended Posts

It doesn't look like these work in FSUIPC7.

The dll uses the FSUIPC facilities at offsets 0x3210 (keypresses) and 0x2910 (joystick buttons).

The offset status spreadsheet for FSUIPC7 says that 0x3210 is "Probably not working". 0x2910 has a status of 'unknown/untested'.

You'll need to ask John if there are any plans to implement these features in FSUIPC7.

Paul

Link to comment
Share on other sites

Paul, 

Checked with John, he states the offset x2910 is active and functioning properly.  Any plans to update your dll to take advantage of said offset?  

-- Hot Button test at offset 0x2910

-- First, write to offset to signal the button I am interested in
-- I will use my joystick #1 button #6 for both off to on and in to off
ipc.writeUD(0x2910, 0x000681) -- where 0x81 (129) is joystick 1, 06 is button 6 and 00 is for off-to-on

-- function to register change
function hotButtonActivated(offset, value)
    if value  ~= 0 then
        ipc.log("Hot button changed: " .. value)
        -- clear flag
        ipc.writeUB(offset, 0);
    end
end

-- event on trigger
event.offset(0x2913, "UB", "hotButtonActivated")

 

Link to comment
Share on other sites

Quote

Any plans to update your dll to take advantage of said offset?  

There nothing for me to do; user input services is already in the DLL and works fine in FSUIPC4,5 and 6. 

To check if it works in FSUIPC7, please try the UserInput examples in my ExampleCode solution on the website: (Please update my DLL to the latest version as these solutions tend to restore a previous version).

http://fsuipc.paulhenty.com/#downloads

If those examples do not work with FSUIPC7 then let me know and I'll speak with John to see where the problem is. Let me know if there are any exceptions thrown.

If they do work then compare the example code with your code.

When you test your code, make sure you're not ignoring any Exceptions with blank Catch() blocks. Any exceptions thrown by the DLL could point to what the problem is.

Paul

Link to comment
Share on other sites

Hey Paul,

I assumed it doesn't work because I tested with your FSUIPCExampleCode_CS 1.2.0 with .dll 3.2.17.  Clicking on Listen for Joystick Button Presses, and clicking on Button 1, does not impact the counter at all.... there's no exception thrown.    The Respond to Key Presses' class/methods work perfectly; so, it could have something to do with the device ID; I know windows changed this methodology in Win10.  I tried to change the Joystick ID from 0 to 5...no joy.  

-Matt

Link to comment
Share on other sites

Hi Matt,

Some things to check:

1. Your joystick/button IDs should be the same a FSUIPC displays on it's "Buttons and Switches" tab when you press the joystick button.

2.The buttons presses are only detected when the Flight Sim window has focus. It won't work if FSUIPC7 or your application are in focus.

3. Can you please let me know the values of offsets 0x2910 and 0x290C running under FSUIPC7, but *without* using any of the User Input features: (Both are 4-byte ints)

I would test everything here myself but I don't have MSFS.

Those offsets should tell me if there is a problem with FSUIPC7.

If none of this helps I can prepare a version of the DLL with debug logging that should pin the problem down.

Thanks,

Paul 

Link to comment
Share on other sites

58 minutes ago, Paul Henty said:

Hi Matt,

Some things to check:

1. Your joystick/button IDs should be the same a FSUIPC displays on it's "Buttons and Switches" tab when you press the joystick button.

2.The buttons presses are only detected when the Flight Sim window has focus. It won't work if FSUIPC7 or your application are in focus.

3. Can you please let me know the values of offsets 0x2910 and 0x290C running under FSUIPC7, but *without* using any of the User Input features: (Both are 4-byte ints)

I would test everything here myself but I don't have MSFS.

Those offsets should tell me if there is a problem with FSUIPC7.

If none of this helps I can prepare a version of the DLL with debug logging that should pin the problem down.

Thanks,

Paul 

Hey Paul

 

1. Joystick is registering as 0

2. Button is 1

3. Offsets are 0 and 56

Don't worry, my friend.  I went a head and wrote my own class using SharpDX dll.  Thank you as always though! 

-Matt

  • Like 2
Link to comment
Share on other sites

  • 2 months later...

Hey Amine,

I ended up writing my own class to capture joystick events; I'm not sure why those offsets no longer work.  John and Paul could possibly offer an explanation, as well as fix them going forward.   

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.