diff options
author | Sébastien Dailly <sebastien@dailly.me> | 2023-05-22 08:40:47 +0200 |
---|---|---|
committer | Sébastien Dailly <sebastien@dailly.me> | 2023-05-22 08:40:47 +0200 |
commit | 597b007333d8ec0d9cfd29e6941fcbe57379108a (patch) | |
tree | 0cf87e1ac487e7deb91acf7f2bec70bd4dd06703 /src/macros/5-irssi.py |
Initial commit
Diffstat (limited to 'src/macros/5-irssi.py')
-rw-r--r-- | src/macros/5-irssi.py | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/macros/5-irssi.py b/src/macros/5-irssi.py new file mode 100644 index 0000000..bcf5d81 --- /dev/null +++ b/src/macros/5-irssi.py @@ -0,0 +1,49 @@ +# SPDX-FileCopyrightText: 2021 Phillip Burgess for Adafruit Industries +# +# SPDX-License-Identifier: MIT + +# MACROPAD Hotkeys example: Mouse control + +# The syntax for Mouse macros is highly peculiar, in order to maintain +# backward compatibility with the original keycode-only macro files. +# The third item for each macro is a list in brackets, and each value within +# is normally an integer (Keycode), float (delay) or string (typed literally). +# Consumer Control codes were added as list-within-list, and then mouse +# further complicates this by adding dicts-within-list. Each mouse-related +# dict can have any mix of keys 'buttons' w/integer mask of button values +# (positive to press, negative to release), 'x' w/horizontal motion, +# 'y' w/vertical and 'wheel' with scrollwheel motion. + +# To reference Mouse constants, import Mouse like so... +from keycode_win_frnb import Keycode # Use the french bepo layout + +import skeleton +from actions import Action + +def wc(macropad, key, pressed): + if not pressed: + return + Action().sequence( + [ [Keycode.KEYPAD_FORWARD_SLASH] + , [Keycode.W] + , [Keycode.C] + , [Keycode.ENTER] + ] + ) + +def next_one(macropad, key, pressed): + Action().key(pressed, [Keycode.ALT, Keycode.A]) + +def build_application(): + + configuration = skeleton.Configuration("Irssi") + configuration.visible = True + configuration.registerKey(0, "next.", next_one, 0x000200) + configuration.registerKey(2, "/wc", wc, 0x020000) + + + return configuration + +configuration = build_application() + + |