Code Monkey home page Code Monkey logo

Comments (2)

KarsMulder avatar KarsMulder commented on June 12, 2024

Similar issue: #7

What are your thoughts on this?

I agree evsieve needs a more ergonomic way to do this, but I have still not figured out the best way to do it. There are particularly a lot of edge cases to deal with if we want to conditionally block some input events depending on whether or not a multiple-to-one map happened or not.

--map key:leftctrl key:comma key:f4 source=2

I am not a fan of this syntax because its semantics are different from the usual --map semantics.

If I were to expand the --map to do this, I'd probably do something like --map key:comma key:f4 hold=key:leftctrl, where hold= indicates that the map only applies if the key:leftctrl key is held down, though this approach still has two inelegant points:

  • The key after hold= would have to be interpreted with the same semantics as used by --hook which are different from the semantics used by --map (i.e. an unspecified event value is interpreted as 1~ by --hook, whereas --map interprets it as "any value");
  • There would have to be some "consistent" mode for maps similar to how --toggle treats EV_KEY type events differently from other events.

... now I think about it, these two inelegant points may be less severe than the mess that --hook withhold or --hook --withhold might create. I should consider this approach some more.

(although not documented yet!)

The documentation in the README is for the latest stable version of evsieve (1.3.1 right now.) The send-key clause is not part of any stable release yet. Features not part of a stable release are subject to getting changed/removed/redesigned at any time, therefore the average user is not recommended to use them.


By the way, in the above script you do not want to use mode=passive on the --toggle because your script would result in a stuck F4 key if you were to press key:leftctrl:1 key:comma:1 key:leftctrl:0 key:comma:0. The consistent mode is the default mode of toggles because it avoids pitfalls like this.

from evsieve.

fhill2 avatar fhill2 commented on June 12, 2024

Great to hear your thoughts on this and the edge cases that would have to be dealt with if being implemented.

-map key:comma key:f4 hold=key:leftctrl is a better intuitive syntax.

Thank you for clarification on mode=passive vs mode=consistent that I overlooked in my original example.

If you do decide to implement, I'll be looking forward to such a feature.

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.