D-Pad von Xbox-Controllern kommt auf macOS als Tasten 11-14 statt Hat - jetzt gemappt (hoch/runter/links/rechts). Hotplug bestaetigt. 63 Tests. MAC-START: Hinweis auf Ladekabel vs. Datenkabel.
This commit is contained in:
1 parent
5237b0a39c
commit
4491fb1524
5 files changed
+51
-2
No files matched your search
@@ -539,6 +539,21 @@ class ControllerMappingTests(unittest.TestCase):
|
||||
[],
|
||||
)
|
||||
|
||||
def test_dpad_as_buttons(self) -> None:
|
||||
# macOS meldet das D-Pad von Xbox-Controllern als Tasten 11-14.
|
||||
for button, expected in (
|
||||
(11, Action.UP),
|
||||
(12, Action.DOWN),
|
||||
(13, Action.LEFT),
|
||||
(14, Action.RIGHT),
|
||||
):
|
||||
self.assertEqual(
|
||||
input_map.actions_from_event(
|
||||
self.event(type=pygame.JOYBUTTONDOWN, button=button, joy=0)
|
||||
),
|
||||
[expected],
|
||||
)
|
||||
|
||||
def test_dpad_as_hat(self) -> None:
|
||||
for value, expected in (
|
||||
((-1, 0), Action.LEFT),
|
||||
|
||||
Reference in new issue
Block a user