-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3634ad9
commit 75b3cab
Showing
4 changed files
with
1,155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
; Check the readme provided | ||
; Also damned good job for actually checking the script before you ran it +10 Points | ||
|
||
|
||
;;; Debugging | ||
;;;#Warn | ||
;;;If !(A_IsAdmin) { | ||
;;; Msgbox Script needs to be run with admin rights, press ok to run as admin instead. | ||
;;; Run *RunAs "%A_ScriptFullPath%" | ||
;;;} | ||
|
||
#NoEnv | ||
SendMode InputThenPlay | ||
#SingleInstance, force | ||
#IfTimeout 100 | ||
|
||
; Loads vjoy_lib.ahk from the location of AFMAnalogAxis.ahk | ||
SetWorkingDir %A_ScriptDir% | ||
#include vjoy_lib.ahk | ||
|
||
; A warning will appear if this is set too low | ||
; May need to be raised if your mouse is able to scroll quickly | ||
#MaxHotkeysPerInterval, 250 | ||
|
||
; Set the vjoy device id (Controller ID) | ||
; Leave default unless | ||
vjoy_id := 1 | ||
|
||
; Init the vJoy stick | ||
vjoy_init(vjoy_id) | ||
|
||
; Check SL0 axis exists on stick | ||
if (!VJoy_GetAxisExist_SL0(vjoy_id)){ | ||
msgbox Please enable the SL0 axis of vjoy ID %vjoy_id% using the vJoy config utility. | ||
} | ||
|
||
; Reload script : F1 | ||
F1:: | ||
Reload | ||
SoundBeep | ||
Return | ||
|
||
; Emergency script kill : Shift+F1 | ||
+F1::ExitApp | ||
|
||
|
||
;################### | ||
;Slow traverse speed | ||
;################### | ||
; Shift + Wheel = 5% | ||
+WheelUp:: | ||
; Pick a number between 0 and 32767 and store it in val | ||
val += 1638.25 ;This will set the traverse speed | ||
IfLess val,0, SetEnv val,0 | ||
IfGreater val,32767, SetEnv val,32767 | ||
; Set axis value | ||
VJoy_SetAxis(val, vjoy_id, HID_USAGE_SL0) | ||
return | ||
|
||
+WheelDown:: | ||
; Pick a number between 0 and 32767 and store it in val | ||
val -= 1638.25 ;This will set the traverse speed | ||
IfLess val,0, SetEnv val,0 | ||
IfGreater val,32767, SetEnv val,32767 | ||
; Set axis value | ||
VJoy_SetAxis(val, vjoy_id, HID_USAGE_SL0) | ||
return | ||
|
||
;################### | ||
;Fast traverse speed | ||
;################### | ||
;Ctrl + Wheel = 10% x 1% Multiplier | ||
|
||
^WheelUp:: | ||
val += 3276.7 ;This will set the traverse speed | ||
; Set axis value | ||
IfLess val,0, SetEnv val,0 | ||
IfGreater val,32767, SetEnv val,32767 | ||
|
||
VJoy_SetAxis(val, vjoy_id, HID_USAGE_SL0) | ||
return | ||
|
||
^WheelDown:: | ||
val -= 3276.7 ;This will set the traverse speed | ||
; Set axis value | ||
IfLess val,0, SetEnv val,0 | ||
IfGreater val,32767, SetEnv val,32767 | ||
|
||
VJoy_SetAxis(val, vjoy_id, HID_USAGE_SL0) | ||
return | ||
|
||
|
||
x:: | ||
val = 32767 | ||
VJoy_SetAxis(val, vjoy_id, HID_USAGE_SL0) | ||
sleep, 500 | ||
val = 0 | ||
VJoy_SetAxis(val, vjoy_id, HID_USAGE_SL0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
; Check the readme provided | ||
; Good job for actually checking the script before you ran it +10 Points | ||
|
||
;;; Debugging | ||
;;;#Warn | ||
;;;If !(A_IsAdmin) { | ||
;;; Msgbox Script needs to be run with admin rights, press ok to run as admin instead. | ||
;;; Run *RunAs "%A_ScriptFullPath%" | ||
;;;} | ||
|
||
#NoEnv | ||
SendMode InputThenPlay | ||
#SingleInstance, force | ||
#IfTimeout 100 | ||
SetWorkingDir %A_ScriptDir% | ||
#include vjoy_lib.ahk | ||
#MaxHotkeysPerInterval, 250 | ||
vjoy_id := 1 | ||
vjoy_init(vjoy_id) | ||
|
||
;KeyboardHooks to record keypresses inside of Arma | ||
#InstallKeybdHook | ||
#UseHook On | ||
|
||
; Check SL0 axis exists on stick | ||
if (!VJoy_GetAxisExist_SL0(vjoy_id)){ | ||
msgbox Please enable the SL0 axis of vjoy ID %vjoy_id% using the vJoy config utility. | ||
} | ||
|
||
; Reload script : F1 | ||
F1:: | ||
Reload | ||
SoundBeep | ||
Return | ||
|
||
; Emergency script kill : Shift+F1 | ||
+F1::ExitApp | ||
|
||
x:: | ||
SoundBeep | ||
; Raise from 50% to 100% | ||
val = 16383 | ||
VJoy_SetAxis(val, vjoy_id, HID_USAGE_SL0) | ||
sleep, 500 | ||
val = 32767 | ||
VJoy_SetAxis(val, vjoy_id, HID_USAGE_SL0) | ||
sleep, 500 | ||
|
||
; Lower from 50% to 0% | ||
val = 16383 | ||
VJoy_SetAxis(val, vjoy_id, HID_USAGE_SL0) | ||
sleep, 500 | ||
val = 0 | ||
VJoy_SetAxis(val, vjoy_id, HID_USAGE_SL0) | ||
SoundBeep | ||
Return |
Oops, something went wrong.