1
votes

I'm currently trying to change the value of my joystick's (T.16000M) Y axis using AutoHotKey.

A little background first: I'm configuring some voice commands for Star Citizen, and I'm trying to write a script that would activate decoupled mode (so that I have 6 degrees of freedom), after which I would potentially adjust my ship's pitch by a full 180 degrees along the Y axis. I've discovered that I can't exactly do this using VoiceAttack alone, because within the game, only raw mouse input is accepted, and I cannot figure out how to simulate raw mouse input with either VoiceAttack or AutoHotKey.

Therefore, my next best solution would be to change the value of my joystick's Y axis, if this is at all possible in AutoHotKey. I've done tons of googling, and I've searched the entire documentation for any clue on how to achieve my goal.

I understand that JoyX, JoyY, JoyZ, etc., can be used to map joystick input to some other sort of control, like in this script that maps joystick input to the mouse cursor.

I hope this post is appropriate for StackOverflow; I wasn't exactly sure where else to put it. Maybe superuser?

Anyway, thanks for your help.

By the way, here is the code I was planning to use for the mouse:

MouseMove, 0, 500, 10, R
MouseMove, 0, -500, 10, R

This works in Windows, but not in the game, because the game only accepts raw mouse input.

1
Does #InstallMouseHook help?Joe DF
I'll try it out when I get home from work.dsmith86
Please post more of your script. Is MouseMove triggered by a hotkey? If so, does the hotkey fail to trigger or does the window not receive the MouseMove? Since I suspect that the mouse hook won't help here, first play around with variations SendMode. Second, you could combine this with different settings for SendLevel. Not sure if SendLevel can be helpful, though.MCL

1 Answers

0
votes

To simulate raw mouse movement with AutoHotkey, use DllCall("mouse_event"... (Google it, there are tons of examples).
To get VoiceAttack-like functionality in AHK, see HotVoice
It is absolutely impossible to alter a joystick in AHK like you can alter keyboard. You need to create an extra virtual joystick and send output to that. See CvJoyInterface.