Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distinguish between virtual input and human input #461

Open
freakzbc opened this issue Apr 10, 2024 · 1 comment
Open

Distinguish between virtual input and human input #461

freakzbc opened this issue Apr 10, 2024 · 1 comment
Milestone

Comments

@freakzbc
Copy link

Key sources include real human keyboard input and java.awt.Robot virtual input. How do I distinguish them when using keyListener?

I tried to distinguish by these properties, but they are the same in both cases.

    public void nativeKeyPressed(NativeKeyEvent e) {

        System.out.println("--------------------------");
        System.out.println(e.getKeyCode());
        System.out.println(e.getKeyLocation());
        System.out.println(e.getWhen());
        System.out.println(e.getKeyChar());
        System.out.println(e.getSource());
        System.out.println(e.getID());
        System.out.println(e.getModifiers());
        System.out.println(e.getRawCode());
        System.out.println("==========================");
    }
@kwhat
Copy link
Owner

kwhat commented Apr 26, 2024

This has been resolved upstream and will be available in 2.3

@kwhat kwhat added this to the 2.3.0 milestone Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants