public static void update()
    {
        for(int i = 0; i < NUM_KEYCODES; i++){
            if (getKey(i) || getKeyDown(i) || getKeyUp(i))
                inputBus.post(new EventKey(i,getKey(i),getKeyDown(i),getKeyUp(i)));
            lastKeys[i] = getKey(i);
        }

        for(int i = 0; i < NUM_MOUSEBUTTONS; i++){
            if (getMouse(i) || getMouseDown(i) || getMouseUp(i))
                inputBus.post(new EventMouse(i,getMouse(i),getMouseUp(i),getMouseDown(i),getMousePosition()));
            lastMouse[i] = getMouse(i);
        }

    }