Unofficial interaction zones project for Talon Voice. Use your cursor to activate commands by hovering or clicking on zones. Design zones via an image creation program and use them in Talon. Report any bugs or enhancements.
- 2 types of zones: simple (similar to a button switch), trigger (similar to a lever switch).
- 2 interaction methods: clicking, hovering.
- Start delay and repeat command configuration options.
- Optional modifiers to customize the behaviour of zones.
- A small button to toggle zones on/off.
- Insert text [ex: hello world]
- Any key action supported by Talon (https://talon.wiki/key_action/) [ex: ctrl-s]
- Key bindings, requires (https://github.com/FireChickenProductivity/TalonKeyRebindings) [ex: bind: a,mouse 0, unbind: a]
- Swapping interaction zones [ex: swap: default]
- Starting/opening any application [ex: start: C:/notepad.exe]
- Scrolling [ex: scroll down: 1.5]
- Draw your zones in your image editing program and use text boxes inside of the zones to configure them (alternatively just put down some placeholder text and manually write the configuration file after). Requires any image editing program that exports to PDF (https://www.photopea.com/ or Photoshop are examples). Every unique zone must have a unique colour (even a little difference is fine), all text for a particular zone must be within that unique colour.
- Download pdf files to …/pdfparser/ subdirectory. Use the pdf_parser.py utility to automatically convert the PDF into a visual (.png stripped of text), and config file (.txt). These files can be edited after they are autogenerated (if needed).
- Use the interaction zones.
- Set your document size in your image-editing program to be your screen size with 72DP (dpi is usually by default correct).
- The exported PDF must not have any compression settings enabled.
- Clone this repository into the Talon user folder.
- First time users need to create an interaction zone.
A default.pdf interaction zone is included in .../pdfparser/. You need to run the pdf_parser.py file in the .../pdfparser directory as a standalone script and select the "Parse Pdf" option in order to generate the interaction zone files.
This requires the PyMuPDF (https://pypi.org/project/PyMuPDF/) library to be installed, also Pillow (https://pypi.org/project/Pillow/). - If required, you can use the same utility to resize the output of the PDFs to your local machines screen size using the "Resize All Images" option when running the utility.
- Restart Talon and click the little grey rectangle in the top centre of your screen to toggle the zones on-and-off.
Creating a custom interaction zone occurs inside of an image editing program such as Photopea (https://www.photopea.com/) or Photoshop.
You must define zones by using unique colours and then place configuration text inside of those zones.
For your reference these are the rules for when you're creating a custom interaction zone. Look at the example above for an intuitive understanding of how this works. Also, included in .../pdfparser/ is the .psd file which was used to export the default PDF for your use as a reference.
- Every interaction zone must have a unique colour (as long as the colour is a little bit different, its fine).
- All text (the configuration text) must be inside the appropriate unique colour. Alternatively you can just have placeholder text (write just the title of the zone) then manually write the configuration files.
- The background of the exported PDF must be pure white.
- All markings for zones must be pixel perfect.
- This means that every pixel must be 100% the intended colour. Many image editing operations (rescaling, rotating, paint brushes etc.) will apply a little bit of blurring to the edges of your marks. This is currently not allowed.
- Use the pencil tool instead of brushes, disable feathering on selections, and turn the hardness and opacity to 100%.
- A good method to check is to zoom in as far as you can onto the edges of your shapes and see if there's any blurring. You want no smooth transitions between colors.
Note: you must replace and regenerate the default.pdf to swap to custom zones.
Title of the interaction zone
on [click/hover] [trigger/NONE] [warmup/NONE] [repeat delay/NONE]
action1
action2
Anywhere that NONE appears means that that field is optional. action2 only applies if the interaction zone is a trigger.
Warmup: for hovering, this is how long you need to hover over the zone to start the command. For click, this is the delay before the command starts.
Repeat Delay: with how much frequency will the command repeat in the case of a trigger zone.
- Keypresses: simply write the action without quotations (https://talon.wiki/key_action/)
- Swap Zones: swap: NAME_OF_INTERACTION_ZONE_FILE
- Rebinding: for example rebinding a->b and unbinding a.
- bind: a,b
- unbind: a
- Text Insertion: simply write the text that you want to insert
- Start Programs: start: PATH_OF_THING_TO_OPEN
- Scrolling: scroll down: DECIMAL_AMOUNT
A
on click
a
This will simply press the 'a' key when the zone is clicked.
A SPAM
on click trigger 0 0.5
a
a:up
When you click this interaction zone the first time it will output the key 'a' immediately every 0.5s. When you click this interaction zone again, it will immediately fire 'a:up' so as to stop pressing 'a'.
ENTER
on hover trigger 1
shift:down
shift:up
When you hover over the interaction zone for 1s, it will trigger the key 'shift:down' once. When you hover over the zone again for 1s, it will stop the 'shift' by firing 'shift:up'.
For very specific customization, zones also support modifiers. Add modifiers in a single newline at the end of each zone configuration data. For multiple modifiers separate them by commas.
Below modifiers are listed before the colon (must be exact).
deactivate on exit: only works on hover trigger zones, causes that the zone will be immediately deactivated once you stop hovering.
- (Advanced users) all generated files are placed in /InteractionZones/ feel free to manually export pngs directly to this folder as well as manually adjust the generated configuration files. Be warned that using pdf_parser.py will overwrite any manually adjusted configuration data.
- See settings.py to further customize the way that interaction zones work (zone opacity, toggle switch location, etc.)
- Using really really small fonts with a small screen size will usually cause the pdfparser to fail to automatically convert your pdf. In this case you should manually export your .png and .txt config files to the InteractionZones folder.
- End-user Experience Design, Brinzerdecalli: inspired by the needs and ideas of Brinzerdecalli.
- Base Project, FireChickenProductivity: this project is a rewrite of an interaction zones project started here (https://github.com/FireChickenProductivity).