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

Joystick Axis seems to be always active?| RPI2B+ #40

Open
WillWallace opened this issue Aug 29, 2016 · 2 comments
Open

Joystick Axis seems to be always active?| RPI2B+ #40

WillWallace opened this issue Aug 29, 2016 · 2 comments

Comments

@WillWallace
Copy link

WillWallace commented Aug 29, 2016

Preemptive thanks for effort put into this project. It's awesome!

Currently setting up my Steam Controller to work with my ps3 using this and GIMX.
I prefer to use both haptic pads as joystick replacements and the actual joystick as a DPAD.

To do so I set up the config like so:

evm.setPadAxes(Pos.RIGHT, Axes.ABS_RX, Axes.ABS_RY)
evm.setPadAxes(Pos.LEFT,Axes.ABS_X,Axes.ABS_Y)
evm.setStickButtons([Keys.KEY_UP,
                    Keys.KEY_LEFT,
                    Keys.KEY_DOWN,
                    Keys.KEY_RIGHT])

Unfortunately, GIMX (I don't have any other game with 360 support to confirm this with) still sees the the stick as a set of axes as well as being a set of buttons. On top of that, it sees it as the axes used for ABS_X and ABS_Y. I do realize could set the Pos.LEFT as buttons to limp but I would really like that full joystick range. With sc-xbox.py off, nothing is picked up, so I'm thinking it might be something on this end.

I don't mind trying to find the source of the issue myself but am not even sure where to start.

Thanks.

sc-xbox.txt

Update 1:
To expand, a little. When using the configuration above, the joystick is recognized as both the ABS_X, ABS_Y & KEY.UP, KEY.DOWN, KEY.LEFT, and KEY.RIGHT. POS.LEFT works as expected (without the extra Keys). GIMX does not display the same results with an actual 360 controller (although I figure this useless info)

I also tried commenting out setStickButtons altogether and GIMX picks it up as ABS_X & ABS_Y.
Thinking the stick might default to that, I tried using null and 0 setStickAxes as values but found no change.
To expand, a little. When using the configuration above, the joystick is recognized as both the ABS_X, ABS_Y & KEY.UP, KEY.DOWN, KEY.LEFT, and KEY.RIGHT. POS.LEFT works as expected (without the extra Keys). GIMX does not display the same results with an actual 360 controller (although I figure this useless info)

I also tried commenting out setStickButtons altogether and GIMX picks it up as ABS_X & ABS_Y.
Thinking the stick might default to that, I tried using null and 0 setStickAxes as values but found no change.

I guess it could be error checking for incorrect values but my money is on rogue line in there somewhere.

P.S. To make sure I'm not being a complete idiot, attached is my full sc-xbox.py

Update 2:
Not solved yet but I did notice that in events.py, under setTrigAxesCallback(), it has:
self._trig_modes[pos] = StickModes.AXISNot solved yet but I did notice that in events.py, under setTrigAxesCallback(), it has:
self._trig_modes[pos] = StickModes.AXIS
I'm thinking it should be:
self._trig_modes[pos] = TrigModes.AXIS

Changing that in /src and reinstalling did not fix the problem however. :(

Update 3:
Ok, I'm going to preface by saying I'm probably wrong and stupid.

So I found out that the stick and LPAD are the same except for LPADTOUCH being true in the case of LPAD.
Under #Axis Mode of_KeyReleased() of events.py,
sci.buttons & touch == touch

I'm on the fence about this one, but if touch is False (as it is in the when stick is in use), wouldn't the statement still be True and cause it act as if it were the touchpad? I tried editing it myself but it didn't change. May be it's in other places...

Update 5 million: I am dumb. The logic works fine in most places as the counter possibility has already been accounted for and using True instead of a local variable probably causes too much lag.

Would I be better off swapping the joystick ifs with the haptic in this case?
And if so, would it be viable to put a check in setup.py to switch between two different events.py?

Update 5: I am deeply sorry for the nightmare of messages you may or may not have recieved due multiple comments. I was limited to a bad browser for a hot minute to comment.
I am a n00b. Consolidating now.

@WillWallace WillWallace changed the title Joystick Axis seems to be always active? Joystick Axis seems to be always active?| RPI2B+ Aug 30, 2016
@ynsta
Copy link
Owner

ynsta commented Dec 1, 2016

Hello,

I don't understand what you wand to change in events.py.

The pad USB interface as designed by valve does not make a difference between the pad and the stick it is only possible to know which one is used by looking to the state of the pad (touched or not).

@WillWallace
Copy link
Author

WillWallace commented Dec 6, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants