xbox360controller | pythonic Xbox360 controller API built on top of the xpad | Game Engine library
kandi X-RAY | xbox360controller Summary
kandi X-RAY | xbox360controller Summary
A pythonic Xbox360 controller API built on top of the xpad Linux kernel driver. This Python Package aims to provide a pythonic and complete API for your Xbox360 and similar game controllers. Currently it's built on top of the Linux kernel driver xpad so you can use it on almost any Linux distribution including your Rasperry Pi projects etc.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Main event loop
- Process an event
- Return a controller event
- Called when axis is moved
- Determine if the event is available
- Return an IOC instruction
- Emit an IOC command
- Device name
- Return a JIOC name
- Get the uptime of the system
- Create a |IOC| object
- Create an IOC
- Initialize an IOC
- Return an io object
xbox360controller Key Features
xbox360controller Examples and Code Snippets
import signal
from xbox360controller import Xbox360Controller
def on_button_pressed(button):
print('Button {0} was pressed'.format(button.name))
def on_button_released(button):
print('Button {0} was released'.format(button.name))
def on
from xbox360controller import Xbox360Controller
with Xbox360Controller() as controller:
controller.info()
Microsoft X-Box 360 pad at index 0
Axes: 5
axis_l
axis_r
hat
trigger_l
trigger_r
Buttons: 11
button_a
button_b
button_x
button_y
import time
from xbox360controller import Xbox360Controller
with Xbox360Controller() as controller:
controller.set_led(Xbox360Controller.LED_ROTATE)
time.sleep(1)
controller.set_led(Xbox360Controller.LED_OFF)
import sys
from functools import cached_property
from PyQt5 import QtCore, QtWidgets
from xbox360controller import Xbox360Controller
from xbox360controller.controller import Button, Axis, RawAxis
class Controller(QtCore.QObject):
b
Community Discussions
Trending Discussions on xbox360controller
QUESTION
I'd like to be able to show Xbox controller events on a very simple GUI using PyQt5 which was created using the QT Designer. I'm using xbox360controller Python package to communicate the controller with my Python interface. The following example code works as it should, and instead of printing the values I'd like to set the text on the only label on the GUI:
...ANSWER
Answered 2021-May-19 at 22:56You have 2 errors:
The first is that
self.controller.button_a.when_pressed = on_button_pressed()
is equivalent tovalue = on_button_pressed()
self.controller.button_a.when_pressed = value
, so you have not assigned the callback but you have assigned None since that is what the function returns.Even if you correct the above, there is also another error: callbacks are invoked in a secondary thread, so in conclusion you would be modifying the GUI from another thread, which Qt prohibits. In this case the solution is to use the Qt signals to transmit the information since they are thread-safe.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install xbox360controller
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page