pqrs-org / Karabiner-Elements

Karabiner-Elements is a powerful utility for keyboard customization on macOS Sierra (10.12) or later.
https://pqrs.org/osx/karabiner/
The Unlicense
18.69k stars 836 forks source link

Are the possible keys / values for manipulators.parameters documented anywhere? #2380

Closed earslap closed 3 years ago

earslap commented 4 years ago

I'm creating a little tool to create karabiner configs through code. The "parameters" object under the items of manipulators array, looks like, is not thoroughly documented anywhere. The only reference I can find to it is under to_if_alone documentation where it has the key basic.to_if_alone_timeout_milliseconds but I can't locate any other references to a dedicated page about it. Is that the only legal key or is there anything more to it?

MuhammedZakir commented 4 years ago

You can see all 'manipulators.parameters' in Karabiner-Elements > Preferences > Complex modifications > Parameters. I couldn't find 'mouse_motion_to_scroll.speed' in docs, but all basic.* parameters are there. You can find other parameters in 'karabiner.json' file, but only useful if you are generating more than "manipulators" like Goku - https://github.com/yqrashawn/GokuRakuJoudo.

P.S. When you create one, do post the link here! :-) P.S.2. Which language will you use to make it?

earslap commented 4 years ago

Thank you @MuhammedZakir - still it is not clear to me if all profiles.parameters are valid under profiles.rules[x].parameters...

And it is javascript; because as the saying goes, everything that can be done with javascript will eventually be done with javascript.

But seriously, I didn't feel like learning a new DSL and its own way of doing things so I created a pipeable js interface for the complex modifications portion of the config. The structure of the code closely follows the structure of karabiner.json (so you don't need to learn anything new really) but it is a lot more concise. You can have variables, loops, comments, type checking, warnings and errors for invalid values / structure etc. Works very well for me. I'll eventually put it on npm and let you know if you are interested.

MuhammedZakir commented 4 years ago

Thank you @MuhammedZakir - still it is not clear to me if all profiles.parameters are valid under profiles.rules[x].parameters...

All the other parameters are for devices. If those are moved to other places, Karabiner does not consider them as invalid, even though they are not picked (or discarded?) by Karabiner and do nothing.

And it is javascript; because as the saying goes, everything that can be done with javascript will eventually be done with javascript.

I also love JS! Except that most apps import a huge number of packages for developing and it is frustrating to download them. However, it has become much better after I started using PNPM. You should give it a try if you aren't using it!

But seriously, I didn't feel like learning a new DSL and its own way of doing things so I created a pipeable js interface for the complex modifications portion of the config. The structure of the code closely follows the structure of karabiner.json (so you don't need to learn anything new really) but it is a lot more concise. You can have variables, loops, comments, type checking, warnings and errors for invalid values / structure etc. Works very well for me.

Tbh, at first, just looking at it gave me a headache because of its terseness and brackets. But after reading it one more, it wasn't that bad and feels a bit like JSON. Though, one reason for me to use it is exactly its terseness. Another reason is that looking at it feels like looking at mini-LISP. So, you know, familiarizing myself! 😅

I'll eventually put it on npm and let you know if you are interested.

I'm interested! 😆

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.