Meant to be Seen
https://www.mtbs3d.com/phpbb/

Trouble reading input from Razer Hydra
https://www.mtbs3d.com/phpbb/viewtopic.php?f=139&t=22882
Page 1 of 1

Author:  Jayman2000 [ Tue Sep 04, 2018 6:10 pm ]
Post subject:  Trouble reading input from Razer Hydra

Hello,

I am trying to play Burnout Paradise with a Razer Hydra. On a standard controller, Burnout Paradise uses the right trigger as the gas peddle, and the left trigger as brake. To start an event, you need to hold down both the gas peddle and the brake at the same time. The Windows driver for the Razer Hydra binds both triggers to one axis, with the right trigger being negative, and the left trigger being positive.

To solve theis problem, I decided to try and write a FreePIE script that would bind the controls on the Razer Hydra to a vJoy device. As an initial test, I wrote the following script:
Code:
def hydra_update():
   diagnostics.debug("updated")
   keyboard.setKey(Key.W, hydra[0].bumper)

if starting:
   hydra[0].enabled = True
   hydra[0].update += hydra_update

The word update is never printed in the console, and no matter which bumper I hit, the w key is never pressed. What am I doing wrong?

Author:  Jabberwock [ Wed Sep 05, 2018 8:10 am ]
Post subject:  Re: Trouble reading input from Razer Hydra

I have looked at my scripts and in the only one which has the update call, the call is commented out, so I guess it did not work. All the other scripts do not have it.

You have to settle on checking the states at each cycle, i.e. forget the update procedure and put the instructions in the main loop (of course, you can still use 'if starting' for other things).

Author:  Jabberwock [ Wed Sep 05, 2018 8:16 am ]
Post subject:  Re: Trouble reading input from Razer Hydra

LOL, I have just read your whole post... If you think you have a problem, consider that I usually have gas assigned to the forward rotaiton of a bicycle chain ring and the brake assigned to the backward rotation of that same chain ring. Try doing that simultaneously :) In Burnout Paradise I had to remap brake to a wheel button, which ruined all my reflexes...

Author:  Jayman2000 [ Wed Sep 05, 2018 1:30 pm ]
Post subject:  Re: Trouble reading input from Razer Hydra

Jabberwock wrote:
I have looked at my scripts and in the only one which has the update call, the call is commented out, so I guess it did not work. All the other scripts do not have it.

You have to settle on checking the states at each cycle, i.e. forget the update procedure and put the instructions in the main loop (of course, you can still use 'if starting' for other things).

I changed it to this,
Code:
if starting:
   hydra[0].enabled = True

keyboard.setKey(Key.W, hydra[0].bumper)

and it started working. Thank you!

Author:  Jabberwock [ Wed Sep 05, 2018 2:34 pm ]
Post subject:  Re: Trouble reading input from Razer Hydra

For what it is worth, the last line is enough, you do not have to enable Hydra (at least it works without enabling for me).

Page 1 of 1 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/