Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xbox One #15

Open
binaryhellstorm opened this issue Aug 8, 2020 · 4 comments
Open

Xbox One #15

binaryhellstorm opened this issue Aug 8, 2020 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@binaryhellstorm
Copy link

Trying this with the Xbox One bluetooth controller and it seems to be reading the B and X keys as axis.

@linusg
Copy link
Owner

linusg commented Aug 8, 2020

Don't have one of those so I can't confirm or fix this issue 🤷

PR welcome, though I'm not really interested in adding support for multiple controllers.

@linusg linusg added bug Something isn't working help wanted Extra attention is needed labels Aug 8, 2020
@xboxone08
Copy link

Please add support for Xbox One, or make a module for that with a similar interface. This is the easiest to use module I've found, but it only supports Xbox 360.

@linusg
Copy link
Owner

linusg commented Sep 10, 2020

@xboxone08 I appreciate it, but again, I don't have the required hardware (Xbox One controller) for testing so that's no going to happen.

@wullxz
Copy link

wullxz commented Sep 11, 2020

@xboxone08 I'm using linusg's work as base to use my Xbox One Wireless controller (using xpadneo driver). It doesn't "know" the Trigger Axis though when used "normally". I can get values from them by using the Raw mode though.

Try this code snippet and see if the output shows you something useful:

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_axis_moved_raw(axis):
    print('Axis {0} moved to {1}'.format(axis.name, axis.value))

try:
    with Xbox360Controller(0, axis_threshold=0.2, raw_mode=True) as controller:
        # Button events
        for b in controller.buttons:
            b.when_pressed = on_button_pressed
            b.when_released = on_button_released

        for a in controller.axes:
            a.when_moved = on_axis_moved_raw

        signal.pause()
except KeyboardInterrupt:
    pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants