Initial working version
This commit is contained in:
commit
ec1c5958ce
33 changed files with 4547 additions and 0 deletions
37
tests/test_controller_redirect.py
Normal file
37
tests/test_controller_redirect.py
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
import time
|
||||
import traceback
|
||||
import sys
|
||||
|
||||
print("Starting controller redirection test...")
|
||||
|
||||
try:
|
||||
from src.game.input.gamepad import VirtualController
|
||||
print("Controller support module imported successfully")
|
||||
|
||||
controller = VirtualController()
|
||||
print(f"Controller available: {controller.is_available()}")
|
||||
print(f"Physical controller available: {controller.is_physical_controller_available()}")
|
||||
|
||||
if controller.is_physical_controller_available():
|
||||
print("Testing controller redirection...")
|
||||
|
||||
# Start redirection
|
||||
success = controller.start_controller_redirection()
|
||||
print(f"Redirection started: {success}")
|
||||
|
||||
if success:
|
||||
# Let it run for a few seconds
|
||||
print("Redirection active for 5 seconds. Try using your physical controller...")
|
||||
for i in range(5, 0, -1):
|
||||
print(f"{i}...")
|
||||
time.sleep(1)
|
||||
|
||||
# Stop redirection
|
||||
controller.stop_controller_redirection()
|
||||
print("Redirection stopped")
|
||||
|
||||
print("Test completed successfully!")
|
||||
except Exception as e:
|
||||
print(f"Error during testing: {e}")
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue