From 597b007333d8ec0d9cfd29e6941fcbe57379108a Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Mon, 22 May 2023 08:40:47 +0200 Subject: Initial commit --- src/macros/1-ff.py | 83 ++++++++++++++++++++++++++++++++++++ src/macros/2-num.py | 103 +++++++++++++++++++++++++++++++++++++++++++++ src/macros/3-fkeys.py | 87 ++++++++++++++++++++++++++++++++++++++ src/macros/4-move_mouse.py | 54 ++++++++++++++++++++++++ src/macros/5-irssi.py | 49 +++++++++++++++++++++ src/macros/99-none.py | 3 ++ src/macros/99-wm.py | 62 +++++++++++++++++++++++++++ src/macros/olympia.py | 91 +++++++++++++++++++++++++++++++++++++++ src/macros/santana.py | 47 +++++++++++++++++++++ src/macros/teams.py | 44 +++++++++++++++++++ src/macros/zim.py | 53 +++++++++++++++++++++++ 11 files changed, 676 insertions(+) create mode 100644 src/macros/1-ff.py create mode 100644 src/macros/2-num.py create mode 100644 src/macros/3-fkeys.py create mode 100644 src/macros/4-move_mouse.py create mode 100644 src/macros/5-irssi.py create mode 100644 src/macros/99-none.py create mode 100644 src/macros/99-wm.py create mode 100644 src/macros/olympia.py create mode 100644 src/macros/santana.py create mode 100644 src/macros/teams.py create mode 100644 src/macros/zim.py (limited to 'src/macros') diff --git a/src/macros/1-ff.py b/src/macros/1-ff.py new file mode 100644 index 0000000..f1d26ce --- /dev/null +++ b/src/macros/1-ff.py @@ -0,0 +1,83 @@ +# 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 +from adafruit_hid.mouse import Mouse + +import skeleton +from actions import Action + +def reload(macropad, key, pressed): + Action().key(pressed, [Keycode.CONTROL, Keycode.R]) + +def tab(macropad, key, pressed): + Action().key(pressed, [Keycode.CONTROL, Keycode.T]) + +def close(macropad, key, pressed): + Action().key(pressed, [Keycode.CONTROL, Keycode.W]) + +def page_up(macropad, key, pressed): + macropad.mouse.move( + 0, + 0, + 1) + +def page_down(macropad, key, pressed): + macropad.mouse.move( + 0, + 0, + -1) + +class App(object): + def __init__(self): + self.group = skeleton.Group(0x050500, + [(9, "Page") + ,(10, "Tab")] + ) + + def rot_cw(self, macropad, key, pressed): + if self.group.selected == 10: + Action().key(pressed, [Keycode.CONTROL, Keycode.PAGE_DOWN]) + else: + page_down(macropad, key, pressed) + + def rot_ccw(self, macropad, key, pressed): + if self.group.selected == 10: + Action().key(pressed, [Keycode.CONTROL, Keycode.PAGE_UP]) + else: + page_up(macropad, key, pressed) + +def key(code): + def action(macropad, key, pressed): + Action().key(pressed, code) + return action + +def build_application(): + app = App() + + configuration = skeleton.Configuration("Firefox") + configuration.registerKey(0, "^r", reload, 0x000500) + configuration.registerKey(1, "^t", tab, 0x000005) + configuration.registerKey(2, "x", close, 0x050000) + configuration.registerKey(3, "<", key([Keycode.CONTROL, Keycode.PAGE_UP]), 0x050505) + configuration.registerKey(5, ">", key([Keycode.CONTROL, Keycode.PAGE_DOWN]), 0x050505) + configuration.registerKey(12, "", app.rot_cw, None) + configuration.registerKey(13, "", app.rot_ccw,None) + configuration.registerGroup(app.group) + return configuration + +configuration = build_application() diff --git a/src/macros/2-num.py b/src/macros/2-num.py new file mode 100644 index 0000000..68b0911 --- /dev/null +++ b/src/macros/2-num.py @@ -0,0 +1,103 @@ +# 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 adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values +import colorsys + +import skeleton +from actions import Action + + +class Color(object): + """ Represent the color of a key in the HSV model. + + The class implements the int() function in order to being compatible with + the remaining of the application. + """ + def __init__(self, h, s, v): + self.col = (h, s, v) + + def __int__(self): + r, g, b = colorsys.hsv_to_rgb(self.col[0], self.col[1], self.col[2]) + return (r<<16) + (g<<8) + b + +def build_application(): + configuration = skeleton.Configuration("Num pad") + configuration.registerKey( + 0, + "7", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_SEVEN]), + Color(0.333, 1.0, 0.0196)) + configuration.registerKey( + 1, + "8", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_EIGHT]), + Color(0.266, 1.0, 0.0196)) + configuration.registerKey( + 2, + "9", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_NINE]), + Color(0.166, 1.0, 0.0196)) + configuration.registerKey( + 3, + "4", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_FOUR]), + Color(0.4, 1.0, 0.0196)) + configuration.registerKey( + 4, + "5", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_FIVE]), + Color(0.333, 0.6, 0.0196)) + configuration.registerKey( + 5, + "6", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_SIX]), + Color(0.16, 0.6, 0.0196)) + configuration.registerKey( + 6, + "1", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_ONE]), + # 0x000505 + Color(0.5, 1.0, 0.0196)) + configuration.registerKey( + 7, + "2", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_TWO]), + Color(0.5, 0.6, 0.0196)) + configuration.registerKey( + 8, + "3", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_THREE]), + # 0x050505 + Color(0.01, 0.01, 0.0196)) + configuration.registerKey( + 9, + "0", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_ZERO]), + # 0x000507 + Color(0.54, 1.0, 0.027)) + + # The dot key. + configuration.registerKey( + 11, + ".", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_PERIOD]), + # 0x050507 + Color(0.66, 0.286, 0.027)) + return configuration + +configuration = build_application() diff --git a/src/macros/3-fkeys.py b/src/macros/3-fkeys.py new file mode 100644 index 0000000..c35c500 --- /dev/null +++ b/src/macros/3-fkeys.py @@ -0,0 +1,87 @@ +# 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 adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values + +import skeleton +from actions import Action + +def build_application(): + configuration = skeleton.Configuration("F-Keys") + configuration.registerKey( + 0, + "F13", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.F13]), + None) + configuration.registerKey( + 1, + "F14", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.F14]), + None) + configuration.registerKey( + 2, + "F15", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.F15]), + None) + configuration.registerKey( + 3, + "F16", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.F16]), + None) + configuration.registerKey( + 4, + "F17", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.F17]), + None) + configuration.registerKey( + 5, + "F18", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.F18]), + None) + configuration.registerKey( + 6, + "F19", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.F19]), + None) + configuration.registerKey( + 7, + "F20", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.F20]), + None) + configuration.registerKey( + 8, + "F21", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.F21]), + None) + configuration.registerKey( + 9, + "F22", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.F22]), + None) + configuration.registerKey( + 10, + "F23", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.F23]), + None) + configuration.registerKey( + 11, + "F24", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.F24]), + None) + return configuration + +configuration = build_application() diff --git a/src/macros/4-move_mouse.py b/src/macros/4-move_mouse.py new file mode 100644 index 0000000..ef6ede0 --- /dev/null +++ b/src/macros/4-move_mouse.py @@ -0,0 +1,54 @@ +import skeleton + +class Color(object): + """ Return a color which may change over time. + """ + def __init__(self, code): + self.code = code + + def __int__(self): + return self.code + +class NoIdle(object): + + def __init__(self): + self.x = 10 + self.color = Color(0x000500) + self.active = False + + def update(self, macropad): + if not self.active: + return + + self.x *= -1 + macropad.mouse.move( + self.x, + 0, + 0) + # Update the color in red or blue in order to show that the heartbeat + # is active. + self.color.code = 0x010000 if self.x > 0 else 0x000001 + macropad.pixels[4] = int(self.color) + macropad.pixels.show() + + def pause(self, macropad, key, pressed): + if pressed: + self.active = not self.active + if self.active: + self.update(macropad) + else: + # Restore the default color (green) + self.color.code = 0x000500 + macropad.pixels[4] = int(self.color) + macropad.pixels.show() + + +def build_application(): + configuration = skeleton.Configuration("NoIdle") + actor = NoIdle() + configuration.setTick(5000, actor.update) + configuration.registerKey(4, "switch", actor.pause, actor.color) + return configuration + +configuration = build_application() + 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() + + diff --git a/src/macros/99-none.py b/src/macros/99-none.py new file mode 100644 index 0000000..3c15de4 --- /dev/null +++ b/src/macros/99-none.py @@ -0,0 +1,3 @@ +import skeleton + +configuration = skeleton.Configuration("Nothing") diff --git a/src/macros/99-wm.py b/src/macros/99-wm.py new file mode 100644 index 0000000..225044b --- /dev/null +++ b/src/macros/99-wm.py @@ -0,0 +1,62 @@ +# 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 adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values +from adafruit_hid.mouse import Mouse + +import skeleton +from actions import Action + +def desktop4(macropad, key, pressed): + Action().key(pressed, [Keycode.RIGHT_ALT, Keycode.F4]) + +def desktop3(macropad, key, pressed): + Action().key(pressed, [Keycode.RIGHT_ALT, Keycode.F3]) + +def desktop2(macropad, key, pressed): + Action().key(pressed, [Keycode.RIGHT_ALT, Keycode.F2]) + +def desktop1(macropad, key, pressed): + Action().key(pressed, [Keycode.RIGHT_ALT, Keycode.F1]) + +def rot_cw(macropad, key, pressed): + Action().key(pressed, [Keycode.GUI]) + if pressed: + macropad.mouse.move( + 0, + 0, + -1) + +def rot_acw(macropad, key, pressed): + Action().key(pressed, [Keycode.GUI]) + if pressed: + macropad.mouse.move( + 0, + 0, + 1) + +def build_application(): + configuration = skeleton.Configuration("WM") + configuration.registerKey(2, "F4", desktop4, None) + configuration.registerKey(5, "F3", desktop3, None) + configuration.registerKey(8, "F2", desktop2, None) + configuration.registerKey(11, "F1", desktop1, None) + configuration.registerKey(12, "", rot_cw, None) + configuration.registerKey(13, "", rot_acw, None) + return configuration + +configuration = build_application() diff --git a/src/macros/olympia.py b/src/macros/olympia.py new file mode 100644 index 0000000..b124075 --- /dev/null +++ b/src/macros/olympia.py @@ -0,0 +1,91 @@ +# 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 colorsys + +import skeleton +from actions import Action + + +class Color(object): + """ Represent the color of a key in the HSV model. + + The class implements the int() function in order to being compatible with + the remaining of the application. + """ + def __init__(self, h, s, v): + self.col = (h, s, v) + + def __int__(self): + r, g, b = colorsys.hsv_to_rgb(self.col[0], self.col[1], self.col[2]) + return (r<<16) + (g<<8) + b + +def key(code): + def action(macropad, key, pressed): + Action().key(pressed, code) + return action + +def build_application(): + configuration = skeleton.Configuration("Olympia") + configuration.hidden = False + configuration.registerKey(0, "vue", key([Keycode.V]), 0x000500) + configuration.registerKey(1, "map", key([Keycode.M]), 0x000005) + configuration.registerKey(2, "x", key([Keycode.CONTROL, Keycode.W]), 0x050000) + configuration.registerKey(3, "\\", key([Keycode.KEYPAD_SEVEN]), Color(0.333, 1.0, 0.0196)) + configuration.registerKey( + 4, + "|", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_EIGHT]), + Color(0.266, 1.0, 0.0196)) + configuration.registerKey( + 5, + "/", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_NINE]), + Color(0.166, 1.0, 0.0196)) + configuration.registerKey( + 6, + "<", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_FOUR]), + Color(0.4, 1.0, 0.0196)) + + configuration.registerKey(7, "Inventaire", key([Keycode.I]), Color(0.333, 0.6, 0.0196)) + + configuration.registerKey( + 8, + ">", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_SIX]), + # 0x050502 + Color(0.16, 0.6, 0.0196)) + configuration.registerKey( + 9, + "/", + key([Keycode.KEYPAD_ONE]), + 0x000505) + configuration.registerKey( + 10, + "|", + lambda macropad, key, pressed: Action().key(pressed, [Keycode.KEYPAD_TWO]), + Color(0.5, 0.6, 0.0196)) + configuration.registerKey( + 11, + "\\", + key([Keycode.KEYPAD_THREE]), + 0x050505) + return configuration + +configuration = build_application() diff --git a/src/macros/santana.py b/src/macros/santana.py new file mode 100644 index 0000000..2fd88c3 --- /dev/null +++ b/src/macros/santana.py @@ -0,0 +1,47 @@ +# 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 +from adafruit_hid.mouse import Mouse + +import skeleton +from actions import Action + +def groovy(macropad, key, pressed): + Action().key(pressed, [Keycode.CONTROL, Keycode.G]) + +def log(macropad, key, pressed): + Action().key(pressed, [Keycode.CONTROL, Keycode.L]) + +def dql(macropad, key, pressed): + Action().key(pressed, [Keycode.CONTROL, Keycode.SHIFT, Keycode.F]) + +def package(macropad, key, pressed): + Action().key(pressed, [Keycode.CONTROL, Keycode.P]) + +def build_application(): + + configuration = skeleton.Configuration("Santana") + configuration.visible = False + configuration.registerKey(0, "groovy", groovy, 0x000500) + configuration.registerKey(1, "logs", log, 0x000005) + + configuration.registerKey(3, "dql", dql, 0x050500) + configuration.registerKey(4, "package",package, 0x050000) + return configuration + +configuration = build_application() diff --git a/src/macros/teams.py b/src/macros/teams.py new file mode 100644 index 0000000..621f8b6 --- /dev/null +++ b/src/macros/teams.py @@ -0,0 +1,44 @@ +# 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 conv(macropad, key, pressed): + Action().key(pressed, [Keycode.CONTROL, Keycode.TWO]) + +def planning(macropad, key, pressed): + Action().key(pressed, [Keycode.CONTROL, Keycode.FOUR]) + +def link(macropad, key, pressed): + Action().key(pressed, [Keycode.CONTROL, Keycode.K]) + +def build_application(): + + configuration = skeleton.Configuration("Teams") + configuration.visible = False + configuration.registerKey(0, "Convers.", conv, 0x050000) + configuration.registerKey(3, "Planning", planning, 0x050200) + configuration.registerKey(2, "Link", link, 0x020002) + + + return configuration + +configuration = build_application() + diff --git a/src/macros/zim.py b/src/macros/zim.py new file mode 100644 index 0000000..fa93c4a --- /dev/null +++ b/src/macros/zim.py @@ -0,0 +1,53 @@ +# 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 t1(macropad, key, pressed): + Action().key(pressed, [Keycode.CONTROL, Keycode.SHIFT, Keycode.ONE]) + +def t2(macropad, key, pressed): + Action().key(pressed, [Keycode.CONTROL, Keycode.SHIFT, Keycode.TWO]) + +def t3(macropad, key, pressed): + Action().key(pressed, [Keycode.CONTROL, Keycode.SHIFT, Keycode.THREE]) + +def none(macropad, key, pressed): + Action().key(pressed, [Keycode.CONTROL, Keycode.SHIFT, Keycode.NINE]) + +def link(macropad, key, pressed): + Action().key(pressed, [Keycode.CONTROL, Keycode.L]) + +def build_application(): + + configuration = skeleton.Configuration("Zim") + configuration.visible = False + configuration.registerKey(0, "T1", t1, 0x000500) + configuration.registerKey(3, "T2", t2, 0x000200) + configuration.registerKey(6, "T3", t3, 0x000100) + configuration.registerKey(9, "None", none, 0x000000) + + configuration.registerKey(2, "Link", link, 0x020002) + + + return configuration + +configuration = build_application() + -- cgit v1.2.3