-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple commands on key #21
Comments
There is not currently a direct way to attach multiple commands to a key, however you can do most of what you describe using profiles, and there is already an action to activate a profile ( !profile foo )
This should sets up two profiles, and set G20 and G21 to switch between them. The only thing it doesn't do is change the led color. You could also use the output pipe action to send a token to an outside process (I use python scripts) which responds by sending whatever commands you want to the input pipe (/tmp/g13-0) - that can get as complicated as you please. Coming up with a solid syntax for specifying multiple commands for a single key/action can be tricky. If you use multiple lines, there's a potential for conflicts with commands coming from multiple sources concurrently which could get quite confusing. Could be done, but I'm a little concerned that it would add complexity without providing much benefit, as it would only help with static G13-specific changes that don't require outside interaction (i.e. sending a message to an external process). Bit of a slippery slope, as more use cases pop up we could eventually end up with a Turing complete configuration grammar... which IMHO is excessive overkill when the small number of users needing that complexity already had a much more powerful way to manage it. Besides the currently available option ( bind G20 >switch_to_set_bookmarks, with and external script listening to /tmp/g13-0_out ), There are a few other ways to handle more complex configurations without multiple commands. It would be fairly simple to allow actions to be attached to a profile, such that they are executed whenever that profile is activated - that would fully support the use case you described, including color changes. It also would be possible to embed a python interpreter into g13d, but that's not so simple and adds overhead for people who don't need it (or build complexity for multiple targets). Don't get me wrong, I'm all for enabling more complex use cases, and I actually use them myself (I've got a python script that allows me to reconfigure my G13 as I switch between screens using Synergy). But it's also good to keep g13d itself as simple as reasonable for most users, and avoid anything that will "break" current usage. Since this project hummed along for six years before getting features like profiles, pipe output, and multi-key bindings, I suspect that the vast majority of g13d users wouldn't get much out of an increasingly complex configuration grammar. That said, you're welcome to take a crack at it. The syntax I'd suggest would be something like macro add _name action_ : add _action_ to macro _name_ (creating it if necessary) so you're configuration would something look like this
|
Thanks so much for the detailed explanation. Definitely is much easier to do with profiles even though I wouldn't be able to change screen colour. I'll go for that until I get some time to either add macros or make my own python script that processes /tmp/g13-0_out input. |
Is it possible to attach actions to a profile? I'd like to set the LCD to display the name of the profile that's currently active without having a listener script. |
I would like to be able to specify more than one action associated with a key to be able to perform move complicated interactions.
As an example this would be one of my use cases:
I would like to use keys G15 thru G19 and G20 to manage bookmarks in Android Developer Studio.
G20 bind would be like this:
And G21 bind would be like this:
It would be even better if we can have an action to activate a profile (basically send a whole file to /tmp/g13-0)
BTW: Great tool, thanks a lot for all your effort :)
The text was updated successfully, but these errors were encountered: