-
Notifications
You must be signed in to change notification settings - Fork 0
Key Output
In the end, every mouse profile comes down to pressing keyboard keys. Sometimes we want to press a specific key, sometimes we want to type out a string made out of multiple key presses. Here we will go over how strings and key names are processed.
In general Revenant should be able to produce any character on the keyboard, plus uppercase letters and on a German keyboard accented letters like ò, Á and so on.
If you want to know the exact keys supported, you can look through the key-map files for each of the currently included locales which are are en-US, en-GB and de-DE, more perhaps coming later.
Extended unicode characters are not yet supported as characters need to be able to be produced by the keyboard and unicode input is rather inconsistent.
Since pressing a modifier key together with another key is often utilized in keybindings, Revenant aims to make modifier combinations easier to construct by repurposing a number of generally rarely used keys as modifier codes that can be prepended to other inputs:
-
*: control -
~: shift -
#: alt -
|: gui (winon windowscmdon mac)
-- "ctrl+a" , short notation
k.m3 = "*a"
-- "ctrl+a" , expanded manual notation
k.m4 = { 'lctrl' 'a' ,type="key"}Multiple modifier prefixes can be stacked. The combination *~a resolves to control+shift+a, with the order of the modifier codes determining which key is pressed down first.
Modifier prefixes only apply to the next non-modifier key. This means that #~ab resolves to alt+shift+a followed by a normal input b without any modifiers pressed. To wrap longer key sequences in modifiers the expanded key macro notation or the key wrap macro can be used.
The quick modifiers will always use the left version of the modifier left-shift, left-alt and so on. Combinations the right positioned modifiers needs to be done with the expanded notation using rcontrol, ralt etc.
In order to use any of the modifier codes as their normal key inputs like asterisk, tilde, and so on, simply escape them with a forward slash:
-- asterisk key followed by shift+a
k.m3 = "/*~a"
-- ctrl+shift+a
k.m4 = "*~a"In order to interpolate special or normally non-printable keys into sequences without needing to break up strings, Revenant provides escape sequences for pretty much all of those keys.
For example if we want to input the key sequence up-down-enter-insert, we can do so using a simple string of escape sequences instead of a list of logitech key calls (see Logitech Key Names).
-- Short version using escape sequences
k.m3 = "/u/d\n/i"
-- long, expanded notation
k.m4 = { {t="k","up"},{t="k","down"},{t="k","enter"},{t="k","insert"} ,type="sequence"}As you can see this enables a lot of very concise single string bindings for complex actions and is certainly faster than recording multi-key macros with LGS itself.
-
\t= Tab -
\n,\r= Enter
The following special escape sequences are provided by Revenant, note that these are escaped with forward slashes:
-
/1-/5: The numbers 1 through 5 escaped with a forward slash stand for the mouse buttons 1 through 5; Left, Right, Middle, Forward and Back. -
/6,/7: Mouse wheel up/down movement grouped as the 6th and 7th "pseudo" keys of the mouse. Because there is no press/release state of a mouse wheel click, only the "press" action can be performed, release commands will be ignored.
-
/01-/24: Any number from 01 to 24 escaped with a forward slash and formatted with two digits stands for the F-keys F1 to F24.
-
/c,/C: Control key. lowercase for left control uppercase for right control -
/a,/A: Alt Key. Lowercase for left Alt, uppercase for right Alt -
/s,/S: Shift Key. Lowercase for left Shift, uppercase for right shift. -
/w,/W: "gui" key; win for windows, cmd for mac. Lowercase for left gui, uppercase for right gui.
-
/e: escape -
/b: backspace -
/u,/d,/l,/r: Shorthands for the arrow keys; Up, Down, Left, Right. -
/L: Capslock -
/N: Numlock -
/p: Print -
/i: insert -
/h: home -
/D: page-down -
/U: page-up -
/E: end -
/m: app -
/n: enter (numpad) -
/-: minus (numpad) -
/+: plus (numpad) -
/.: period (numpad)
This section lists all key names recognized by the logitech API for key presses.
When using a normal key macro any string equal to one of the logitech key names will be interpreted as that key, any Revenant defined escape sequence can of course also be used.
Note that when used in a Sequence Macro, the string is not resolved to a key but read as key sequence.
-- Logitech notation
k.m4={"escape" ,type="key"}
-- Revenant notation
k.m4={"/e" ,type="key"}
-- prints the string "escape"
k.m4={"escape" ,type="sequence"}The only keys that can only be accessed through their logitech names are the numpad digits (num0 - num9), numslash and non_us_slash.
tildeminusequallbracketrbracketbackslashcapslocksemicolonquotecommaperiodslashescapeentertabspacebarupleftdownrightbackspacelshiftrshiftlctrlrctrllaltraltlguirguif1f2f3f4f5f6f7f8f9f10f11f12f13f14f15f16f17f18f19f20f21f22f23f24deletehomeinsertpausepagedownpageupprintscreenscrolllockappkeynon_us_slashnumlockendnum0num1num2num3num4num5num6num7num8num9numslashnumminusnumplusnumenternumperiod
- Key Macro
- Sequence Macro
- Cycle Macro
- Group Macro
- Multiclick Macro
- Hold Key Macro
- Mouse Position Macro
- Mouse Wheel Macro
- Mode Change Macro
- Backlight Macro
- DPI Macro
- External Macro
- Log Macro
- Documentation Macro
- Pagination Macro
- Control Macro
- Key Buffer Macro
- Wrap Key Macro
- Link Macro
- Instance Macro
- Flag Macro
- Function Macro
- Alter History Macro