JanLunge / pog

A Kmk firmware flashing and configuration tool
https://pog.heaper.de/
MIT License
255 stars 17 forks source link

Can't understand Coormap setup #2

Closed filippoitaliano closed 6 months ago

filippoitaliano commented 1 year ago

Hi,

I'm trying to setup a custom hand-wired 80% keyboard using pog. I already have kmk installed on my Raspberry Pi Pico. I have a basic custom code.py with the keymap.

print("Starting")

import board

from kmk.kmk_keyboard import KMKKeyboard
from kmk.keys import KC
from kmk.scanners import DiodeOrientation

keyboard = KMKKeyboard()

keyboard.col_pins = (board.GP21, board.GP20, board.GP19, board.GP18, board.GP17, board.GP16, board.GP15, board.GP14, board.GP13, board.GP12, board.GP11, board.GP10, board.GP9, board.GP8, board.GP7, board.GP6)
keyboard.row_pins = (board.GP0, board.GP1, board.GP2, board.GP3, board.GP4, board.GP5)
keyboard.diode_orientation = DiodeOrientation.COL2ROW

keyboard.keymap = [
    [
        KC.ESCAPE, KC.F1, KC.F2, KC.F3, KC.F4, KC.F5, KC.F6, KC.F7, KC.F8, KC.F9, KC.F10, KC.F11, KC.F12, KC.NO, KC.NO, KC.DELETE,
        KC.GRAVE, KC.N1, KC.N2, KC.N3, KC.N4, KC.N5, KC.N6, KC.N7, KC.N8, KC.N9, KC.N0, KC.MINUS, KC.EQUAL, KC.NO, KC.BKDL, KC.HOME,
        KC.TAB, KC.NO, KC.Q, KC.W, KC.E, KC.R, KC.T, KC.Y, KC.U, KC.I, KC.O, KC.P, KC.LBRACKET, KC.RBRACKET, KC.BSLASH, KC.PGUP, KC.NO,
        KC.LOCKING_CAPS, KC.A, KC.S, KC.D, KC.F, KC.G, KC.H, KC.J, KC.K, KC.L, KC.SCOLON, KC.QUOTE, KC.NO, KC.ENTER, KC.PGDOWN,
        KC.LSHIFT, KC.NO, KC.Z, KC.X, KC.C, KC.V, KC.B, KC.N, KC.M, KC.COMMA, KC.DOT, KC.SLASH, KC.NO, KC.RSHIFT, KC.UP, KC.END,
        KC.LCTRL, KC.LGUI, KC.LALT, KC.NO, KC.NO, KC.NO, KC.SPACE, KC.NO, KC.NO, KC.NO, KC.RALT, KC.RESET, KC.RCTRL, KC.LEFT, KC.DOWN, KC.RIGHT,
    ],
]

if __name__ == '__main__':          
    keyboard.go()

Now, when I follow the setup wizard everything goes fine until the Coordmap step. After I flash the coordmap finder, if I try to press the keys, focusing the text area, nothing happens. I mean, if I press letters or numbers I can see the pressed character in the text area but nothing changes in the coord_mapping preview. If I press the other special keys nothing happens at all, except that the keystrokes are actually performed and handled by the os (i.e. if i press F11 on macos, the volume rises). So the keyboard is still using his original keymap but pog cannot detect the coordmap to complete the setup.

I have the same behaviour on win and macos, using the latest release available and also running pog in dev mode.

Thank you in advance for the help!!

filippoitaliano commented 1 year ago

@JanLunge hei! This project is very cool and useful. What are your plans? Are you still maintaining it?

JanLunge commented 1 year ago

Hey yes I am still planning on making this a more intuitive tool. Currently the bottleneck is more on the side of the documentation which I didnt yet complete.

Now to your issue. Seems like you used an already configured kmk board. Pog will not overwrite the main.py or code.py file so technically pog code never got executed on your controller.

The coord mapping assistant gets triggered by a an entry in the pog.json which gets loaded in the pog.py which in turn is used in a config on the kb.py and that file then is used in the main.py but your main.py doesnt include pog right now.

Try it with backing up your config to your pc and configuring it with pog while the drive is empty (you can keep the kmk folder)