GetKeyState does not support all joystick functions.
http://ahkscript.org/docs/KeyList.htm#Joystick
Windows supports up to 8 Axes:
The ones AHK currently supports:
X, Y, Z, R, U, V
However, for example in vJoy there are 8 axes, named like so:
X, Y, Z, RX, RY, RZ, SL0, SL1
Furthermore, AHK does not support the full range of buttons. Windows supports up to 128 buttons, not 32.
However, I think this is an extended thing, as Game controllers only displays the first 32.
This one is not so much of a big deal.
Finally, Windows supports up to 4 POV hats, and AHK only supports 1
Is there any chance this will be fixed?
Failing that, does anyone have a decent lib to provide access to the full range of stick inputs?
GetKeyState() does not support all joystick functions
Re: GetKeyState() does not support all joystick functions
Looking at the code just now, there's probably a limitation based on joystickapi.h which is part of the Windows APIevilC wrote:GetKeyState does not support all joystick functions.
http://ahkscript.org/docs/KeyList.htm#Joystick
Windows supports up to 8 Axes:
The ones AHK currently supports:
X, Y, Z, R, U, V
However, for example in vJoy there are 8 axes, named like so:
X, Y, Z, RX, RY, RZ, SL0, SL1
Furthermore, AHK does not support the full range of buttons. Windows supports up to 128 buttons, not 32.
However, I think this is an extended thing, as Game controllers only displays the first 32.
This one is not so much of a big deal.
Finally, Windows supports up to 4 POV hats, and AHK only supports 1
Is there any chance this will be fixed?
Failing that, does anyone have a decent lib to provide access to the full range of stick inputs?
This defines a bunch of enumerations like:
Code: Select all
#define JOY_RETURNX 0x00000001l
#define JOY_RETURNY 0x00000002l
#define JOY_RETURNZ 0x00000004l
#define JOY_RETURNR 0x00000008l
#define JOY_RETURNU 0x00000010l /* axis 5 */
#define JOY_RETURNV 0x00000020l /* axis 6 */
Obviously it's not possible to modify these files. I don't know how Windows deals with the extra 2 axes. Possibly via a different API...??? DirectX?
Re: GetKeyState() does not support all joystick functions
No.Is there any chance this will be fixed?
AutoHotkey supports the maximum number of controllers, axes, POV and buttons allowed by the Multimedia Joystick API.
This is not a bug.
Re: GetKeyState() does not support all joystick functions
"The multimedia joystick API has been superseded by DirectInput".
Is there any chance that AHK's joystick support will be moved to DirectInput?
Or would I have to hope and pray Microsoft remove WinMM from Windows 10?
Failing that, if I obtained or wrote a DirectInput library, would I be likely to see a significant performance hit over using GetKeyState?
Is there any chance that AHK's joystick support will be moved to DirectInput?
Or would I have to hope and pray Microsoft remove WinMM from Windows 10?
Failing that, if I obtained or wrote a DirectInput library, would I be likely to see a significant performance hit over using GetKeyState?
Re: GetKeyState() does not support all joystick functions
1. Not by me.
3. Probably not.
3. Probably not.
Note Use of legacy DirectInput is not recommended, and DirectInput is not available for Windows Store apps.
http://msdn.microsoft.com/en-us/library ... p/ee417014
Re: GetKeyState() does not support all joystick functions
XInput is for XBox 360 controllers only. DirectInput is still very much alive and kicking.lexikos wrote:Note Use of legacy DirectInput is not recommended, and DirectInput is not available for Windows Store apps.
http://msdn.microsoft.com/en-us/library ... p/ee417014
It's the simulation community that wants this - modern flight sticks have 8 axes and multiple POVs, and they cannot use AHK to read all the inputs.
Yes, they could use the software that comes with their stick, but the whole point is that the apps that come with these sticks often suck horribly (Or have major limitations), and people use my apps instead to configure their sticks.
From http://en.wikipedia.org/wiki/DirectInput
So yeah - XInput is worse than WinMM!XInput supports only "next generation" controllers. This limits it basically to controllers for the Xbox 360 that also have Windows drivers. Legacy Windows controllers, joysticks and generalized force-feedback devices are not supported.
XInput supports a maximum of four controllers at a time. This is an Xbox limit, carried over to Windows. Although as of 2010 few PC games require more than four controllers at once, DirectInput itself has no such limitation.
XInput supports maximum of 4 axes, 10 buttons, 2 triggers and 8-direction digital pad per controller, compared to DirectInput's support for 8 axes, 128 buttons, and full-range POV. (Incidentally, the number of axes, buttons and triggers XInput supports corresponds directly to the Xbox 360 controller.)
4 sticks, 6 axes, only 10 buttons ?!, 2 POVs
Re: GetKeyState() does not support all joystick functions
So is WinMM. Both are "deprecated". If you're going to hope and pray that Microsoft remove WinMM, you should also hope and pray that they don't remove DirectInput as well. Either way, they would break a whole lot of programs and alienate a lot of users, for no good reason that I can imagine.evilC wrote:DirectInput is still very much alive and kicking.
Re: GetKeyState() does not support all joystick functions
Not going to happen. Every single game on the market that can use joysticks other than XBox controllers uses DirectInput.lexikos wrote:So is WinMM. Both are "deprecated". If you're going to hope and pray that Microsoft remove WinMM, you should also hope and pray that they don't remove DirectInput as well. Either way, they would break a whole lot of programs and alienate a lot of users, for no good reason that I can imagine.evilC wrote:DirectInput is still very much alive and kicking.
WinMM stick input brings nothing to the table. It provides a subset of DI's functionality and will only be being used by a small percentage of applications (Things that use joystick input but are not games - that's a mighty small slice of a Venn Diagram).
Re: GetKeyState() does not support all joystick functions
That's my point.evilC wrote:Not going to happen.
That's a rather bold, and I don't doubt, inaccurate claim.Every single game on the market that can use joysticks other than XBox controllers uses DirectInput.
Re: GetKeyState() does not support all joystick functions
OK, maybe I should clarify that a bit.
What I meant was, games do not use WinMM, as evidenced by the fact that I have not seen or heard of a game in years that does not support the full 8 axes.
Apart from games with the "Games For Windows" logo - often these use XInput because they only support XBox controllers, but that is pretty rare.
From what I understand, a bunch of games now use RawInput, but whatever, the point I was making is that WinMM or anything that only provides 6 axis support is basically dead in the water.
What I meant was, games do not use WinMM, as evidenced by the fact that I have not seen or heard of a game in years that does not support the full 8 axes.
Apart from games with the "Games For Windows" logo - often these use XInput because they only support XBox controllers, but that is pretty rare.
From what I understand, a bunch of games now use RawInput, but whatever, the point I was making is that WinMM or anything that only provides 6 axis support is basically dead in the water.
Re: GetKeyState() does not support all joystick functions
I don't think anything is going to change here. :/
But, if you are trying to achieve something specific, alternatives may be your only option here.
But, if you are trying to achieve something specific, alternatives may be your only option here.
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Re: GetKeyState() does not support all joystick functions
Well I just need to be able to read all the axes and POVs that windows supports.
So would need some AHK code (Or a DLL that my AHK code can call) that accesses this info via something like DirectInput or RawInput .
So would need some AHK code (Or a DLL that my AHK code can call) that accesses this info via something like DirectInput or RawInput .
Re: GetKeyState() does not support all joystick functions
Sure, just "Ask For Help"! or do it on your own, which ever is preferred.
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]
Who is online
Users browsing this forum: No registered users and 42 guests