Hi,

In current implementation, when I:
1. Press Ctrl
2. Press C
3. Release Ctrl
4. Release C

The event Ctrl-C is *not* fired.

However, this sequence works:
1. Press Ctrl
2. Press C
3. Release C
4. Release Ctrl

Confusing as hell, got me a half an hour to check why sometimes my keyboard shortcuts get fired and sometimes not.

Why are events generated in keyReleased and not keyPressed?
Patch attached.

Regards,
Piotr

--
Piotr Kołaczkowski
senior consultant
Sages Sp. z o.o.
www.sages.com.pl

Index: wtk/src/org/apache/pivot/wtk/Window.java
===================================================================
--- wtk/src/org/apache/pivot/wtk/Window.java	(wersja 1233817)
+++ wtk/src/org/apache/pivot/wtk/Window.java	(kopia robocza)
@@ -1168,8 +1168,8 @@
     }
 
     @Override
-    public boolean keyReleased(int keyCode, Keyboard.KeyLocation keyLocation) {
-        boolean consumed = super.keyReleased(keyCode, keyLocation);
+    public boolean keyPressed(int keyCode, Keyboard.KeyLocation keyLocation) {
+        boolean consumed = super.keyPressed(keyCode, keyLocation);
 
         // Perform any action defined for this keystroke
         // in the active window's action dictionary

Reply via email to