Skip to content

Commit

Permalink
Back on X axis, because I want it
Browse files Browse the repository at this point in the history
  • Loading branch information
mdovgialo committed Aug 16, 2019
1 parent ae94f9b commit 01d02d9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions steam_vr_wheel/_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import os
import copy

from steam_vr_wheel._virtualpad import VirtualPad
from steam_vr_wheel.pyvjoy import HID_USAGE_Z
from steam_vr_wheel._virtualpad import VirtualPad, RightTrackpadAxisDisablerMixin
from steam_vr_wheel.pyvjoy import HID_USAGE_X



Expand Down Expand Up @@ -267,7 +267,7 @@ def __init__(self, x, y, z, id=0):
self.id = id


class Wheel(VirtualPad):
class Wheel(RightTrackpadAxisDisablerMixin, VirtualPad):
def __init__(self, inertia=0.95, center_speed=pi/180):
super().__init__()
self.vrsys = openvr.VRSystem()
Expand Down Expand Up @@ -371,7 +371,7 @@ def set_button_unpress(self, button, hand):
if button == openvr.k_EButton_Grip and hand == 'right':
self._right_controller_grabbed = False

if self._right_controller_grabbed or self._left_controller_grabbed:
if self._right_controller_grabbed and self._left_controller_grabbed:
pass
else:
self._snapped = False
Expand All @@ -390,7 +390,7 @@ def set_button_press(self, button, hand):
else:
self._right_controller_grabbed = not self._right_controller_grabbed

if self._right_controller_grabbed or self._left_controller_grabbed:
if self._right_controller_grabbed and self._left_controller_grabbed:
pass
else:
self._snapped = False
Expand Down Expand Up @@ -464,7 +464,7 @@ def center_force(self):
def send_to_vjoy(self):
wheel_turn = self._wheel_angles[-1] / (2 * pi)
axisX = int((-wheel_turn / FULLTURN + 0.5) * 0x8000)
self.device.set_axis(HID_USAGE_Z, axisX)
self.device.set_axis(HID_USAGE_X, axisX)

def render(self):
wheel_angle = self._wheel_angles[-1]
Expand Down

0 comments on commit 01d02d9

Please sign in to comment.