Skip to content

Pause key gives wrong code. setLock(.) doesn't work in setup() #26

@pensigma

Description

@pensigma

I'm using V1.0.9 and when I press the Pause key it gives me 6 (PS2_KEY_L_SHIFT) instead of 5 (PS2_KEY_PAUSE).
In PS2KeyAdvanced.cpp line 674 I see
return PS2_KEY_PAUSE + _FUNCTION;

Is there a reason for the + _FUNCTION that results in 5 + 1 = 6?

Also, if I put in setup() the following:

keyboard.begin( . );
keyboard.setLock(PS2_LOCK_NUM);

When the Arduino is initially powered up, the Num Lock doesn't turn on until I press a key on the keyboard.
I also tried setLock(PS2_LOCK_NUM) and resetKey() inside loop() but they don't work either until a key has been pressed on the keyboard.
resetKey() can also cause a hang unless a key has been pressed beforehand.
I can replicate the issue by turning the Arduino off then 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