It is currently Tue Feb 25, 2020 7:12 pm



 [ 5 posts ] 
 Trouble reading input from Razer Hydra 
Author Message
One Eyed Hopeful

Joined: Tue Sep 04, 2018 4:03 pm
Posts: 2
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?


Tue Sep 04, 2018 6:10 pm
Cross Eyed!

Joined: Mon Mar 02, 2015 3:58 pm
Posts: 149
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).


Wed Sep 05, 2018 8:10 am
Cross Eyed!

Joined: Mon Mar 02, 2015 3:58 pm
Posts: 149
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...


Wed Sep 05, 2018 8:16 am
One Eyed Hopeful

Joined: Tue Sep 04, 2018 4:03 pm
Posts: 2
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!


Wed Sep 05, 2018 1:30 pm
Cross Eyed!

Joined: Mon Mar 02, 2015 3:58 pm
Posts: 149
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).


Wed Sep 05, 2018 2:34 pm
Display posts from previous:  Sort by  
   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Powered by phpBB® Forum Software © phpBB Group
Designed by STSoftware.