cajhin / capsicain

Powerful low-level keyboard remapping tool for Windows
349 stars 18 forks source link

Parse CONFIGSWITCH:nextConfig in sequence() #30

Closed bitoj closed 3 years ago

bitoj commented 3 years ago

Parses CONFIGSWITCH:nextConfig tag in sequence function, similar to SLEEP:time.

This allows using something like this:

[CONFIG_7]
REWIRE \ 7
COMBO SCRLOCK [.] > sequence(CONFIGSWITCH:8_SCRLOCK)

[CONFIG_8]
REWIRE \ 8
COMBO SCRLOCK [.] > sequence(SCRLOCK_CONFIGSWITCH:7)
cajhin commented 3 years ago

I think this should work. Possibly a small complication with LEDs, since during the config switch, a reset() is performed, which may mess with the LED state. If you don't mind (your English is excellent btw.), please update the Wiki. No nitty gritty details, just state that there is this new "magic keyword" CONFIGSWITCH that can be used in sequence().

Note to self: in the next major version, catch stoi() errors; right now the app crashes on SLEEP:notanumber

bitoj commented 3 years ago

That LED thing is not really a complication, but the motivation for proposing this. The new sequence possibility is not part of the problem, but of the solution.

I'll have a look at documenting the change tomorrow. First I'll need to find out how to do that. I just realized that the wiki, unless the readme, is not part of the code tree. So no straightforward local edit followed by a pull request.

Probably not a big thing, but another learning opportunity.

cajhin commented 3 years ago

wiki: just navigate to the page you want to edit

If you don't like doing this, no problem I can do it.