public static void update() {
        for (int i = 0; i < NUM_KEYCODES; i++)
            lastKeys[i] = getKey(i);

        for (int i = 0; i < NUM_MOUSEBUTTONS; i++)
            lastMouse[i] = getMouse(i);
    }