Git Product home page Git Product logo

Comments (21)

atar-axis avatar atar-axis commented on August 15, 2024

Hi there, I am quite busy at the moment but it sound like it shouldn't be a big deal to realize that - I hope I will find some time within next weeks.

But I am not yet sure how exactly the expected behaviour is? At the moment the left trigger is on axis ABS_Z and the right one is ABS_RZ. What exactly do you need?

from xpadneo.

piet206 avatar piet206 commented on August 15, 2024

Thanks for the quick reply. Let's see if I can clarify what needs to be done.

Both LT and RT should be on axis ABS_Z
LT should be 0 to -1. RT should be 0 to 1. When both triggers are at rest, the value would be 0. When both triggers are fully depressed, the value would also be 0.

from xpadneo.

atar-axis avatar atar-axis commented on August 15, 2024

Ah, ok I see - so they work against each other in a sense. Are you sure about the Values (0,-1,0,1)? Normally we are talking about ranges from -32.768 to 32.767 or 0 to 65.535 for axis.

from xpadneo.

piet206 avatar piet206 commented on August 15, 2024

Exactly, they work against each other. No, I'm not sure about those values (0,-1,0,1). Your typical ranges that are used for the triggers sound good to me.

from xpadneo.

atar-axis avatar atar-axis commented on August 15, 2024

Hey there, I uploaded a first draft, you can test it by using
git clone https://github.com/atar-axis/xpadneo.git -b combine_triggers
sudo ./unsintall.sh
sudo ./install.sh

Note: The combined_z_axis feature is automatically enabled using this branch, this will not be the case once it is merged to master

Unfortunaltey it is not yet working as expected - I am unsure about the range and the triggers do not go back to 0 as one would hope. Should be easy to fix within the next hour.

from xpadneo.

atar-axis avatar atar-axis commented on August 15, 2024

I fixed the problem with the offset, the range is now between -1024 and 1023 and the reaction is pretty smooth.
But I am still not sure if this is what your game expects, can you do me a favor and give me the output of
evtest /dev/input/event<HIGHEST_NUMBER>
while using xboxdrv? I am mainly interested in - as said - the range of ABS_Z

on my machine, using this branch, the output is the following when I press and release the left trigger followed by the right one:

flood@flood-r3 ~> evtest /dev/input/event15 
Input driver version is 1.0.1
Input device ID: bus 0x5 vendor 0x45e product 0x2e0 version 0x1130
Input device name: "Xbox Wireless Controller"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 304 (BTN_SOUTH)
    Event code 305 (BTN_EAST)
    Event code 307 (BTN_NORTH)
    Event code 308 (BTN_WEST)
    Event code 310 (BTN_TL)
    Event code 311 (BTN_TR)
    Event code 314 (BTN_SELECT)
    Event code 315 (BTN_START)
    Event code 316 (BTN_MODE)
    Event code 317 (BTN_THUMBL)
    Event code 318 (BTN_THUMBR)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value   2481
      Min   -32768
      Max    32767
      Flat    4095
    Event code 1 (ABS_Y)
      Value   1706
      Min   -32768
      Max    32767
      Flat    4095
    Event code 2 (ABS_Z)
      Value      0
      Min    -1024
      Max     1023
      Fuzz       3
      Flat      63
    Event code 3 (ABS_RX)
      Value    838
      Min   -32768
      Max    32767
      Fuzz     255
      Flat    4095
    Event code 4 (ABS_RY)
      Value   2472
      Min   -32768
      Max    32767
      Fuzz     255
      Flat    4095
    Event code 16 (ABS_HAT0X)
      Value      0
      Min       -1
      Max        1
    Event code 17 (ABS_HAT0Y)
      Value      0
      Min       -1
      Max        1
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
  Event type 21 (EV_FF)
    Event code 80 (FF_RUMBLE)
    Event code 81 (FF_PERIODIC)
    Event code 88 (FF_SQUARE)
    Event code 89 (FF_TRIANGLE)
    Event code 90 (FF_SINE)
    Event code 96 (FF_GAIN)
