private void pollEvents()
    {
        while(Keyboard.next())
        {
            char c = Keyboard.getEventCharacter();
            int k = Keyboard.getEventKey();
            boolean b = Keyboard.getEventKeyState();
            if(k == Keyboard.KEY_F10 && b)
                mainFrame.setAlwaysOnTop(!mainFrame.isAlwaysOnTop());
            UI.onKeyEvent(c, k, b);
            for(int index1 = 0;index1<inputProcessors.size();index1++)
            {
                InputProcessor proc = inputProcessors.get(index1);
                proc.onKeyEvent(c, k, b);
            }
        }
        while(Mouse.next())
        {
            int mx = Mouse.getX();
            int my = Mouse.getY();
            int button = Mouse.getEventButton();
            boolean b = Mouse.getEventButtonState();
            UI.onMouseEvent(cursorX,cursorY,button,b);
            for(int index1 = 0;index1<inputProcessors.size();index1++)
            {
                InputProcessor proc = inputProcessors.get(index1);
                proc.onMouseEvent(mx, my, button, b);
            }
        }
        for(int index1 = 0;index1<inputProcessors.size();index1++)
        {
            InputProcessor proc = inputProcessors.get(index1);
            proc.onUpdate();
        }
        pollControllerData();
    }