├── Setup.exe ├── .gitignore ├── button test.ahk ├── simple example.ahk ├── hat test.ahk ├── readme.md ├── gui example.ahk └── CvJoyInterface.ahk /Setup.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/evilC/AHK-CvJoyInterface/HEAD/Setup.exe -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.ini 2 | *.exe 3 | *.zip 4 | *.lnk 5 | *.scc 6 | *.png 7 | *.tmp.* 8 | Setup.ahk 9 | !Setup*.exe 10 | -------------------------------------------------------------------------------- /button test.ahk: -------------------------------------------------------------------------------- 1 | ; A test script to manipulate a vJoy stick so we can debug stick reading. 2 | 3 | #SingleInstance, force 4 | #include 5 | 6 | ; Create an object from vJoy Interface Class. 7 | vJoyInterface := new CvJoyInterface() 8 | 9 | ; Was vJoy installed and the DLL Loaded? 10 | if (!vJoyInterface.vJoyEnabled()){ 11 | ; Show log of what happened 12 | Msgbox % vJoyInterface.LoadLibraryLog 13 | ExitApp 14 | } 15 | 16 | myStick := vJoyInterface.Devices[1] 17 | key_down := 0 18 | 19 | ; End Startup Sequence 20 | Return 21 | 22 | ; Hotkeys 23 | F10:: 24 | if (key_down){ 25 | return 26 | } 27 | key_down := 1 28 | Loop 128 { 29 | myStick.SetBtn(1, A_Index) 30 | } 31 | SoundBeep 32 | ; On press of F10 try and press button 1 33 | Return 34 | 35 | F10 up:: 36 | key_down := 0 37 | ; On release of F10, release button 1 38 | Loop 128 { 39 | myStick.SetBtn(0, A_Index) 40 | } 41 | Return 42 | 43 | F12:: 44 | key_down := !key_down 45 | Loop 128 { 46 | myStick.SetBtn(key_down, A_Index) 47 | } 48 | SoundBeep 49 | ; On press of F10 try and press button 1 50 | Return 51 | -------------------------------------------------------------------------------- /simple example.ahk: -------------------------------------------------------------------------------- 1 | ; Simplest usage example. 2 | ; Minimal error checking (Just check if DLL loaded), just the bare essentials code-wise. 3 | 4 | #SingleInstance, force 5 | #include 6 | 7 | ; Create an object from vJoy Interface Class. 8 | vJoyInterface := new CvJoyInterface() 9 | 10 | ; Was vJoy installed and the DLL Loaded? 11 | if (!vJoyInterface.vJoyEnabled()){ 12 | ; Show log of what happened 13 | Msgbox % vJoyInterface.LoadLibraryLog 14 | ExitApp 15 | } 16 | 17 | myStick := vJoyInterface.Devices[1] 18 | 19 | ; End Startup Sequence 20 | Return 21 | 22 | ; Hotkeys 23 | F10:: 24 | ; On press of F10 try and press button 1 25 | myStick.SetBtn(1,1) 26 | Return 27 | 28 | F10 up:: 29 | ; On release of F10, release button 1 30 | myStick.SetBtn(0,1) 31 | Return 32 | 33 | ; Hotkeys 34 | F11:: 35 | ; Refer to the stick by name, move it to 0% 36 | myStick.SetAxisByName(0,"x") 37 | SoundBeep 38 | return 39 | 40 | F12:: 41 | ; Refer to the stick by index (axis number), move it to 100% (32768) 42 | myStick.SetAxisByIndex(vJoyInterface.PercentTovJoy(100),1) 43 | SoundBeep 44 | return -------------------------------------------------------------------------------- /hat test.ahk: -------------------------------------------------------------------------------- 1 | ; Operate the 4 hats of a continuous POV vjoy stick 2 | ; Minimal error checking (Just check if DLL loaded), just the bare essentials code-wise. 3 | 4 | #SingleInstance, force 5 | #include 6 | 7 | ; Create an object from vJoy Interface Class. 8 | vJoyInterface := new CvJoyInterface() 9 | 10 | ; Was vJoy installed and the DLL Loaded? 11 | if (!vJoyInterface.vJoyEnabled()){ 12 | ; Show log of what happened 13 | Msgbox % vJoyInterface.LoadLibraryLog 14 | ExitApp 15 | } 16 | 17 | myStick := vJoyInterface.Devices[1] 18 | 19 | ; End Startup Sequence 20 | Return 21 | 22 | ; Hotkeys 23 | F9:: 24 | ; On press, move hat up 25 | myStick.SetContPov(0, 1) 26 | Return 27 | 28 | F9 up:: 29 | ; On release, center hat 30 | myStick.SetContPov(-1, 1) 31 | Return 32 | 33 | F10:: 34 | ; On press, move hat up 35 | myStick.SetContPov(0, 2) 36 | Return 37 | 38 | F10 up:: 39 | ; On release, center hat 40 | myStick.SetContPov(-1, 2) 41 | Return 42 | 43 | F11:: 44 | ; On press, move hat up 45 | myStick.SetContPov(0, 3) 46 | Return 47 | 48 | F11 up:: 49 | ; On release, center hat 50 | myStick.SetContPov(-1, 3) 51 | Return 52 | 53 | F12:: 54 | ; On press, move hat up 55 | myStick.SetContPov(0, 4) 56 | Return 57 | 58 | F12 up:: 59 | ; On release, center hat 60 | myStick.SetContPov(-1, 4) 61 | Return 62 | 63 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | AHK-CvJoyInterface 2 | ================= 3 | 4 | A simple to use class for AutoHotkey to interface with [Shaul's vJoy](http://vjoystick.sourceforge.net) virtual joystick interface. 5 | 6 | Please make sure you use an up-to-date version of vJoy, it muse be at least version [2.0.4 241214](http://sourceforge.net/projects/vjoystick/files/Beta%202.x/2.0.4%20241214/vJoy_204_241214.exe/download) 7 | 8 | ### What does it do? 9 | It allows joystick **Output** from AutoHotkey to a virtual joystick (ie a stick that Windows thinks exists, but doesn't really). 10 | 11 | **Please note:** 12 | vJoy **must be installed** for this library to work. 13 | 14 | Example script included. 15 | 16 | ### Using this library in your projects 17 | #### Setup 18 | ##### Easy Method 19 | 1. Clone this project using GitHub for Windows. 20 | 1. Run `Setup.exe`. 21 | This will check you are all set up to use the library and configure AutoHotkey so you can easily include the library in any script in any folder on your computer. 22 | 2. Check the *DEVELOPER NOTES* section to see if there are any special instructions, then click *Install*. 23 | 3. You are now set up and can use this library by putting the following line at the start of your script: 24 | `#include ` 25 | 26 | ##### Manual Method 27 | If you know what you are doing, or paranoid, or both, you can just obtain the files and `#include` as normal. The Setup app simply makes it easy for people who don't really know what they are doing to get up and running with this library. 28 | 29 | #### Usage 30 | Help on usage should be obtainable from the following sources (Best to Worst): 31 | 32 | * Project [Wiki](https://github.com/evilC/AHK-CvJoyInterface/wiki) 33 | * Example scripts. 34 | These usually illustrate basic set-up and usage. 35 | * Library Source. 36 | May need to check this to see full list of features. 37 | 38 | -------------------------------------------------------------------------------- /gui example.ahk: -------------------------------------------------------------------------------- 1 | #SingleInstance, force 2 | #include 3 | 4 | ; Create an object from vJoy Interface Class. 5 | vJoyInterface := new CvJoyInterface() 6 | 7 | ; Was vJoy installed and the DLL Loaded? 8 | if (!vJoyInterface.vJoyEnabled()){ 9 | ; Show log of what happened 10 | Msgbox % vJoyInterface.LoadLibraryLog 11 | ExitApp 12 | } 13 | 14 | ; Create The GUI 15 | Gui, Add, Text, x70 y10, vJoy ID 16 | Gui, Add, DropDownList, x130 yp-2 w50 vVJoyID gOptionChanged, 1||2|3|4|5|6|7|8|9|10|11|12|13|14|15|16 17 | Gui, Add, Text, x70 y30, Status: 18 | Gui, Add, Text, x130 yp vStickStatus w50 Center, 19 | Gui, Add, Edit, x5 yp+20 W240 R3 vDeviceCaps 20 | Gui, Show, W250 21 | OnExit, GuiClose 22 | 23 | ; Fire OptionChanged to Acquire Stick 24 | Gosub, OptionChanged 25 | 26 | ; End Startup Sequence 27 | Return 28 | 29 | ; When the GUI changes (or at the start, run this) 30 | OptionChanged: 31 | Gui, Submit, NoHide ; Pull VjoyID through from GUI 32 | ; grab copy of helper object for this stick 33 | myStick := vJoyInterface.Devices[vJoyID] 34 | 35 | ; Acquire the stick 36 | ; Seeing as vJoyInterface.SingleStickMode defaults to 0, if another stick is already Acquired, it will be automatically Relinquished 37 | mystick.Acquire() 38 | 39 | ;vJoyInterface.GetVJDButtonNumber(vJoyID) 40 | out := "ID:`t" vJoyID " (" myStick.GetStatusName() ")`n" 41 | out .= "Buttons:`t" vJoyInterface.GetVJDButtonNumber(vJoyID) "`n" 42 | out .= "Axes:`t" 43 | Loop 8 { 44 | ;AxisNames 45 | if (vJoyInterface.GetVJDAxisExist(vJoyID, vJoyInterface.AxisIndex[A_Index])){ 46 | out .= vJoyInterface.AxisNames[A_Index] " " 47 | } 48 | } 49 | out .= "`n" 50 | GuiControl, ,DeviceCaps, % out 51 | 52 | ; Update status of this stick in the GUI 53 | GuiControl, ,StickStatus, % myStick.GetStatusName() 54 | Return 55 | 56 | ; Hotkeys 57 | F10:: 58 | ; On press of F10 try and press button 1 59 | myStick.SetBtn(1,1) 60 | Return 61 | 62 | F10 up:: 63 | ; On release of F10, release button 1 64 | myStick.SetBtn(0,1) 65 | Return 66 | 67 | F11:: 68 | ; Refer to the stick by name, move it to 0% 69 | myStick.SetAxisByName(0,"x") 70 | SoundBeep 71 | return 72 | 73 | F12:: 74 | ; Refer to the stick by index (axis number), move it to 100% (32768) 75 | myStick.SetAxisByIndex(vJoyInterface.PercentTovJoy(100),1) 76 | SoundBeep 77 | return 78 | 79 | ; Quit when we exit the GUI 80 | GuiClose: 81 | ExitApp -------------------------------------------------------------------------------- /CvJoyInterface.ahk: -------------------------------------------------------------------------------- 1 | 2 | Class CvJoyInterface { 3 | DebugMode := 0 4 | SingleStickMode := 1 ; If set to 1, helper classes will automatically relinquish existing vjoy device on attempting to acquire one not connected. 5 | ResetOnAcquire := 1 ; Resets Devices to vjoy norms on Acquire via helper classes. 6 | ResetOnRelinquish := 1 ; Resets Devices to vjoy norms on Relinquish via helper classes. 7 | LibraryLoaded := 0 ; Did the Library Load OK when the class Instantiated? 8 | LoadLibraryLog := "" ; If Not, holds log of why it failed. 9 | hModule := 0 ; handle to DLL 10 | Devices := [] ; Array for Helper Classes of Devices 11 | 12 | VJD_MAXDEV := 16 ; Max Number of Devices vJoy Supports 13 | 14 | ; ported from VjdStat in vjoyinterface.h 15 | VJD_STAT_OWN := 0 ; The vJoy Device is owned by this application. 16 | VJD_STAT_FREE := 1 ; The vJoy Device is NOT owned by any application (including this one). 17 | VJD_STAT_BUSY := 2 ; The vJoy Device is owned by another application. It cannot be acquired by this application. 18 | VJD_STAT_MISS := 3 ; The vJoy Device is missing. It either does not exist or the driver is down. 19 | VJD_STAT_UNKN := 4 ; Unknown 20 | 21 | ; HID Descriptor definitions(ported from public.h) 22 | HID_USAGE_X := 0x30 23 | HID_USAGE_Y := 0x31 24 | HID_USAGE_Z := 0x32 25 | HID_USAGE_RX:= 0x33 26 | HID_USAGE_RY:= 0x34 27 | HID_USAGE_RZ:= 0x35 28 | HID_USAGE_SL0:= 0x36 29 | HID_USAGE_SL1:= 0x37 30 | 31 | ; Handy lookups to axis HID_USAGE values 32 | AxisIndex := [0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37] ; Index (Axis Number) to HID Descriptor 33 | AxisAssoc := {x:0x30, y:0x31, z:0x32, rx:0x33, ry:0x34, rz: 0x35, sl1:0x36, sl2:0x37} ; Name (eg "x", "y", "z", "sl1") to HID Descriptor 34 | AxisNames := ["X","Y","Z","RX","RY","RZ","SL0","SL1"] 35 | 36 | ; ===== Device helper subclass. 37 | Class CvJoyDevice { 38 | IsOwned := 0 39 | 40 | GetStatus(){ 41 | return this.Interface.GetVJDStatus(this.DeviceID) 42 | } 43 | 44 | ; Converts Status to human readable form 45 | GetStatusName(){ 46 | DeviceStatus := this.GetStatus() 47 | if (DeviceStatus = this.Interface.VJD_STAT_OWN) { 48 | return "OWN" 49 | } else if (DeviceStatus = this.Interface.VJD_STAT_FREE) { 50 | return "FREE" 51 | } else if (DeviceStatus = this.Interface.VJD_STAT_BUSY) { 52 | return "BUSY" 53 | } else if (DeviceStatus = this.Interface.VJD_STAT_MISS) { 54 | return "MISS" 55 | } else { 56 | return "???" 57 | } 58 | } 59 | 60 | ; Acquire the device 61 | Acquire(){ 62 | if (this.IsOwned){ 63 | return 1 64 | } 65 | if (this.Interface.SingleStickMode){ 66 | Loop % this.Interface.Devices.MaxIndex() { 67 | if (A_Index == this.DeviceID){ 68 | Continue 69 | } 70 | if (this.Interface.Devices[A_Index].IsOwned){ 71 | this.Interface.Devices[A_Index].Relinquish() 72 | break 73 | } 74 | } 75 | } 76 | ret := this.Interface.AcquireVJD(this.DeviceID) 77 | if (ret && this.Interface.ResetOnAcquire){ 78 | ; Reset the Device so it centers 79 | this.Interface.ResetVJD(this.DeviceID) 80 | } else { 81 | if (this.Interface.DebugMode) { 82 | OutputDebug, % "Error in " A_ThisFunc "`nDeviceID = " this.DeviceID ", ErrorLevel: " ErrorLevel ", Device Status: " this.GetStatusName() 83 | } 84 | } 85 | return ret 86 | } 87 | 88 | ; Relinquish the device, resetting it if Owned 89 | Relinquish(){ 90 | if (this.IsOwned && this.Interface.ResetOnRelinquish){ 91 | this.Interface.ResetVJD(this.DeviceID) 92 | } 93 | return this.Interface.RelinquishVJD(this.DeviceID) 94 | } 95 | 96 | Reset(){ 97 | this.Interface.ResetVJD(this.DeviceID) 98 | } 99 | 100 | ResetButtons(){ 101 | this.Interface.ResetButtons(this.DeviceID) 102 | } 103 | 104 | ResetPovs(){ 105 | this.Interface.ResetPovs(this.DeviceID) 106 | } 107 | 108 | ; Does the device exist or not? 109 | IsEnabled(){ 110 | state := this.GetStatus() 111 | return state != this.Interface.VJD_STAT_MISS && state != this.Interface.VJD_STAT_UNKN 112 | } 113 | 114 | ; Is it possible to take control of the device? 115 | IsAvailable(){ 116 | state := this.GetStatus() 117 | return state == this.Interface.VJD_STAT_FREE || state == this.Interface.VJD_STAT_OWN 118 | } 119 | 120 | ; Set Axis by Index number. 121 | ; eg x = 1, y = 2, z = 3, rx = 4 122 | SetAxisByIndex(axis_val, index){ 123 | if (!this.Acquire()){ 124 | return 0 125 | } 126 | return this.Interface.SetAxis(axis_val, this.DeviceID, this.Interface.AxisIndex[index]) 127 | } 128 | 129 | ; Set Axis by Name 130 | ; eg "x", "y", "z", "rx" 131 | SetAxisByName(axis_val, name){ 132 | if (!this.Acquire()){ 133 | return 0 134 | } 135 | return this.Interface.SetAxis(axis_val, this.DeviceID, this.Interface.AxisAssoc[name]) 136 | } 137 | 138 | SetBtn(btn_val, btn){ 139 | if (!this.Acquire()){ 140 | return 0 141 | } 142 | return this.Interface.SetBtn(btn_val, this.DeviceID, btn) 143 | } 144 | 145 | SetDiscPov(pov_val, pov){ 146 | if (!this.Acquire()){ 147 | return 0 148 | } 149 | return this.Interface.SetDiscPov(pov_val, this.DeviceID, pov) 150 | } 151 | 152 | SetContPov(pov_val, pov){ 153 | if (!this.Acquire()){ 154 | return 0 155 | } 156 | return this.Interface.SetContPov(pov_val, this.DeviceID, pov) 157 | } 158 | 159 | ; Constructor 160 | __New(id, parent){ 161 | this.DeviceID := id 162 | this.Interface := parent 163 | } 164 | 165 | ; Destructor 166 | __Delete(){ 167 | this.Relinquish() 168 | } 169 | } 170 | 171 | ; ===== Constructors / Destructors 172 | __New(){ 173 | ; Build Device array 174 | Loop % this.VJD_MAXDEV { 175 | this.Devices[A_Index] := new this.CvJoyDevice(A_Index, this) 176 | } 177 | 178 | ; Try and Load the DLL 179 | this.LoadLibrary() 180 | return this 181 | } 182 | 183 | __Delete(){ 184 | ; Relinquish Devices 185 | Loop % this.VJD_MAXDEV { 186 | this.Devices[A_Index].Relinquish() 187 | } 188 | 189 | ; Unload DLL 190 | if (this.hModule){ 191 | DllCall("FreeLibrary", "Ptr", this.hModule) 192 | } 193 | } 194 | 195 | ; ===== Helper Functions 196 | ; Converts vJoy range (0->32768 to a range like an AHK input 0->100) 197 | PercentTovJoy(percent){ 198 | return percent * 327.68 199 | } 200 | 201 | vJoyToPercent(vJoy){ 202 | return vJoy / 327.68 203 | } 204 | 205 | ; ===== DLL loading / vJoy Install detection 206 | 207 | ; Load the vJoyInterface DLL. 208 | LoadLibrary() { 209 | ;Global hModule 210 | 211 | if (this.LibraryLoaded) { 212 | this.LoadLibraryLog .= "Library already loaded. Aborting...`n" 213 | return 1 214 | } 215 | 216 | this.LoadLibraryLog := "" 217 | 218 | ; Check if vJoy is installed. Even with the DLL, if vJoy is not installed it will not work... 219 | ; Find vJoy install folder by looking for registry key. 220 | if (A_Is64bitOS && A_PtrSize != 8){ 221 | SetRegView 64 222 | } 223 | RegRead vJoyFolder, HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8E31F76F-74C3-47F1-9550-E041EEDC5FBB}_is1, InstallLocation 224 | 225 | if (!vJoyFolder){ 226 | this.LoadLibraryLog .= "ERROR: Could not find the vJoy Registry Key.`n`nvJoy does not appear to be installed.`nPlease ensure you have installed vJoy from`n`nhttp://vjoystick.sourceforge.net." 227 | return 0 228 | } 229 | 230 | ; Try to find location of correct DLL. 231 | ; vJoy versions prior to 2.0.4 241214 lack these registry keys - if key not found, advise update. 232 | if (A_PtrSize == 8){ 233 | ; 64-Bit AHK 234 | DllKey := "DllX64Location" 235 | } else { 236 | ; 32-Bit AHK 237 | DllKey := "DllX86Location" 238 | } 239 | RegRead DllFolder, HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{8E31F76F-74C3-47F1-9550-E041EEDC5FBB}_is1, % DllKey 240 | 241 | if (!DllFolder){ 242 | ; Could not find registry entry. Advise vJoy update. 243 | this.LoadLibraryLog .= "A vJoy install was found in " vJoyFolder ", but it appears to be an old version.`nPlease update vJoy to the latest version from `n`nhttp://vjoystick.sourceforge.net." 244 | return 0 245 | } 246 | 247 | DllFolder .= "\" 248 | 249 | ; All good so far, try and load the DLL 250 | DllFile := "vJoyInterface.dll" 251 | this.LoadLibraryLog := "vJoy Install Detected. Trying to load " DllFile "...`n" 252 | CheckLocations := [DllFolder DllFile] 253 | 254 | hModule := 0 255 | Loop % CheckLocations.Maxindex() { 256 | this.LoadLibraryLog .= "Checking " CheckLocations[A_Index] "... " 257 | if (FileExist(CheckLocations[A_Index])){ 258 | this.LoadLibraryLog .= "FOUND.`nTrying to load.. " 259 | hModule := DLLCall("LoadLibrary", "Str", CheckLocations[A_Index]) 260 | if (hModule){ 261 | this.hModule := hModule 262 | this.LoadLibraryLog .= "OK.`n" 263 | this.LoadLibraryLog .= "Checking driver enabled... " 264 | if (this.vJoyEnabled()){ 265 | this.LibraryLoaded := 1 266 | this.LoadLibraryLog .= "OK.`n" 267 | this.LoadLibraryLog .= "Loaded vJoy DLL version " this.GetvJoyVersion() "`n" 268 | if (this.DebugMode){ 269 | OutputDebug, % this.LoadLibraryLog 270 | } 271 | return 1 272 | } else { 273 | this.LoadLibraryLog .= "FAILED.`n" 274 | } 275 | } else { 276 | this.LoadLibraryLog .= "FAILED.`n" 277 | } 278 | } else { 279 | this.LoadLibraryLog .= "NOT FOUND.`n" 280 | } 281 | } 282 | this.LoadLibraryLog .= "`nFailed to load valid " DllFile "`n" 283 | this.LibraryLoaded := 0 284 | return 0 285 | } 286 | 287 | ; ===== vJoy Interface DLL call wrappers 288 | ; In the order detailed in the vJoy SDK's Interface Function Reference 289 | ; http://sourceforge.net/projects/vjoystick/files/ 290 | 291 | ; === General driver data 292 | vJoyEnabled(){ 293 | return DllCall("vJoyInterface\vJoyEnabled") 294 | } 295 | 296 | GetvJoyVersion(){ 297 | return DllCall("vJoyInterface\GetvJoyVersion") 298 | } 299 | 300 | GetvJoyProductString(){ 301 | return DllCall("vJoyInterface\GetvJoyProductString") 302 | } 303 | 304 | GetvJoyManufacturerString(){ 305 | return DllCall("vJoyInterface\GetvJoyManufacturerString") 306 | } 307 | 308 | GetvJoySerialNumberString(){ 309 | return DllCall("vJoyInterface\GetvJoySerialNumberString") 310 | } 311 | 312 | ; === Write access to vJoy Device 313 | GetVJDStatus(rID){ 314 | return DllCall("vJoyInterface\GetVJDStatus", "UInt", rID) 315 | } 316 | 317 | ; Handle setting IsOwned property outside helper class, to allow mixing 318 | AcquireVJD(rID){ 319 | this.Devices[rID].IsOwned := DllCall("vJoyInterface\AcquireVJD", "UInt", rID) 320 | return this.Devices[rID].IsOwned 321 | } 322 | 323 | RelinquishVJD(rID){ 324 | DllCall("vJoyInterface\RelinquishVJD", "UInt", rID) 325 | this.Devices[rID].IsOwned := 0 326 | return this.Devices[rID].IsOwned 327 | } 328 | 329 | ; Not sure if this one is good. What is a "PVOID"? 330 | UpdateVJD(rID, pData){ 331 | return DllCall("vJoyInterface\UpdateVJD", "UInt", rID, "PVOID", pData) 332 | } 333 | 334 | ; === vJoy Device properties 335 | 336 | GetVJDButtonNumber(rID){ 337 | return DllCall("vJoyInterface\GetVJDButtonNumber", "UInt", rID) 338 | } 339 | 340 | GetVJDDiscPovNumber(rID){ 341 | return DllCall("vJoyInterface\GetVJDDiscPovNumber", "UInt", rID) 342 | } 343 | 344 | GetVJDContPovNumber(rID){ 345 | return DllCall("vJoyInterface\GetVJDContPovNumber", "UInt", rID) 346 | } 347 | 348 | GetVJDAxisExist(rID, Axis){ 349 | return DllCall("vJoyInterface\GetVJDAxisExist", "UInt", rID, "Uint", Axis) 350 | } 351 | 352 | ResetVJD(rID){ 353 | return DllCall("vJoyInterface\ResetVJD", "UInt", rID) 354 | } 355 | 356 | ResetAll(){ 357 | return DllCall("vJoyInterface\ResetAll") 358 | } 359 | 360 | ResetButtons(rID){ 361 | return DllCall("vJoyInterface\ResetButtons", "UInt", rID) 362 | } 363 | 364 | ResetPovs(rID){ 365 | return DllCall("vJoyInterface\ResetPovs", "UInt", rID) 366 | } 367 | 368 | SetAxis(Value, rID, Axis){ 369 | return DllCall("vJoyInterface\SetAxis", "Int", Value, "UInt", rID, "UInt", Axis) 370 | } 371 | 372 | SetBtn(Value, rID, nBtn){ 373 | return DllCall("vJoyInterface\SetBtn", "Int", Value, "UInt", rID, "UInt", nBtn) 374 | } 375 | 376 | SetDiscPov(Value, rID, nPov){ 377 | return DllCall("vJoyInterface\SetDiscPov", "Int", Value, "UInt", rID, "UChar", nPov) 378 | } 379 | 380 | SetContPov(Value, rID, nPOV){ 381 | return DllCall("vJoyInterface\SetContPov", "Int", Value, "UInt", rID, "UChar", nPov) 382 | } 383 | 384 | } --------------------------------------------------------------------------------