خرید بک لینک

Vote count: 0

I want an array of all VK values so that I can ask if a key is pressed

public class Input implements KeyListener{

    boolean[] keyPressed = new boolean [1000];

    @Override
    public void keyPressed(KeyEvent arg0) {
        keyPressed[arg0.getKeyCode()] = true;
    }

    @Override
    public void keyReleased(KeyEvent arg0) {
        keyPressed[ arg0.getKeyCode() ] = false;
    }

    @Override
    public void keyTyped(KeyEvent arg0) {}

}

I will eventually make the class thread safe and use it concurrently.

What is the max and min VK values? Is the a limits.h style way I can set it dynamically ?

asked 39 secs ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 5 تير 1395 ساعت: 4:00

صفحه بندی