private void registerShiftListener(){
        KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(new KeyEventDispatcher() {
            @Override
            public boolean dispatchKeyEvent(KeyEvent e) {
                synchronized (KeyChecker.class){
                    switch (e.getID()){
                        case KeyEvent.KEY_PRESSED:
                            if(e.getKeyCode()==KeyEvent.VK_SHIFT){
                                KeyChecker.shiftPressed = true;
                            }
                            break;
                        case KeyEvent.KEY_RELEASED:
                            if(e.getKeyCode()==KeyEvent.VK_SHIFT){
                                KeyChecker.shiftPressed = false;
                            }
                            break;
                    }
                    return false;
                }
            }
        });
    }