+
Skip to content

Writing a string does not work with a single button press #8

@Charlie22911

Description

@Charlie22911

Working on my first project involving any degree of code, and also my first github post; I'm looking to use this as way to insert strings with a single button press (for example, game server commands).
Using "kbdLayout.write('This is a test!')" for example causes it to insert that string when the trinket boots, and subsequently locks up on the next button press.

Using Mu serial monitor I see:

main.py output:
Traceback (most recent call last):
File "main.py", line 44, in
File "miniKbdButtons.py", line 53, in update
File "main.py", line 28, in buttonDownCallback
File "adafruit_hid/keyboard.py", line 100, in press
File "adafruit_hid/keyboard.py", line 135, in _add_keycode_to_report
File "adafruit_hid/keycode.py", line 311, in modifier_bit
TypeError: unsupported types for le: 'int', 'NoneType'

I'm not really sure how to approach this, any help would be appreciated.

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

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载