Jump to content

Anyone With A Multi-Hat Joystick That Knows A Little Autohotkey?


12 replies to this topic

#1 evilC

    Member

  • PipPipPipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 1,298 posts
  • LocationLondon, UK

Posted 27 January 2013 - 04:00 AM

If you have a joystick with multiple hat (POV) switches and know a little AutoHotkey, if you could let me know how to detect the state of hats other than the first one, I would much appreciate it.
I *think* JoyPov1, JoyPov2 etc should work.

If someone can find this out, I can add proper support for hat switches to my Universal Joystick Remapper.

#2 CyBerkut

    Member

  • PipPipPipPipPipPipPip
  • 609 posts
  • LocationSomewhere north of St. Petersburg

Posted 27 January 2013 - 10:08 AM

I'm not an AHK maven, but I did a search in their forums. Maybe this will help:

http://www.autohotke...pov#entry567147

Edit: Ah, nevermind... I see you are in that thread! :P

Edited by CyBerkut, 27 January 2013 - 10:09 AM.


#3 CyBerkut

    Member

  • PipPipPipPipPipPipPip
  • 609 posts
  • LocationSomewhere north of St. Petersburg

Posted 27 January 2013 - 10:12 AM

I gather you are seeing the same thing that I am..... that all of the POV references seem to be for a single POV hat per stick. That's a shame.

#4 evilC

    Member

  • PipPipPipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 1,298 posts
  • LocationLondon, UK

Posted 27 January 2013 - 10:46 AM

I suspect the data may be in there - for example, for me, 9000 is right (east) on my single hat.
I suspect if you had a second hat, holding east on both may give something like 9090

If you have a multi-hat stick, try this code:

 
Loop
{
GetKeyState, POV, 1JoyPOV ; May need to change to 2JoyPOV etc...
Tooltip, %POV%
}


Can you see any change in the number when moving the second hat?

#5 CyBerkut

    Member

  • PipPipPipPipPipPipPip
  • 609 posts
  • LocationSomewhere north of St. Petersburg

Posted 28 January 2013 - 03:58 PM

I did not mean to give the impression that I'm using Auto Hot Key. I just took a look into your question, as I would like to see your project succeed.

While there are advantages to your UJR project compared to SST, they are not currently enough to get me to mess with running 64 bit Win 7 in test mode again. I did it once when looking into PPJoy, and for me it's just not worth it. My X52Pro is detected, and SST & the MWO options can do what I want for now... (except for MWO's leg turning being digital). For me, for now, I use the X52Pro throttle and a mouse, along with Saitek Combat Rudder Pedals. If I wanted to get to an analog-like work around for the leg turning badly enough, I'd probably spend more time fooling with an SST based idea (probably similar to what Locnar has done with Thrustmaster's T.A.R.G.E.T. software), or I'd get off my wallet and buy a TM Warthog HOTAS and hit Locnar up for his script :D The rudder pedals are good enough (for now) for the leg turning, but I'd really like to see PGI get some decent Joystick/HOTAS support in for all the various aspects of each axis... the stuff we typically see in Combat Flight Sims, such as the DCS series, for instance. I realize the CryEngine being used doesn't have it built-in... but I also believe that PGI needs to address that short coming properly. They also need to get a training map going, such that people can go in there and experiment with configurations without messing up other people's matches.

Nonetheless, like Locnar, I'd like to see your project work out and achieve what you want. If you eventually came up with a way to do it without test mode in 64 Bit Win 7, even better!

#6 evilC

    Member

  • PipPipPipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 1,298 posts
  • LocationLondon, UK

Posted 29 January 2013 - 01:38 PM

Just FYI, to test the code I posted above, you do not need test mode.
You only need test mode to make a virtual joystick as the vJoy device driver is unsigned.
AutoHotkey works without test mode - the code above is just to detect a physical stick.

#7 CyBerkut

    Member

  • PipPipPipPipPipPipPip
  • 609 posts
  • LocationSomewhere north of St. Petersburg

Posted 03 February 2013 - 09:44 AM

View PostevilC, on 27 January 2013 - 10:46 AM, said:

I suspect the data may be in there - for example, for me, 9000 is right (east) on my single hat.
I suspect if you had a second hat, holding east on both may give something like 9090

If you have a multi-hat stick, try this code:

 
Loop
{
GetKeyState, POV, 1JoyPOV ; May need to change to 2JoyPOV etc...
Tooltip, %POV%
}


Can you see any change in the number when moving the second hat?


OK, I went ahead and installed AHK. Ran the script. The tooltip number changes for the 1st POV hat (lower one on X-52 Pro) movement. It remains at -1 while moving the other hat switch.

#8 evilC

    Member

  • PipPipPipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 1,298 posts
  • LocationLondon, UK

Posted 03 February 2013 - 09:58 AM

Bummer, thanks for trying!
Surely though, if a stick comes with more than one hat, it is gonna have software to program it?
I guess I can add support for one hat to UJR, and if you have more than 1 hat, you just program them to mimic keys.

