Code Monkey home page Code Monkey logo

Comments (2)

KarsMulder avatar KarsMulder commented on June 12, 2024

This happens because hooks were designed to operate on the current "state" of the keys instead of singular events, so they could accomodate activating on a combination of keys like "ctrl+A".

An obscure corner of the documentation (unfortunately) says the following about hooks:

Formally said, the hook triggers when (1) an event is received that matches one of the KEYs specified, (2) the last event whose type, code and domain matched that same KEY did not have a value matching that KEY, and (3) for all other KEYs, the last event whose type, code and domain matched those KEYs had a value matching those KEYs.

In short, sending multiple key::2 events will not trigger the hook again unless a key::0 event arrives in between.

(And it is "unfortunate" that it says so because it turned out that these semantics are flawed and do not interact nicely with some other systems such as --withhold, but those semantics are kept because of backwards compatibility. If I ever release an evsieve 2.0, the semantics are going to be different.)

A somewhat hacky solution to make a hook trigger on every repeat event would be to use a map that turns every event into a press-release event:

evsieve --input /dev/input/event1 \
        --map key:brightnessdown:1~2 ::1 ::0 \
        --map key:brightnessup:1~2   ::1 ::0 \
        --hook key:brightnessdown exec-shell="brillo -q -U 5; pkill -SIGRTMIN+9 waybar" \
        --hook key:brightnessup   exec-shell="brillo -q -A 5; pkill -SIGRTMIN+9 waybar"

from evsieve.

dxwil avatar dxwil commented on June 12, 2024

This workaround seems to work now, thanks

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.