summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodul/src/main/java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java27
1 files changed, 3 insertions, 24 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java
index e42406b0..63bf557a 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LoginWindow.java
@@ -79,24 +79,6 @@ public class LoginWindow extends LoginWindowLayout {
private boolean forceCustomSatellite = false;
- private final KeyEventDispatcher satelliteShiftDispatcher = new KeyEventDispatcher() {
- @Override
- public boolean dispatchKeyEvent(KeyEvent event) {
- int code = event.getKeyCode();
- if (code == KeyEvent.VK_SHIFT) { // shift key is pressed
- int type = event.getID();
- if (type == KeyEvent.KEY_PRESSED) {
- forceCustomSatellite = true;
- event.consume();
- } else if (type == KeyEvent.KEY_RELEASED) {
- forceCustomSatellite = false;
- event.consume();
- }
- }
- return event.isConsumed();
- }
- };
-
public LoginWindow(Frame modalParent) {
// call the constructor of the superclass
super(modalParent);
@@ -175,11 +157,12 @@ public class LoginWindow extends LoginWindowLayout {
}
});
- KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(satelliteShiftDispatcher);
-
btnLogin.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
+ int mods = e.getModifiers();
+ // evaluate if SHIFT was hold during the click
+ forceCustomSatellite = ((mods & ActionEvent.SHIFT_MASK) == ActionEvent.SHIFT_MASK);
doLogin();
}
});
@@ -444,10 +427,6 @@ public class LoginWindow extends LoginWindowLayout {
Config.saveCurrentSession(Session.getSatelliteAddress(), Session.getSatelliteToken(),
Session.getMasterToken());
}
- // Remove the listener for the shift key. (For forcing the satellite selection)
- KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(
- satelliteShiftDispatcher);
-
dispose();
return;
}