mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-09 09:26:07 +00:00
add in Ctrl-alt-shift-Q to quit, and do better edge detection
This commit is contained in:
@@ -3,15 +3,18 @@ package com.limelight.input;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
|
||||
import com.limelight.gui.StreamFrame;
|
||||
import com.limelight.nvstream.NvConnection;
|
||||
import com.limelight.nvstream.input.KeyboardPacket;
|
||||
|
||||
public class KeyboardHandler implements KeyListener {
|
||||
|
||||
private static KeyboardTranslator translator;
|
||||
private StreamFrame parent;
|
||||
|
||||
public KeyboardHandler(NvConnection conn) {
|
||||
public KeyboardHandler(NvConnection conn, StreamFrame parent) {
|
||||
translator = new KeyboardTranslator(conn);
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -30,6 +33,15 @@ public class KeyboardHandler implements KeyListener {
|
||||
if ((modifiers & KeyEvent.ALT_DOWN_MASK) != 0) {
|
||||
modifier |= KeyboardPacket.MODIFIER_ALT;
|
||||
}
|
||||
|
||||
if ((modifiers & KeyEvent.SHIFT_DOWN_MASK) != 0 &&
|
||||
(modifiers & KeyEvent.ALT_DOWN_MASK) != 0 &&
|
||||
(modifiers & KeyEvent.CTRL_DOWN_MASK) != 0 &&
|
||||
event.getKeyCode() == KeyEvent.VK_Q) {
|
||||
System.out.println("quitting");
|
||||
parent.close();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
translator.sendKeyDown(keyMap, modifier);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user