Giter Site home page Giter Site logo

Feature Request: WAIT macro about hid-remapper HOT 2 OPEN

urfdvw avatar urfdvw commented on July 17, 2024
Feature Request: WAIT macro

from hid-remapper.

Comments (2)

jfedor2 avatar jfedor2 commented on July 17, 2024

It's not currently possible.

You could implement such a delay by using two macros, the following mappings:

Left button -> Macro 1
Expression 2 -> Macro 2

And the following expressions:
Expression 1:

1 recall 
0x00090001 input_state_binary not
mul
0x00090001 input_state_binary
time
5000 add
mul
add
1 store
2 recall
0x00090001 input_state_binary
bitwise_or
2 store 

Expression 2:

1 recall
time eq
2 recall
mul

Expression 3:

1 recall
time eq
not
2 recall
mul
2 store

(Change 0x00090001 in the expression to the usage that you want to trigger the macro.)

I realize it's not the most straightforward.

The way it works is Expression 1 stores the current time plus 5 seconds in register 1 if the button is pressed and at the same time updates register 2 with the value of "1".

Expression 2 checks if the current time matches the value in register 1 and additionally checks if register 2 is "1". This triggers the second macro.

Expression 3 resets register 2 to "0" after the second macro is triggered.

Register 2 is necessary because the clock wraps around after like 35 minutes, I think, so it prevents it the second macro from executing again (at least I hope it does, I didn't wait 35 minutes to check.)

(EDIT: I guess we should also think about what happens when current time+5 seconds wraps. Maybe we need to add some modulo or something.)

from hid-remapper.

dglaude avatar dglaude commented on July 17, 2024

There are some discussion on "startup" Wait in #132 and it worked for me.

from hid-remapper.

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.