Skip to content

Modifier keys are set incorrectly on ::press() when _keyReport.keys is full. #5

Open
@ZDBioHazard

Description

@ZDBioHazard

If Keyboard.press() is called with a key that implies a modifier, when _keyReport.keys[] is full, the modifier bit will still be set on _keyReport.modifiers, but sendReport() never gets called for that key, leaving the modifier pressed but not reported until the next possible ::press(), which may or may not be after a ::release() that clears the modifier.

Also, if you ::press() two capital letters and ::release() one, the modifier will be cleared even though the second key is still pressed. Maybe there should be some documentation discouraging the use of ::press() with shifted keys? You shouldn't need them outside of string printing, which you should be using ::write() for anyway.

I was hoping I would have a chance to fix it so it doesn't set the modifier unless the key can be pressed, but I may not have time for a little while.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions