public  void pollControls() {
        while (mainState != KeyState.NONE) {
            Set<String> keyNames = KEYS.keySet();
            for (String str : keyNames) {
                if(mainState.getKeyCode() == KEYS.get(str)) {
                    keyStates[KEYS.get(str)] = mainState.getState();
                }
            }
            setMainState();
        }

    }