Properties:
Testing ... (interrupt to exit)
Event: time 1546551083.330804, type 3 (EV_ABS), code 2 (ABS_Z), value -282
Event: time 1546551083.330804, -------------- SYN_REPORT ------------
Event: time 1546551083.331064, type 3 (EV_ABS), code 2 (ABS_Z), value -858
Event: time 1546551083.331064, -------------- SYN_REPORT ------------
Event: time 1546551083.331268, type 3 (EV_ABS), code 2 (ABS_Z), value -1023
Event: time 1546551083.331268, -------------- SYN_REPORT ------------
Event: time 1546551083.447450, type 3 (EV_ABS), code 2 (ABS_Z), value -872
Event: time 1546551083.447450, -------------- SYN_REPORT ------------
Event: time 1546551083.454892, type 3 (EV_ABS), code 2 (ABS_Z), value -503
Event: time 1546551083.454892, -------------- SYN_REPORT ------------
Event: time 1546551083.462366, type 3 (EV_ABS), code 2 (ABS_Z), value -186
Event: time 1546551083.462366, -------------- SYN_REPORT ------------
Event: time 1546551083.469864, type 3 (EV_ABS), code 2 (ABS_Z), value 0
Event: time 1546551083.469864, -------------- SYN_REPORT ------------
Event: time 1546551087.632897, type 3 (EV_ABS), code 2 (ABS_Z), value 167
Event: time 1546551087.632897, -------------- SYN_REPORT ------------
Event: time 1546551087.633114, type 3 (EV_ABS), code 2 (ABS_Z), value 646
Event: time 1546551087.633114, -------------- SYN_REPORT ------------
Event: time 1546551087.633323, type 3 (EV_ABS), code 2 (ABS_Z), value 1023
Event: time 1546551087.633323, -------------- SYN_REPORT ------------
Event: time 1546551087.782388, type 3 (EV_ABS), code 2 (ABS_Z), value 1010
Event: time 1546551087.782388, -------------- SYN_REPORT ------------
Event: time 1546551087.789929, type 3 (EV_ABS), code 2 (ABS_Z), value 799
Event: time 1546551087.789929, -------------- SYN_REPORT ------------
Event: time 1546551087.797373, type 3 (EV_ABS), code 2 (ABS_Z), value 577
Event: time 1546551087.797373, -------------- SYN_REPORT ------------
Event: time 1546551087.804843, type 3 (EV_ABS), code 2 (ABS_Z), value 367
Event: time 1546551087.804843, -------------- SYN_REPORT ------------
Event: time 1546551087.812433, type 3 (EV_ABS), code 2 (ABS_Z), value 184
Event: time 1546551087.812433, -------------- SYN_REPORT ------------
Event: time 1546551087.819939, type 3 (EV_ABS), code 2 (ABS_Z), value 30
Event: time 1546551087.819939, -------------- SYN_REPORT ------------
Event: time 1546551087.827343, type 3 (EV_ABS), code 2 (ABS_Z), value 0
Event: time 1546551087.827343, -------------- SYN_REPORT ------------

from xpadneo.

piet206 avatar piet206 commented on August 15, 2024

Awesome it works great! The game is X-Plane 11 btw. Thank you very much!

I also ran the test below.

from xpadneo.

piet206 avatar piet206 commented on August 15, 2024

I plugged in the controller via usb and ran the evtest. First pressing and releasing LT and then doing the same with RT:

p@p-desktop:~$ evtest /dev/input/event15 js0
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x45e product 0x2ea version 0x301
Input device name: "Microsoft X-Box One S pad"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 304 (BTN_SOUTH)
    Event code 305 (BTN_EAST)
    Event code 307 (BTN_NORTH)
    Event code 308 (BTN_WEST)
    Event code 310 (BTN_TL)
    Event code 311 (BTN_TR)
    Event code 314 (BTN_SELECT)
    Event code 315 (BTN_START)
    Event code 316 (BTN_MODE)
    Event code 317 (BTN_THUMBL)
    Event code 318 (BTN_THUMBR)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value   2360
      Min   -32768
      Max    32767
      Fuzz      16
      Flat     128
    Event code 1 (ABS_Y)
      Value   1833
      Min   -32768
      Max    32767
      Fuzz      16
      Flat     128
    Event code 2 (ABS_Z)
      Value      0
      Min        0
      Max     1023
    Event code 3 (ABS_RX)
      Value  -1513
      Min   -32768
      Max    32767
      Fuzz      16
      Flat     128
    Event code 4 (ABS_RY)
      Value    919
      Min   -32768
      Max    32767
      Fuzz      16
      Flat     128
    Event code 5 (ABS_RZ)
      Value      0
      Min        0
      Max     1023
    Event code 16 (ABS_HAT0X)
      Value      0
      Min       -1
      Max        1
    Event code 17 (ABS_HAT0Y)
      Value      0
      Min       -1
      Max        1
  Event type 21 (EV_FF)
    Event code 80 (FF_RUMBLE)
    Event code 81 (FF_PERIODIC)
    Event code 88 (FF_SQUARE)
    Event code 89 (FF_TRIANGLE)
    Event code 90 (FF_SINE)
    Event code 96 (FF_GAIN)
