It includes 19 Actions such as key sending and tooltip display, 10 Combination Actions that switch actions based on user input such as mouse gestures, and 5 Conditions that determine whether a hotkey is enabled or disabled.
These can be combined, or you can define new actions and conditions yourself.
See here for more details.
Also, please read this section carefully as it contains some tricky processes such as temporarily blocking keyboard input to implement some of the features.
It is working well enough for my own use, but I would like to hear from others so that I can meet the needs of more people.
I am not sure how to receive notifications here, so my reply may be delayed. Issues or Discussions on Github can reply by the next day.
CHANGELOG
v0.0.4
Added #10 Add MousePositionCondition #14 Add the option to specify each monitor and primary monitor in "monitor" and "screen" of origin such as "monitor-primary" and "monitor-1" #20 Add "monitors" (alias "screens") to origin
Fixed #13 Origin "monitor" and "screen" return coordinates of the primary monitor, instead of the active monitor #22 CommandPaletteCombiAction is not searched correctly when searching for certain characters #23 When using the R option in PasteAction etc., if the string to expand contains a string such as ${abc}, it will not be embedded correctly #24 ExitAllAction does not terminate some AutoHotkey scripts
v0.0.3
Fixed #15 Hotkey options not set on CustomHotkey constructor #16 CustomHotkey.setOptions overwrites unspecified options with an empty string #17 Passing a string to the CustomHotkey.TrayTipAction constructor does not display a tray tip
v0.0.2
#3 When combined KeyStrokeCombiAction, temporarily disabled hotkeys are no longer restored to their original state
v0.0.1
First released.
Examples
Hot Edge/Corner
The following code is an example of a simple hot edge, where a click on the right edge of the screen launches the Start menu.
The following code shows an example of assigning actions based on the number of times a non-modifier key is entered or whether it is pressed and held. In this example, the tooltip changes according to the number of times the key is pressed.
#Include <CustomHotkey>
trigger := "RCtrl & q"
action := { single: "{ToolTip|T-3s}Pressed the q key once."
, long: "{ToolTip|T-3s}Pressed and held the q key."
, double: "{ToolTip|T-3s}Pressed the q key two times."
, triple: "{ToolTip|T-3s}Pressed the q key three times."
, quadruple: "{ToolTip|T-3s}Pressed the q key four times."
, quintuple: "{ToolTip|T-3s}Pressed the q key five times." }
new CustomHotkey(trigger, action).on()
The following is the documentation needed to understand the above code.
The following example registers a hotkey to execute a mouse gesture when the RButton is long-pressed in MSEdge, GoogleChrome, and FireFox browsers. Also list links to the elements that make up the example.
In the distant future, due to lack of time, I would like to eventually be able to use the GUI to easily register complex hotkeys even for non-programmers.
Last edited by zero-plusplus on 17 Mar 2023, 00:05, edited 3 times in total.
I intentionally included many explanations because I have experienced difficulty in the past due to the lack of explanations for the tool I used.
I was worried that it would be hard to read, but I'm glad it was useful for you.
CustomHotkey is the final goal of my AutoHotkey-related project, and I hope to release an improved version in the future, including GUI support. Perhaps this improved version will be provided as a vscode extension.
However, it is a few years away now because I am spending a lot of time developing vscode-autohotkey-debug, a tool to comfortably develop CustomHotkey, and the language server for AutoHotkey, which is currently under private development.
I hope to provide an environment where even non-programmers can define complex hotkeys and their actions through GUI, and programmers can comfortably develop plug-ins using the above tools.
The following projects related to AutoHotkey are published.