Riffing on the Launch_Deck_Trellis_M4 Example

Riffing on the Launch_Deck_Trellis_M4 Example

Aside from Noisy Grains of Sand, which is awesome, I've probably spent the most time messing around with variations on the Launch Deck example that takes advantage of the controller's ability to emulate a usb keyboard.

A rough sketch of an 8 x 4 grid of keys labeled with function and navigation buttons.
My initial key layout sketch.

This is the button mapping I've landed on for now:

# button mappings
# customize these for your desired postitions, colors, and keyboard combos
# specify (button coordinate): (color hex value, command type, cocmmand/keycodes)
keymap = {
    (0,0): (0x882200, KEY, (Keycode.ESCAPE,)),
    (1,0): (0x333333, KEY, (Keycode.ONE,)),
    (2,0): (0x333333, KEY, (Keycode.TWO,)),
    (3,0): (0x333333, KEY, (Keycode.THREE,)), # 0x222211
    (4,0): (0x882200, KEY, (Keycode.F11,)),
    (5,0): (0x004444, KEY, (Keycode.PRINT_SCREEN,)),
    (6,0): (0x880022, KEY, (Keycode.DELETE,)),
    (7,0): (0x446688, KEY, (Keycode.PAGE_UP,)),

    (0,1): (0x884488, KEY, (Keycode.TAB,)),
    (1,1): (0x333333, KEY, (Keycode.FOUR,)),
    (2,1): (0x333333, KEY, (Keycode.FIVE,)),
    (3,1): (0x333333, KEY, (Keycode.SIX,)),
    (4,1): (0x440000, KEY, (Keycode.F7,)), # SCREEN OFF VIA SHORTCUT
    (5,1): (0x004400, KEY, (Keycode.F8,)), # SCREEN ON VIA SHORTCUT
    (6,1): (0x880022, KEY, (Keycode.BACKSPACE,)),
    (7,1): (0x334466, KEY, (Keycode.HOME,)),

    (0,2): (0x004444, KEY, (Keycode.SHIFT,)),
    (1,2): (0x333333, KEY, (Keycode.SEVEN,)),
    (2,2): (0x333333, KEY, (Keycode.EIGHT,)),
    (3,2): (0x333333, KEY, (Keycode.NINE,)),
    (4,2): (0x008822, KEY, (Keycode.ENTER,)),
    (5,2): (0x884400, KEY, (Keycode.UP_ARROW,)),
    (6,2): (0x880066, KEY, (Keycode.APPLICATION,)), # MENU
    (7,2): (0x664433, KEY, (Keycode.END,)),

    (0,3): (0x002288, KEY, (Keycode.GUI,)), # SUPER
    (1,3): (0x884488, KEY, (Keycode.SPACE,)),
    (2,3): (0x333333, KEY, (Keycode.ZERO,)),
    (3,3): (0x884488, KEY, (Keycode.SPACE,)), # bonus key idk 
    (4,3): (0x884400, KEY, (Keycode.LEFT_ARROW,)),
    (5,3): (0x884400, KEY, (Keycode.DOWN_ARROW,)),
    (6,3): (0x884400, KEY, (Keycode.RIGHT_ARROW,)),
    (7,3): (0x886644, KEY, (Keycode.PAGE_DOWN,))}