Giter Site home page Giter Site logo

Lag on keypress about gpionext HOT 7 CLOSED

mholgatem avatar mholgatem commented on September 25, 2024
Lag on keypress

from gpionext.

Comments (7)

mholgatem avatar mholgatem commented on September 25, 2024

USB will pretty much always be faster. That being said, there are 2 flags that you can set to speed things up. If you don't use the built in combo buttons function, Type this into the command line:

gpionext set combo_delay 0

Combo Delay is the period of time in milliseconds that the system will wait before sending controller events. This is so that you can map "A" → Button1, "B" → Button2, "C" → Button1+Button2. Without the delay its hard to trigger the "C" event because both "A" and "B" would have to be hit in the same millisecond. This will set the combo delay to 0. By default, the combo delay is 50 milliseconds.

If it's still not fast enough and you have good momentary switches in your buttons:

gpionext set debounce 1

Debounce is the amount of time in milliseconds that the system will stop watching for press events from your button. Momentary switches are mechanical by nature, so when you are starting to press the button there can be one or more false connections before the actual full button press. My switches are pretty good, so I have this set to 1. Default is 20 milliseconds

Hope this helps!

from gpionext.

flagoss avatar flagoss commented on September 25, 2024

OMG ... That did the trick !!!! =)
gpionext set combo_delay 0
That flag did remove all delay I had. I can still use my combo since I have a standalone SHIFT key for my combos.

from gpionext.

mholgatem avatar mholgatem commented on September 25, 2024

Great! Glad that worked for you.

from gpionext.

fedekrum avatar fedekrum commented on September 25, 2024

I have noticed the delay too, so I think I have a very basic idea that can make combos possible without delay. First of all I would not call this "combo", but something like "modifier buttons"

In most cases, you decide for 1 or 2 buttons to be modifiers of the other buttons. Somehow like "shift" or "alt" works in your keyboard, you press first the shift and then any other key. That is done in a way that as the shift key has no action by itself, you don't have to delay anything.

It would be nice to define "modifier buttons" so you can trigger commands. (been this the main goal for me)

Defining one "modifier buttons" instantly duplicates the number of buttons in the joystick. (most of the times more than enough to do some other crazy stuff with the joystick.

Just a thought !! (and a wish !!)

from gpionext.

mholgatem avatar mholgatem commented on September 25, 2024

yeah, I had toyed with the idea of adding shift registers to the config menu but it was difficult to convey to the user why there were suddenly extra buttons. so I figured they could just leave one or two buttons unused and assign them whenever they need a shift.

from gpionext.

fedekrum avatar fedekrum commented on September 25, 2024

DON'T GIVE UP !! ;o)

I understand what you mean, It would be confusing at least for the ones that decide to set a "shift" button. But you can just tell them at the time of the configuration that N new virtual buttons are going to be added to their device.
As we are talking about speeding up button reaction here, I wonder how fast is the python implementation compared to a real fast USB joystick?

from gpionext.

mholgatem avatar mholgatem commented on September 25, 2024

If you set everything to it's fastest (debounce=1/combo_delay 0) and have good momentary switches then there won't really be a discernible difference between that and usb on a linux machine, especially a raspberry pi (the raspberry pi doesn't even contain an real-time clock).

from gpionext.

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.