Skip to content

shift, ctl, alt? #1

Description

@catfoobar

Great project.

Context, C coder fumbling with python : ) Was wondering what the intention was for the single shift, ctl and alt buttons. Assumed it would work as a 'normal' keyboard, but was surprised to find pressing any of them by themselves cause the code to break. A NameError (below, pressed 'i', then 'l_shift') :

Change in state detected on pin board.A3 to off (last value was on )
Change in state detected on pin board.A3 to on (last value was off )
current_key_comb (False, False, True, False, False, False, False)
Sending text: 12
Change in state detected on pin board.D5 to off (last value was on )
Change in state detected on pin board.D5 to on (last value was off )
current_key_comb (False, False, False, False, True, False, False)
Sending text: 226
Traceback (most recent call last):
  File "code.py", line 401, in <module>
  File "code.py", line 370, in update
  File "code.py", line 383, in onstatechange
  File "code.py", line 297, in send_chord
NameError: local variable referenced before assignment

Code done running.

Adafruit CircuitPython 9.2.7 on 2025-04-01; Adafruit Feather ESP32-S3 TFT with ESP32S3
>>> [A

Without thinking too hard about the code, I put a key_buf = '' (null) above the offending line, which avoids the crash, but still seems to not do anything expected. Yes. I still do need to decompose the code to understand it better. Was wondering if there is any more documentation somewhere that might help?

Also, noted some commented out code ( kb = Keyboard(usb_hid.devices near the front, and three instances of calls to send_kb_report()). Were these simply to disable keyboard function via USB? So the device just remains in portable/practice mode?

Again, great project. And congrats for winning the contest. I really believe chorded keyboards are going to be big deal (eventually) - it's a perfect application for wearing display glasses, which are getting better and better to code on. Being able to use a portable pocket keyboard to touch type is why I duplicated your project. I have prescription lenses inside the glasses and touch type with a normal keyboard on my lap. But I don't want to drag a normal keyboard around with me all the time. This is perfect. Would be happy to contribute once I understand more about what's going on : )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions