0

Keycodes: Creating MacroPad Macros for Linux Firefox, Adabox
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Keycodes: Creating MacroPad Macros for Linux Firefox, Adabox

by tombalazs on Sat Jul 31, 2021 11:59 am

Okay I have my MacroPad working. Now I want to use the cool keypad.
I was thinking of using the keypad to control the players in Google Olympics "Google Doodle Champion Island Games" https://www.google.com/doodles/doodle-c ... es-july-24
That seems like a good fit because it uses very limited keystrokes.

Also, when I copy a script and edit it and save it to the MacroPad. What do I have to do to make it show up in the rotary script list? Do I restart, reboot, ...

I'm editing one of the scripts
I guess what I want to know is what do I change to, for example, assign arrow keys to the MacroPad keypad.
if the keypad is
123
456
789
How do I make 2 be up arrow
4 be left arrow, etc
I'll want an enter key
space key ...
I can use keys 10, 11, and 12 for that

What I'm trying now
Code: Select all | TOGGLE FULL SIZE
    # MACROPAD Hotkeys example: Linux Ubuntu Firefox Google Olympics

    from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values

    app = {                         # REQUIRED dict, must be named 'app'
        'name' : 'Google Olympics', # Application name
        'macros' : [                # List of button macros...
            # COLOR    LABEL    KEY SEQUENCE
            # 1st row ----------
            #(0x004000, 'Undo', [Keycode.COMMAND, 'z']),
            (0x004000, 'Up', [Keycode.UP_ARROW]), #Up Arrow
            #(0x303000, 'Pen', 'p'),     # Path-drawing tool
            # 2nd row ----------

            (0x101010, 'Left', [Keycode.LEFT_ARROW]),  # Left Arrow
            #(0x400000, 'Reflect', 'o'), # Reflect selection
            (0x303000, 'Right', [Keycode.RIGHT_ARROW]),  # Right Arrow
            # 3rd row ----------
            #(0x101010, 'Direct', 'a'),  # Direct (point) selection
            (0x400000, 'Down', [Keycode.DOWN_ARROW]),  # Down Arrow
            #(0x303000, 'Oval', 'l'),    # Draw ellipse
            # 4th row ----------
            (0x101010, 'Enter', [Keycode.ENTER]), # Enter
            (0x400000, 'Space', [Keycode.SPACE]),   # Space
            #(0x303000, 'Text', 't'),    # Type tool
            # Encoder button ---
            #(0x000000, '', [Keycode.COMMAND, Keycode.OPTION, 'S']) # Save for web
        ][[[[
    }

tombalazs
 
Posts: 5
Joined: Sat Jul 31, 2021 11:12 am

Re: Keycodes: Creating MacroPad Macros for Linux Firefox, Ad

by tombalazs on Sat Jul 31, 2021 1:11 pm

I'm on an Ubuntu 20 laptop. I believe that I am editing the file which is on the MacroPad directly via my file browser and text editor.
I wanted to remove some of the scripts I'm not using.
Like remove "Windows Edge", "Mac Illustrator", etc.
But when I moved them to another fold and when I changed the file extension to ".txt" the changes didn't keep. After I rebooted the MacroPad they files were right back where they were how they were before.

tombalazs
 
Posts: 5
Joined: Sat Jul 31, 2021 11:12 am

Please be positive and constructive with your questions and comments.