From aa9576cb4c02318f66255efe5e86bac1a0aba459 Mon Sep 17 00:00:00 2001 From: sezanzeb Date: Sun, 10 Oct 2021 23:25:14 +0200 Subject: [PATCH] The usage section points to the readme files online now --- data/key-mapper.glade | 644 +--------------------------- keymapper/injection/macros/parse.py | 4 +- 2 files changed, 9 insertions(+), 639 deletions(-) diff --git a/data/key-mapper.glade b/data/key-mapper.glade index 34bef953..f8b6a060 100644 --- a/data/key-mapper.glade +++ b/data/key-mapper.glade @@ -923,9 +923,14 @@ See the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU General Pu True False - A "key + key + ... + key" syntax can be used to trigger key combinations. For example "control_l + a". + See <a href="https://github.com/sezanzeb/key-mapper/blob/HEAD/readme/usage.md">usage.md</a> online on github for comprehensive information. -"disable" disables a key. +A "key + key + ... + key" syntax can be used to trigger key combinations. For example "Control_L + a". + +Writing "disable" as a mapping disables a key. + +Macros allow multiple characters to be written with a single key-press. Information about programming them is available online on github. See <a href="https://github.com/sezanzeb/key-mapper/blob/HEAD/readme/macros.md">macros.md</a> and <a href="https://github.com/sezanzeb/key-mapper/blob/HEAD/readme/examples.md">examples.md</a> + True True 0 @@ -935,641 +940,6 @@ See the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU General Pu 0 - - - True - False - center - 6 - 6 - 6 - 6 - 6 - Macros - True - True - 0 - 0.5 - - - False - True - 1 - - - - - True - False - Macros allow multiple characters to be written with a single key-press. - True - 0 - - - False - True - 2 - - - - - - True - False - 18 - - - True - False - r - 0 - - - 0 - 0 - - - - - True - False - waits in milliseconds - 0 - - - 1 - 1 - - - - - True - False - w - 0 - - - 0 - 1 - - - - - True - False - k - 0 - - - 0 - 2 - - - - - True - False - writes a single keystroke - 0 - - - 1 - 2 - - - - - True - False - e - 0 - - - 0 - 3 - - - - - True - False - holds a modifier while executing the second parameter - 0 - - - 1 - 4 - - - - - True - False - writes an event - 0 - - - 1 - 3 - - - - - True - False - m - 0 - - - 0 - 4 - - - - - True - False - repeats the execution of the second parameter - 0 - - - 1 - 0 - - - - - True - False - executes the parameter as long as the key is pressed down - 0 - - - 1 - 5 - - - - - True - False - h - 0 - - - 0 - 5 - - - - - True - False - . - 0 - - - 0 - 6 - - - - - True - False - executes two actions behind each other - 0 - - - 1 - 6 - - - - - True - False - mouse - 0 - 0 - - - 0 - 7 - - - - - True - False - wheel - 0 - 0 - - - 0 - 8 - - - - - True - False - takes direction (up, left, ...) and speed as parameters - 0 - - - 1 - 7 - - - - - True - False - same as mouse - 0 - - - 1 - 8 - - - - - True - False - if_tap - 0 - 0 - - - 0 - 9 - - - - - True - False - if no other key is pressed until the keys release, execute the first param, otherwise the second - True - 0 - - - 1 - 10 - - - - - True - False - if a key is tapped quickly, execute the first param, otherwise the second. The third param is the time in milliseconds - True - 0 - - - 1 - 9 - - - - - True - False - if_single - 0 - 0 - - - 0 - 10 - - - - - False - False - 3 - - - - - True - False - center - 6 - 6 - 6 - 6 - 6 - Examples - True - True - 0 - 0.5 - - - False - True - 4 - - - - - - True - False - 18 - - - True - False - k(1).k(2) - True - 0 - 0 - - - 0 - 0 - - - - - True - False - a, a, a with 500ms pause - 0 - - - 1 - 1 - - - - - True - False - r(3, k(a).w(500)) - True - 0 - 0 - - - 0 - 1 - - - - - True - False - m(Control_L, k(a).k(x)) - True - 0 - 0 - - - 0 - 2 - - - - - True - False - CTRL + a, CTRL + x - 0 - - - 1 - 2 - - - - - True - False - k(1).h(k(2)).k(3) - True - 0 - 0 - - - 0 - 3 - - - - - True - False - moves the mouse cursor 10px to the right - 0 - - - 1 - 4 - - - - - True - False - writes 1 2 2 ... 2 2 3 while the key is pressed - 0 - - - 1 - 3 - - - - - True - False - e(EV_REL, REL_X, 10) - True - 0 - 0 - - - 0 - 4 - - - - - True - False - 1, 2 - 0 - - - 1 - 0 - - - - - True - False - which keeps moving the mouse while pressed - 0 - - - 1 - 5 - - - - - True - False - mouse(right, 4) - True - 0 - 0 - - - 0 - 5 - - - - - True - False - wheel(down, 1) - True - 0 - 0 - - - 0 - 6 - - - - - True - False - keeps scrolling down while held - 0 - - - 1 - 6 - - - - - True - False - if_single(k(a), k(b)) - True - 0 - 0 - - - 0 - 9 - - - - - True - False - if_tap(k(a), k(b), 1000) - True - 0 - 0 - - - 0 - 8 - - - - - True - False - if_tap(k(a), k(b)) - True - 0 - 0 - - - 0 - 7 - - - - - True - False - writes a if the key is released within a second, otherwise b - True - 0 - - - 1 - 8 - - - - - True - False - writes a if the key is tapped, otherwise b - 0 - - - 1 - 7 - - - - - True - False - writes b if another key is pressed, or a if the key is released and no other key was pressed in the meantime. - True - 0 - - - 1 - 9 - - - - - False - False - 5 - - - - - True - False - 6 - 6 - 6 - Between calls to k, key down and key up events, macros will sleep for 10ms by default, which can be configured in ~/.config/key-mapper/config - True - True - 0 - 0.5 - - - False - True - 6 - - diff --git a/keymapper/injection/macros/parse.py b/keymapper/injection/macros/parse.py index 4611255d..eb4e5372 100644 --- a/keymapper/injection/macros/parse.py +++ b/keymapper/injection/macros/parse.py @@ -183,8 +183,8 @@ def _parse_recurse(code, context, macro_instance=None, depth=0): Parameters ---------- code : string - Just like parse. - A single parameter of a function or the complete macro as string. + Just like parse. A single parameter or the complete macro as string. + Comments and redundant whitespace characters are expected to be removed already. context : Context macro_instance : Macro or None A macro instance to add tasks to