aboutsummaryrefslogtreecommitdiffstats
path: root/java/com/tigervnc/vncviewer/DesktopWindow.java
diff options
context:
space:
mode:
Diffstat (limited to 'java/com/tigervnc/vncviewer/DesktopWindow.java')
-rw-r--r--java/com/tigervnc/vncviewer/DesktopWindow.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/java/com/tigervnc/vncviewer/DesktopWindow.java b/java/com/tigervnc/vncviewer/DesktopWindow.java
index 5f9ee1a3..7621af50 100644
--- a/java/com/tigervnc/vncviewer/DesktopWindow.java
+++ b/java/com/tigervnc/vncviewer/DesktopWindow.java
@@ -437,12 +437,19 @@ class DesktopWindow extends JPanel implements Runnable, MouseListener,
}
// Handle the key-typed event.
- public void keyTyped(KeyEvent e) {}
+ public void keyTyped(KeyEvent e) {
+ int keysym = UnicodeToKeysym.translate(e.getKeyChar());
+ if (!cc.viewer.viewOnly.getValue())
+ if (!e.isActionKey() && keysym > 0)
+ cc.writeKeyEvent(e, keysym);
+ }
// Handle the key-released event.
public void keyReleased(KeyEvent e) {
+ int keysym = UnicodeToKeysym.translate(e.getKeyChar());
if (!cc.viewer.viewOnly.getValue())
- cc.writeKeyEvent(e);
+ if (e.isActionKey() || keysym < 0)
+ cc.writeKeyEvent(e);
}
// Handle the key-pressed event.
@@ -499,8 +506,10 @@ class DesktopWindow extends JPanel implements Runnable, MouseListener,
return;
}
}
+ int keysym = UnicodeToKeysym.translate(e.getKeyChar());
if (!cc.viewer.viewOnly.getValue())
- cc.writeKeyEvent(e);
+ if (e.isActionKey() || keysym < 0)
+ cc.writeKeyEvent(e);
}
////////////////////////////////////////////////////////////////////