#9 Hammerhai

    Member

  • PipPipPipPipPipPipPip
  • Bad Company
  • Bad Company
  • 998 posts

Posted 04 February 2013 - 07:29 AM

You will most likely have to:
I had a look at JS support in AHK and it seems to be set up for single stick, one POV only. For the life of me I cannot remember what I wanted to do though.
Here is where MWO may drop the other shoe: At least with a G 940 logitech MWO will miss virtual keystrokes and drop random KB up/down events. I reported this to support at the time. The relevant softwares are 5.09 and 5.10
So far I have not had that problem with the TM Warthog.

#10 evilC

    Member

  • PipPipPipPipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 1,298 posts
  • LocationLondon, UK

Posted 04 February 2013 - 09:06 AM

AHK definitely supports multiple sticks, although the documentation makes scant mention of it.

The code for other joysticks is to put a number before "Joy".

So the X axis on Joystick 1 is 1JoyX or just JoyX, but for Joystick 2 you must use 2JoyX

I had a similar issue with missed keystrokes from the logitech software when I also had XMouse running as well as the logitech drivers.
Do you have anything custom like that running?

#11 Hammerhai

    Member

  • PipPipPipPipPipPipPip
  • Bad Company
  • Bad Company
  • 998 posts

Posted 04 February 2013 - 01:31 PM

Nope. I am very happy with what I could see of the TM software. (The virtual joystick it creates for compatibility with older games). And with the G 940 it happened even with a vanilla install, so IMHO it was not Xmouse.
Give me a shout if you need something tested on the warthog.

#12 CyBerkut

    Member

  • PipPipPipPipPipPipPip
  • 609 posts
  • LocationSomewhere north of St. Petersburg

Posted 04 February 2013 - 04:29 PM

View PostevilC, on 03 February 2013 - 09:58 AM, said:

Bummer, thanks for trying!
Surely though, if a stick comes with more than one hat, it is gonna have software to program it?
I guess I can add support for one hat to UJR, and if you have more than 1 hat, you just program them to mimic keys.


Well, the Saitek sticks have SST available as profiling software.

In the control panel, with Saitek's drivers installed, the second hat is portrayed in the same manner as the first hat. I can't say for sure, but I seem to recall that when the Microsoft Windows drivers were relied upon instead, there was something notably different in the control panel... and I think it was that the 2nd POV hat was interpreted as higher numbered button presses (and the 'hat' on the throttle was handled similarly, I think).

With the Saitek drivers installed, the control panel 'skips' some button numbers. 17, 18, 20 through 30, 35 through 38 are all 'missing'. The highest button number displayed is 39, which corresponds to the rightmost rotary on the throttle base, when it is pressed like a button.

So... if somebody has a Saitek X52, or X-52Pro installed, but is using the Microsoft drivers instead of the Saitek drivers, they may be able to give you something more definitive to go on. Chances are though, that somebody with one of those sticks will be using Saitek drivers and Saitek SST profiling software.

#13 PeptoB

    Member

  • PipPipPipPipPip
  • 109 posts
  • LocationUSA, Bread Basket

Posted 05 February 2013 - 07:28 PM

View PostCyBerkut, on 04 February 2013 - 04:29 PM, said:


Well, the Saitek sticks have SST available as profiling software.

In the control panel, with Saitek's drivers installed, the second hat is portrayed in the same manner as the first hat. I can't say for sure, but I seem to recall that when the Microsoft Windows drivers were relied upon instead, there was something notably different in the control panel... and I think it was that the 2nd POV hat was interpreted as higher numbered button presses (and the 'hat' on the throttle was handled similarly, I think).

With the Saitek drivers installed, the control panel 'skips' some button numbers. 17, 18, 20 through 30, 35 through 38 are all 'missing'. The highest button number displayed is 39, which corresponds to the rightmost rotary on the throttle base, when it is pressed like a button.

So... if somebody has a Saitek X52, or X-52Pro installed, but is using the Microsoft drivers instead of the Saitek drivers, they may be able to give you something more definitive to go on. Chances are though, that somebody with one of those sticks will be using Saitek drivers and Saitek SST profiling software.



Interesting Thread. I have been using my X-52 Pro well into the early days of closed beta. There used to be a couple of really good threads about specific setups for the X-52 pro (not the post from Eternal Core, no dissing intended).

Sadly, those threads are lost, and I don't see some of my fellow contributors to those threads much anymore. I was one of those contributors, but frankly, I got lazy.

Anyway, I was not able to find any decent method to get both hat's on the joystick as a POV that did anything useful in MWO. Instead, I use SST to remap the second POV to button toggle presses, such as target nearest enemy etc.

One of these days, maybe I'll get enough ambition to repost some of our great findings. We drummed up a pretty good SST and User.cfg for the X-52 pro.

The only thing severly lacking is the analog right/left turn. It cannot be done with SST, or any mods to the cfg files. This is one where PGI needs to step up and take action. Allowing it to go on for this long is no longer excusable.

Pepto :(

Edited by PeptoB, 05 February 2013 - 07:32 PM.






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users