Properties:
Testing ... (interrupt to exit)
Event: time 1546568904.403582, type 3 (EV_ABS), code 2 (ABS_Z), value 237
Event: time 1546568904.403582, -------------- SYN_REPORT ------------
Event: time 1546568904.411575, type 3 (EV_ABS), code 2 (ABS_Z), value 707
Event: time 1546568904.411575, -------------- SYN_REPORT ------------
Event: time 1546568904.419576, type 3 (EV_ABS), code 2 (ABS_Z), value 1023
Event: time 1546568904.419576, -------------- SYN_REPORT ------------
Event: time 1546568905.299580, type 3 (EV_ABS), code 2 (ABS_Z), value 650
Event: time 1546568905.299580, -------------- SYN_REPORT ------------
Event: time 1546568905.307550, type 3 (EV_ABS), code 2 (ABS_Z), value 135
Event: time 1546568905.307550, -------------- SYN_REPORT ------------
Event: time 1546568905.315576, type 3 (EV_ABS), code 2 (ABS_Z), value 0
Event: time 1546568905.315576, -------------- SYN_REPORT ------------
Event: time 1546568906.499586, type 3 (EV_ABS), code 5 (ABS_RZ), value 181
Event: time 1546568906.499586, -------------- SYN_REPORT ------------
Event: time 1546568906.507571, type 3 (EV_ABS), code 5 (ABS_RZ), value 804
Event: time 1546568906.507571, -------------- SYN_REPORT ------------
Event: time 1546568906.515550, type 3 (EV_ABS), code 5 (ABS_RZ), value 1023
Event: time 1546568906.515550, -------------- SYN_REPORT ------------
Event: time 1546568907.799575, type 3 (EV_ABS), code 5 (ABS_RZ), value 799
Event: time 1546568907.799575, -------------- SYN_REPORT ------------
Event: time 1546568907.807569, type 3 (EV_ABS), code 5 (ABS_RZ), value 254
Event: time 1546568907.807569, -------------- SYN_REPORT ------------
Event: time 1546568907.815547, type 3 (EV_ABS), code 5 (ABS_RZ), value 0
Event: time 1546568907.815547, -------------- SYN_REPORT ------------

Looks like you were spot on with the 1023 value. Thanks again.

Anyway to use this the xpadneo driver while on USB?

from xpadneo.

atar-axis avatar atar-axis commented on August 15, 2024

oh damn, i forgot to mention that... could you please run xboxdrv with --trigger-as-zaxis?!

from xpadneo.

piet206 avatar piet206 commented on August 15, 2024

I've never been able to get xboxdrv to recognize my device which is what led me to xpadneo.

p@p-desktop:~$ xboxdrv --trigger-as-zaxis
xboxdrv 0.8.8 - http://pingus.seul.org/~grumbel/xboxdrv/ 
Copyright © 2008-2011 Ingo Ruhnke <[email protected]> 
Licensed under GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> 
This program comes with ABSOLUTELY NO WARRANTY. 
This is free software, and you are welcome to redistribute it under certain 
conditions; see the file COPYING for details. 


-- [ ERROR ] ------------------------------------------------------
No Xbox or Xbox360 controller found

from xpadneo.

atar-axis avatar atar-axis commented on August 15, 2024

Ah I see. I will dig in the sourcecode of xboxdrv then. anyway, you said it works ingame and that's what counts :)

Btw, xpadneo is a wireless only driver until now - but I may add USB support someday.

from xpadneo.

piet206 avatar piet206 commented on August 15, 2024

I tried adding it manually to no avail. So for usb, I'm using the xpad driver which doesn't seem to have a combine z axis config.

Anyways, this branch works great for me over bluetooth.

from xpadneo.

atar-axis avatar atar-axis commented on August 15, 2024

I will keep it open until I merged it ;)

from xpadneo.

piet206 avatar piet206 commented on August 15, 2024

Ahh I see, very good.

from xpadneo.

atar-axis avatar atar-axis commented on August 15, 2024

Okay I found the line I was searching for:

// uinput_options.cpp

void
UInputOptions::trigger_as_zaxis()
{
  m_axis_map.push_back(AxisMapOption("gamepad.trigger", "ABS_Z:-255:255:0:0"));

  m_axis_map.push_back(AxisMapOption("gamepad.lt", "void"));
  m_axis_map.push_back(AxisMapOption("gamepad.rt", "void"));
}

Hence the range is [-255;255] in xboxdrv - it wouldn't make much sense to use this range in xpadneo since we would lose a lot of accuracy, therefore I will stay with [-1024; 1023] for now.

from xpadneo.

atar-axis avatar atar-axis commented on August 15, 2024

Merged to master, please give it a try!
https://github.com/atar-axis/xpadneo#installation
https://github.com/atar-axis/xpadneo#configuration

from xpadneo.

atar-axis avatar atar-axis commented on August 15, 2024

I'll close this issue for now, if you are facing any problem - feel free to reopen it.

from xpadneo.

atar-axis avatar atar-axis commented on August 15, 2024

hey @piet206 - could you please update to the latest version and check if the gamepad still works as expected? I changed something which is related to this issue: #79

from xpadneo.

piet206 avatar piet206 commented on August 15, 2024

@atar-axis yep still works

from xpadneo.

atar-axis avatar atar-axis commented on August 15, 2024

Perfect, thanks!

from xpadneo.

kakra avatar kakra commented on August 15, 2024

Would you mind testing if #226 works for your use-case?

from xpadneo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.