Keyboard.poll(); Mouse.poll();
    private void initDisplay() {        //create the Display.        DisplayMode mode = getValidDisplayMode(width, height, bpp, frq);        if (null == mode) { throw new JmeException("Bad display mode"); }        try {            if (fs) {                Display.setDisplayMode(mode);                Window.create(title, bpp, alphaBits, depthBits, stencilBits,                        samples);            } else {                int x, y;                x = (Toolkit.getDefaultToolkit().getScreenSize().width - width) / 2;                y = (Toolkit.getDefaultToolkit().getScreenSize().height - height) / 2;                Window.create(title, x, y, width, height, bpp, alphaBits,                        depthBits, stencilBits, samples);            }        } catch (Exception e) {            //System.exit(1);            LoggingSystem.getLogger().log(Level.SEVERE, "Cannot create window");            LoggingSystem.getLogger().throwing(this.getClass().toString(),                    "initDisplay()", e);            throw new Error("Cannot create window: " + e.getMessage());        }    }