Skip to content

Commit

Permalink
Input manager fixes (#2078)
Browse files Browse the repository at this point in the history
* improved typing

* Revert "improved typing"

This reverts commit dba8ece.

* Update input.manager.py to fix event error

The latest pyglet update changes Xinput events to use Vec2 so update the Input Manager to match.

* Spelling fix
  • Loading branch information
DragonMoffon committed Apr 27, 2024
1 parent 32ee44e commit 5bb27ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions arcade/experimental/input/manager.py
Expand Up @@ -513,7 +513,8 @@ def on_button_release(self, controller: Controller, button_name: str):
for action_name in buttons_to_actions:
self.dispatch_action(action_name, ActionState.RELEASED)

def on_stick_motion(self, controller, name, x_value, y_value):
def on_stick_motion(self, controller, name, motion: pyglet.math.Vec2):
x_value, y_value = motion.x, motion.y
if name == "leftx":
self.window.dispatch_event(
"on_stick_motion",
Expand Down Expand Up @@ -566,7 +567,7 @@ def on_stick_motion(self, controller, name, x_value, y_value):
self.dispatch_action(action_name, ActionState.RELEASED)

def on_dpad_motion(
self, controller: Controller, left: bool, right: bool, up: bool, down: bool
self, controller: Controller, motion: pyglet.math.Vec2
):
self.active_device = InputDevice.CONTROLLER

Expand Down

0 comments on commit 5bb27ec

Please sign in to comment.