Skip to content

Allow inserting keystrokes #33

@gkdada

Description

@gkdada

Can you allow inserting keystrokes (so as to release a GetKey() call)?

The scenario is like this: The main routine issues a GetKey() call and is waiting for input. A goroutine meanwhile is counting on a timer and wants to end the wait when the timout occurs. At this point, how do I 'cancel' the GetKey() call? The solution I found (and it works fine) is to have a PushKey(ev KeyEvent) method added to keyboard_common.go that only does inputComm <- ev. This will push a default keystroke in and completes the GetKey() which can then return.

Did you leave out this functionality because of the security implications? If so, what is the alternative solution to cancel a GetKey() blocking call?

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