Trouble reading input from Razer Hydra

Official forum for open source FreePIE discussion and development.
Post Reply
Jayman2000
One Eyed Hopeful
Posts: 2
Joined: Tue Sep 04, 2018 4:03 pm

Trouble reading input from Razer Hydra

Post by Jayman2000 »

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: Select all

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?
Jabberwock
Cross Eyed!
Posts: 197
Joined: Mon Mar 02, 2015 3:58 pm

Re: Trouble reading input from Razer Hydra

Post by Jabberwock »

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).
Jabberwock
Cross Eyed!
Posts: 197
Joined: Mon Mar 02, 2015 3:58 pm

Re: Trouble reading input from Razer Hydra

Post by Jabberwock »

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...
Jayman2000
One Eyed Hopeful
Posts: 2
Joined: Tue Sep 04, 2018 4:03 pm

Re: Trouble reading input from Razer Hydra

Post by Jayman2000 »

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: Select all

if starting:
	hydra[0].enabled = True

keyboard.setKey(Key.W, hydra[0].bumper)
and it started working. Thank you!
Jabberwock
Cross Eyed!
Posts: 197
Joined: Mon Mar 02, 2015 3:58 pm

Re: Trouble reading input from Razer Hydra

Post by Jabberwock »

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).
Post Reply

Return to “FreePIE”