Add hotkey 'list' support to send concurrent keycodes#1719
Open
dearmash wants to merge 4 commits intoadafruit:mainfrom
Open
Add hotkey 'list' support to send concurrent keycodes#1719dearmash wants to merge 4 commits intoadafruit:mainfrom
dearmash wants to merge 4 commits intoadafruit:mainfrom
Conversation
To better support multiple key macros in a row. Rather than needing to send +key.a, +key.b, -key.a, -key.b, +key.1, +key.2, etc. specifying up and down for each, you can define the chords more simply: [[key.a, key.b], [key.1, key.2]] The macro definition is simpler, and less error prone (see win-edge.py, was pressing control and releasing command). Also shorthands multiple presses in a row: [[Keycode.ENTER], [Keycode.ENTER], [Keycode.ENTER]] will press and release enter 3x in a row.
Contributor
Author
|
Another example of how this cleans up things: [[Keycode.COMMAND, Keycode.SPACE], 'chrome', [Keycode.ENTER], [Keycode.COMMAND, Keycode.T], 'mail.google.com/mail', [Keycode.TAB], [Keycode.ENTER]] From anywhere on your computer, this macro will switch to chrome, and switch to your existing gmail tab. command space chrome enter launches spotlight and opens chrome / brings it to the front |
lesamouraipourpre
suggested changes
Aug 3, 2021
Contributor
lesamouraipourpre
left a comment
There was a problem hiding this comment.
Not functionally tested as I don't have a MacroPad.
Oops, fixed one copy paste error only to introduce another. Now both are fixed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To better support multiple key macros in a row.
Rather than needing to send +key.a, +key.b, -key.a, -key.b, +key.1, +key.2, etc. specifying up and down for each, you can define the chords more simply:
[[key.a, key.b], [key.1, key.2]]
The macro definition is simpler, and less error prone (see win-edge.py, was pressing control and releasing command).
Also shorthands multiple presses in a row:
[[Keycode.ENTER], [Keycode.ENTER], [Keycode.ENTER]] will press and release enter 3x in a row.
Thank you for creating a pull request to contribute to Adafruit's GitHub code!
Before you open the request please review the following guidelines and tips to
help it be more easily integrated:
Describe the scope of your change--i.e. what the change does and what parts
of the code were modified. This will help us understand any risks of integrating
the code.
Describe any known limitations with your change. For example if the change
doesn't apply to a supported platform of the library please mention it.
Please run any tests or examples that can exercise your modified code. We
strive to not break users of the code and running tests/examples helps with this
process.
Thank you again for contributing! We will try to test and integrate the change
as soon as we can, but be aware we have many GitHub repositories to manage and
can't immediately respond to every request. There is no need to bump or check in
on a pull request (it will clutter the discussion of the request).
Also don't be worried if the request is closed or not integrated--sometimes the
priorities of Adafruit's GitHub code (education, ease of use) might not match the
priorities of the pull request. Don't fret, the open source community thrives on
forks and GitHub makes it easy to keep your changes in a forked repo.
After reviewing the guidelines above you can delete this text from the pull request.