You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by no...@apache.org on 2012/01/20 12:11:40 UTC

svn commit: r1233865 - /pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java

Author: noelgrandin
Date: Fri Jan 20 11:11:40 2012
New Revision: 1233865

URL: http://svn.apache.org/viewvc?rev=1233865&view=rev
Log:
switch from using keyReleased to using keyPressed so that this sequence:
Press Ctrl, Press C, Release Ctrl, Release C
correctly triggers the Ctrl-C action

Modified:
    pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java?rev=1233865&r1=1233864&r2=1233865&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java Fri Jan 20 11:11:40 2012
@@ -1168,8 +1168,12 @@ public class Window extends Container {
     }
 
     @Override
-    public boolean keyReleased(int keyCode, Keyboard.KeyLocation keyLocation) {
-        boolean consumed = super.keyReleased(keyCode, keyLocation);
+    public boolean keyPressed(int keyCode, Keyboard.KeyLocation keyLocation) {
+        /* Use keyPressed rather than keyReleased other this sequence:
+         * Press Ctrl, Press C, Release Ctrl, Release C
+         * will not trigger the Ctrl-C action.
+         */
+        boolean consumed = super.keyPressed(keyCode, keyLocation);
 
         // Perform any action defined for this keystroke
         // in the active window's action dictionary