Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news


  

Author Topic: Autohotkey for enabling VJOY for MK X  (Read 200 times)

0 Members and 2 Guests are viewing this topic.

Moksi

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 51
  • I want to build my own arcade controls!
Autohotkey for enabling VJOY for MK X
« on: November 08, 2017, 12:10:13 pm »
I got the script from someone on hyperspin forum , it doesnt work flawless yet

this is to enable the Vjoy virtual Joystick Driver only when launching exmple MK X

because this  driver interferes with other things like emulators , controls setup for taito type x is then seen as an xbox controller & not keyboard

So the main reason is to only enable the driver when launching MK X & Disable the driver when MK X exits.
Which can be done with a program called devcon

I got a launch & close scripts

Launch
---------------
#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

SetBatchLines -1


Run, C:\Windows\System32\devcon.exe enable vjoy*
Run, C:\Program Files (x86)\VJoy\VJoy.exe -file "C:\Program Files (x86)\Vjoy\MK10.ini"
Run, C:\Program Files (x86)\Steam\SteamApps\common\MK10\Binaries\Retail\MK10.exe
-----------------------------------------------------------------------------------
the script will work if the command prompt is run as administrator , i tested it in command prompt enabling disabling the driver.
not if it isnt run as administrator

How can i edit the script to get the command prompt to launch as admin & execute enabling / disabling vjoy

Cause the way it is now it isnt working out of the box


Any help appriciated

spacorn

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • I want to build my own arcade controls!
Re: Autohotkey for enabling VJOY for MK X
« Reply #1 on: November 08, 2017, 06:23:27 pm »
Sometimes Autohotkey has troubles running stuff that require elevated rights. Try running the script as administrator. If it works, you can set the Autohotkey exe itself to always open as administrator in the compatibily tab in the file's properties, this will give elevated rights to all your scripts.

Moksi

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 51
  • I want to build my own arcade controls!
Re: Autohotkey for enabling VJOY for MK X
« Reply #2 on: November 09, 2017, 04:13:44 pm »
Thanks, im gonna try to see if it works

Moksi

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 51
  • I want to build my own arcade controls!
Re: Autohotkey for enabling VJOY for MK X
« Reply #3 on: November 10, 2017, 06:11:21 am »
I tried it but it will ask for confirmation everytime & in hyperspin it doesnt show the confirmation

i dont know if its possible to get autohokey to start an elevated shortcut of the command prompt or autohotkey itself

spacorn

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 8
  • I want to build my own arcade controls!
Re: Autohotkey for enabling VJOY for MK X
« Reply #4 on: November 10, 2017, 09:58:57 am »
You could try making a .bat file for running/closing the problematic program. You could probably do all you need with a single .bat instead of an AHK script anyway, but if you want it to integrate this to your existing script, you could open the .bat file from your script in hidden mode, so you never see the command prompt, like this:

Run %YourBat%,, Hide

That way it would work exactly as if your .ahk did everything by itself.
I know it's an ugly solution, but it should work. I've used to successfully open/close programs with elevated rights that Autohotkey scripts can't handle even when opened with elevated rights itself (in my case it was Touchmote, the wiimote driver).


rablack97

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2116
  • If you don't try, you have no chance at innovation
Re: Autohotkey for enabling VJOY for MK X
« Reply #5 on: November 10, 2017, 05:15:48 pm »
its been ages, but i built a custom cab around MKX PC version, prior to netherrealm stopping support.

Was able to boot into MKX via hyperspin with controls enabled no issues w/vjoy.  I dont recall having to do what all your trying to do to get it to work.
   

2016 Texas Pinball Festival - Best Arcade In Show - MKX

Moksi

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 51
  • I want to build my own arcade controls!
Re: Autohotkey for enabling VJOY for MK X
« Reply #6 on: November 11, 2017, 04:33:54 am »
i want to enable the Vjoy driver only with certain Games like MK X & MK Komplete edition & when i exit the game disabling the Vjoy driver

it interferes with other emulators control type is not seen as keyboard

Moksi

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 51
  • I want to build my own arcade controls!
Re: Autohotkey for enabling VJOY for MK X
« Reply #7 on: November 11, 2017, 04:36:31 am »
You could try making a .bat file for running/closing the problematic program. You could probably do all you need with a single .bat instead of an AHK script anyway, but if you want it to integrate this to your existing script, you could open the .bat file from your script in hidden mode, so you never see the command prompt, like this:

Run %YourBat%,, Hide

That way it would work exactly as if your .ahk did everything by itself.
I know it's an ugly solution, but it should work. I've used to successfully open/close programs with elevated rights that Autohotkey scripts can't handle even when opened with elevated rights itself (in my case it was Touchmote, the wiimote driver).

wow i have no knowledge with .bat files

how can i make a bat file that enables vjoy driver (Device Manager) & disabling the driver when you exit the game ?

  
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31