Changeset 1458 for trunk


Ignore:
Timestamp:
11/29/19 15:22:16 (4 years ago)
Author:
bnemhaus
Message:

It was noticed that when logging in, using the ENTER key, this caused the TextItem 'Setting' to get a new line character in it.
The problem was traced back to the fact that multiple guestures where running in response to the single ENTER key.

Both key released and key pressed where being fired.

This change seems to (for reasons we do not understand completely) cause only one gesture to fire. This seems to be achieved because the translator now ignores the actual key char and therefore does not run associated key pressed event (which would have been insert new line).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gio/gesture/ExpediteeKBMGestureTranslator.java

    r1415 r1458  
    22092209                });
    22102210               
    2211                 // Add the ENTER_CHAR_TYPED -> ACTIVATE BUTTON -> FORMAT gesture recogniser
     2211                // Add the ENTER_KEY_HIT -> ACTIVATE BUTTON
    22122212                addTranslator(new InputEventToGestureTranslator(InputType.KBM)
    22132213                {
     
    22202220                                KBMInputEvent kbmEvent = (KBMInputEvent) event;
    22212221                       
     2222                                List<Gesture> ret_gesture = null;
     2223                               
     2224                                if ((kbmEvent.getEventType() == EventType.CHAR_TYPED) && (kbmEvent.getCharTyped() == '\n')) {
     2225                                       
     2226                                        GestureType gestureType = StandardGestureActions.getInstance().gestureType(StandardGestureType.ACTIVATE_BUTTON);
     2227                                        ItemSpecificGestureData data = new ClickGestureData(false);
     2228                                        ret_gesture = Gesture.single(gestureType, data);
     2229                                }
     2230                               
     2231                                return ret_gesture;
     2232                               
     2233                                /*
    22222234                                if (kbmEvent.getKeyDown() != Key.ENTER) {
    22232235                                        return null;
     
    22272239                                ItemSpecificGestureData data = new ClickGestureData(false);
    22282240                                return Gesture.single(gestureType, data);
     2241                                */
     2242                               
    22292243                        }
    22302244                });
Note: See TracChangeset for help on using the changeset viewer.