Skip to content

Commit

Permalink
Fix for #20
Browse files Browse the repository at this point in the history
- The value in case of 3Bh2b is the first element of the overflow. This commit fix the issue that the
value doesn't match with the actual read in case of 3Bh2b format.
- Updated version in setup.py
  • Loading branch information
williamledda committed Mar 28, 2021
1 parent 0e2c87a commit 9596894
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions pyPS4Controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,27 +288,27 @@ def __handle_event(self, button_id, button_type, value, overflow, debug):
elif event.R3_x_at_rest():
self.on_R3_x_at_rest()
elif event.R3_right():
self.on_R3_right(value)
self.on_R3_right(event.value)
elif event.R3_left():
self.on_R3_left(value)
self.on_R3_left(event.value)
elif event.R3_up():
self.on_R3_up(value)
self.on_R3_up(event.value)
elif event.R3_down():
self.on_R3_down(value)
self.on_R3_down(event.value)
elif event.L3_event():
self.event_history.append("left_joystick")
if event.L3_y_at_rest():
self.on_L3_y_at_rest()
elif event.L3_x_at_rest():
self.on_L3_x_at_rest()
elif event.L3_up():
self.on_L3_up(value)
self.on_L3_up(event.value)
elif event.L3_down():
self.on_L3_down(value)
self.on_L3_down(event.value)
elif event.L3_left():
self.on_L3_left(value)
self.on_L3_left(event.value)
elif event.L3_right():
self.on_L3_right(value)
self.on_L3_right(event.value)
elif event.circle_pressed():
self.event_history.append("circle")
self.on_circle_press()
Expand Down Expand Up @@ -336,7 +336,7 @@ def __handle_event(self, button_id, button_type, value, overflow, debug):
self.on_L1_release()
elif event.L2_pressed():
self.event_history.append("L2")
self.on_L2_press(value)
self.on_L2_press(event.value)
elif event.L2_released():
self.on_L2_release()
elif event.R1_pressed():
Expand All @@ -346,7 +346,7 @@ def __handle_event(self, button_id, button_type, value, overflow, debug):
self.on_R1_release()
elif event.R2_pressed():
self.event_history.append("R2")
self.on_R2_press(value)
self.on_R2_press(event.value)
elif event.R2_released():
self.on_R2_release()
elif event.options_pressed():
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setuptools.setup(
name="pyPS4Controller",
version="1.2.4",
version="1.2.5",
author="Artur Spirin",
author_email="[email protected]",
description="Simple hooks for PS4 controller",
Expand Down

0 comments on commit 9596894

Please sign in to comment.