Code Monkey home page Code Monkey logo

Comments (7)

KarsMulder avatar KarsMulder commented on June 12, 2024 1

@puffnfresh I suppose that it wouldn't be impossible to implement, but with the current internal API, it isn't simple to implement it in a way that:

  1. Is correct in all cases, i.e. including cases where multiple devices can generate abs:z events, which in turn are being transformed by other maps before reaching a map containing z_min.
  2. Does not impose a measurable performance penalty for the majority of the users who won't use this feature.

The key issue is: parsing the input arguments like abz:z to internal data structures, propagating the event capabilities, and propagating the events, happen at separate stages of the program. A feature like this blurs the line between those stages; e.g. it is currently assumed (and enforced by the compiler) that the propagation of event capabilities does not modify the event stream, and that assumption would need to change to make this work, along with at least one algorithm that relies on it.

In short, I think that I am not going to work on that feature for now because the amount of spaghettiness required to make it work outweighs the feature's utility.

from evsieve.

KarsMulder avatar KarsMulder commented on June 12, 2024

Not possible on the current stable version. I just added a feature to do this to the main branch. The tentative syntax is:

--map abs:x abs:x:-x

Now a somewhat confusing part of this syntax is that the last x just means "whatever the value value was", and the minus means "-1 times that value". The last x does not mean "the value of the x axis", so to invert the y axis, you would also use:

--map abs:y abs:y:-x

The magic x multiplier in the value has the same consistent syntax as the magic d multiplier (which, ironically, is already stable), but since users will probably use it mainly for inverting/accelerating the x/y axes, I can imagine some poor user getting confused and trying to write --map abs:y abs:y:-y.

I could either write a specialised helpful error message for that case, or reconsider the syntax of this feature.

from evsieve.

nadenislamarre avatar nadenislamarre commented on June 12, 2024

In fact it is not exacly *-1
It is more max_value - x to revert thé axis.

from evsieve.

nadenislamarre avatar nadenislamarre commented on June 12, 2024

In case min IS positiv

from evsieve.

KarsMulder avatar KarsMulder commented on June 12, 2024

This feature has now been added to the main branch. You can now e.g. write --map abs:z abs:z:127-x to map some event's value to 127 minus that event's value, which would invert the axis if abs:z were to have a range of 0~127.

from evsieve.

puffnfresh avatar puffnfresh commented on June 12, 2024

@KarsMulder since evdev events are registered with min/max values, we theoretically know the min/max. Could we add/generate another placeholder (e.g. z_min) so that we don't have to hard code the 127?

from evsieve.

nadenislamarre avatar nadenislamarre commented on June 12, 2024

working for me. i can close.

from evsieve.

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.