Search titles only
By:
Home
Forums
New posts
Search forums
Articles
New articles
New comments
Search articles
Pinball DB
Pinball Tables
Pinball Games
What's new
New posts
New articles
New profile posts
New article comments
Latest activity
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Welcome Back to Digital Pinball Fans -
please read this first
For latest updates, follow Digital Pinball Fans on
Facebook
and
Twitter
Home
Forums
Farsight Studios
The Pinball Arcade / Farsight Studios
Platform Specific
PC
Are emulated inputs the answer for parity with controller users?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="relaxation" data-source="post: 227032" data-attributes="member: 5759"><p>If you really need AHK support, which I'd advise against, this is what I could come up with so far for keyboard-only players.</p><p><em>You'll need to create a \Lib folder in ...\Program Files\AutoHotkey and put the <a href="https://github.com/evilC/AHK-CvJoyInterface" target="_blank">CvJoyInterface.ahk</a> file there in order for below to work.</em></p><p>[code];Emulated controller input for keyboard-only players of Pinball Sims</p><p>#SingleInstance, force</p><p>#include <CvJoyInterface></p><p>; shortening terms</p><p>vJ := new CvJoyInterface()</p><p>mS := vJ.Devices[1]</p><p>pos := vJ.PercentTovJoy(100)</p><p>rest := vJ.PercentTovJoy(50)</p><p>neg := vJ.PercentTovJoy(0)</p><p>posmod := vJ.PercentTovJoy(80)</p><p>negmod := vJ.PercentTovJoy(20)</p><p></p><p>; starting neutral state</p><p>mS.SetAxisByName(rest,"x")</p><p>mS.SetAxisByName(rest,"y")</p><p>mS.SetAxisByName(rest,"z")</p><p>mS.SetAxisByName(rest,"rx")</p><p>mS.SetAxisByName(rest,"ry")</p><p>mS.SetAxisByName(rest,"rz")</p><p></p><p>; modified power hotkeys via WASD</p><p>~*w::</p><p>KeyWait, w, D</p><p> mS.SetAxisByName(rest,"x")</p><p> mS.SetAxisByName(posmod,"y")</p><p>KeyWait, w</p><p> mS.SetAxisByName(rest,"y")</p><p> return</p><p>~*a::</p><p>KeyWait, a, D</p><p> mS.SetAxisByName(rest,"y")</p><p> mS.SetAxisByName(negmod,"x")</p><p>KeyWait, a</p><p> mS.SetAxisByName(rest,"x")</p><p> return</p><p>~*s::</p><p>KeyWait, s, D</p><p> mS.SetAxisByName(rest,"x")</p><p> mS.SetAxisByName(negmod,"y")</p><p>KeyWait, s</p><p> mS.SetAxisByName(rest,"y")</p><p> return</p><p>~*d::</p><p>KeyWait, d, D</p><p> mS.SetAxisByName(rest,"y")</p><p> mS.SetAxisByName(posmod,"x")</p><p>KeyWait, d</p><p> mS.SetAxisByName(rest,"x")</p><p> return</p><p> </p><p>; full power hotkeys via WASD with Alt held down</p><p>~*!w::</p><p>KeyWait, w, D</p><p> mS.SetAxisByName(rest,"x")</p><p> mS.SetAxisByName(pos,"y")</p><p>KeyWait, w</p><p> mS.SetAxisByName(rest,"y")</p><p> return</p><p>~*!a::</p><p>KeyWait, a, D</p><p> mS.SetAxisByName(rest,"y")</p><p> mS.SetAxisByName(neg,"x")</p><p>KeyWait, a</p><p> mS.SetAxisByName(rest,"x")</p><p> return</p><p>~*!s::</p><p>KeyWait, s, D</p><p> mS.SetAxisByName(rest,"x")</p><p> mS.SetAxisByName(neg,"y")</p><p>KeyWait, s</p><p> mS.SetAxisByName(rest,"y")</p><p> return</p><p>~*!d::</p><p>KeyWait, d, D</p><p> mS.SetAxisByName(rest,"y")</p><p> mS.SetAxisByName(pos,"x")</p><p>KeyWait, d</p><p> mS.SetAxisByName(rest,"x")</p><p> return[/code]</p><p>I tried loops, while getkeystates etc to get the line count down but those didn't work as reliably when striking the hotkey repeatedly at a quick pace. Couldn't bind the spacebar either when an astrisk is in use which is required because you may have a flipper engaged.</p><p></p><p>Currently I do not see AHK providing emulated nudge capabilities to cabs via accelerometer with this CvJoyInterface.. at least not in a way I understand from <a href="http://vjoystick.sourceforge.net/site/includes/SDK_ReadMe.pdf" target="_blank">their SDK</a></p></blockquote><p></p>
[QUOTE="relaxation, post: 227032, member: 5759"] If you really need AHK support, which I'd advise against, this is what I could come up with so far for keyboard-only players. [i]You'll need to create a \Lib folder in ...\Program Files\AutoHotkey and put the [url=https://github.com/evilC/AHK-CvJoyInterface]CvJoyInterface.ahk[/url] file there in order for below to work.[/i] [code];Emulated controller input for keyboard-only players of Pinball Sims #SingleInstance, force #include <CvJoyInterface> ; shortening terms vJ := new CvJoyInterface() mS := vJ.Devices[1] pos := vJ.PercentTovJoy(100) rest := vJ.PercentTovJoy(50) neg := vJ.PercentTovJoy(0) posmod := vJ.PercentTovJoy(80) negmod := vJ.PercentTovJoy(20) ; starting neutral state mS.SetAxisByName(rest,"x") mS.SetAxisByName(rest,"y") mS.SetAxisByName(rest,"z") mS.SetAxisByName(rest,"rx") mS.SetAxisByName(rest,"ry") mS.SetAxisByName(rest,"rz") ; modified power hotkeys via WASD ~*w:: KeyWait, w, D mS.SetAxisByName(rest,"x") mS.SetAxisByName(posmod,"y") KeyWait, w mS.SetAxisByName(rest,"y") return ~*a:: KeyWait, a, D mS.SetAxisByName(rest,"y") mS.SetAxisByName(negmod,"x") KeyWait, a mS.SetAxisByName(rest,"x") return ~*s:: KeyWait, s, D mS.SetAxisByName(rest,"x") mS.SetAxisByName(negmod,"y") KeyWait, s mS.SetAxisByName(rest,"y") return ~*d:: KeyWait, d, D mS.SetAxisByName(rest,"y") mS.SetAxisByName(posmod,"x") KeyWait, d mS.SetAxisByName(rest,"x") return ; full power hotkeys via WASD with Alt held down ~*!w:: KeyWait, w, D mS.SetAxisByName(rest,"x") mS.SetAxisByName(pos,"y") KeyWait, w mS.SetAxisByName(rest,"y") return ~*!a:: KeyWait, a, D mS.SetAxisByName(rest,"y") mS.SetAxisByName(neg,"x") KeyWait, a mS.SetAxisByName(rest,"x") return ~*!s:: KeyWait, s, D mS.SetAxisByName(rest,"x") mS.SetAxisByName(neg,"y") KeyWait, s mS.SetAxisByName(rest,"y") return ~*!d:: KeyWait, d, D mS.SetAxisByName(rest,"y") mS.SetAxisByName(pos,"x") KeyWait, d mS.SetAxisByName(rest,"x") return[/code] I tried loops, while getkeystates etc to get the line count down but those didn't work as reliably when striking the hotkey repeatedly at a quick pace. Couldn't bind the spacebar either when an astrisk is in use which is required because you may have a flipper engaged. Currently I do not see AHK providing emulated nudge capabilities to cabs via accelerometer with this CvJoyInterface.. at least not in a way I understand from [url=http://vjoystick.sourceforge.net/site/includes/SDK_ReadMe.pdf]their SDK[/url] [/QUOTE]
Verification
Post reply
Members online
No members online now.
Home
Forums
Farsight Studios
The Pinball Arcade / Farsight Studios
Platform Specific
PC
Are emulated inputs the answer for parity with controller users?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top