• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Differences between keyboard buttons and joystick buttons

Messages
120
Country
unitedstates
Can someone explain the difference between pressing a button on a joystick and pressing a key on a keyboard?

On my joystick, I'm pressing a button and detecting it as a joystick button press (and then telling my app to do something).

When I attach a Gaming Pad and press a key, I get no 'joystick button' response. I believe the button press on the gaming pad is seen as a 'keyboard press'.

I'm looking for a device that I can press buttons on and have it respond like the buttons on my joystick. But presently, I don't fully understand the difference between these two types of devices.

Thanks...
 
While SimConnect is capable of distinguishing between different game controllers, I don't think that capability extends to keyboards. If your gamepad is reporting as a keyboard then you may be out of luck with SimConnect. I have a Logitech G13 that works that way.
They are of course all USB HID devices, and that is how you can get at this if you're feeling adventurous - Real Mode HID API's. I messed around a little with the G13 when I discovered that Logitech's own software didn't report which device keystrokes are coming from. I'll see if I can find the stuff I did, although I never did get around to anything that resembled a finished product. I did however get to the point where I was capturing the keypresses coming from the G13 and from the G510 keyboard, so that I could assign them separate functions within FS. I seem to recall it was fairly tough going getting my head around this stuff at the time. You might want to check with the hardware manufacturer and see if they have an SDK available for the device you're using.
 
I am using the G13 device. I think I'll keep looking for a panel with buttons on it that FSX sees as a joystick.

Thanks...
 
I found my old code.
Would an in-process dll that picked up the keypresses from the G13 and sent events to the sim via SimConnect work for you? I would set it up so that the events were selectable of course.
 
Thank you but no, I don't need code to do that as I have the code now to do that. I don't want to use hot keys or key codes to do this. My joystick buttons do not register in simconnect as hot keys. My G13, as I have found out, is a keyboard device so it does register with the PC as a keyboard device and use hot keys. So the G13 is of no use to me in this case.

I'm still trying to determine what type or what kind of devices these two are when plugged in and connected to FSX? The joystick has several buttons on it that I can assign my camera views to and not use any hot keys to do that. The G13 buttons are seen as keyboard buttons and therefore only respond to hot keys. The basic device type of these two are obviously different but I don't know (yet) what that difference is. Both are HID types I'm sure but there must an additional class difference.
 
I'm not using Logitech's gaming software to program hotkeys for the G13, I'm reading the key presses using Raw Input.
https://msdn.microsoft.com/en-us/library/windows/desktop/ms645536(v=vs.85).aspx
I found Logitech's software quite limiting because it only allows you to emulate keyboard input. Yes, you can program G1 to send Ctrl-Shift-Z, but that raises two issues. 1. - I can press Ctrl-Shift-Z on the keyboard just fine; it's not saving me much, and 2. You have to use the in-game configuration menu to set up what Ctrl-Shift-Z does, and not all of the events available are listed there.

Anyway, the MSDN link should give you an idea as to the differentiation between devices.
 
Back
Top