#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Tue, 12 Feb 2019 10:58:37 +0100
changeset 3636 197a2fbb8c5d
parent 3635 74101a749a34
child 3637 c8fbb7a433e5
#FEATURE by cg class: MenuEditor changed: #processEvent: Accept key
MenuEditor.st
--- a/MenuEditor.st	Mon Jan 14 15:03:35 2019 +0100
+++ b/MenuEditor.st	Tue Feb 12 10:58:37 2019 +0100
@@ -2214,51 +2214,59 @@
      Return true, if I have eaten the event"
 
     <resource: #keyboard (#Delete #BackSpace #Cut #Copy #Paste #CtrlCursorUp #CtrlCursorDown
-			  #CtrlCursorLeft #CtrlCursorRight )>
+                          #CtrlCursorLeft #CtrlCursorRight #Accept)>
 
     |evView rawKey key|
 
     anEvent isKeyPressEvent ifFalse:[^ false].
 
+    key    := anEvent key.
+
     evView := anEvent targetView.
-    evView isNil ifTrue:[ ^ false ].
+    evView isNil ifTrue:[^ false ].
 
     "/ only handle keyboard events for the left item list
     "/ (otherwise, copy-paste would not work in the editFields on the right)
-    (evView isSameOrComponentOf:listOfItemsView) ifFalse:[^ false].
-
-    key    := anEvent key.
+    (evView isSameOrComponentOf:listOfItemsView) ifFalse:[
+        key == #Accept ifTrue:[
+            self accept.
+        ].
+        ^ false
+    ].
+
     rawKey := anEvent rawKey.
 
     (    key == #Delete
      or:[key == #BackSpace
      or:[key == #Cut]]
     ) ifTrue:[
-	self doCut.
-	^ true.
+        self doCut.
+        ^ true.
     ].
 
     key == #Copy  ifTrue:[ self doCopy.  ^ true ].
     key == #Paste ifTrue:[ self doPaste. ^ true ].
 
     (rawKey == #CtrlCursorUp) ifTrue:[
-	self doMoveUp.
-	^ true.
+        self doMoveUp.
+        ^ true.
     ].
     (rawKey == #CtrlCursorDown) ifTrue:[
-	self doMoveDown.
-	^ true.
+        self doMoveDown.
+        ^ true.
     ].
     (rawKey == #CtrlCursorLeft) ifTrue:[
-	self doMoveOut.
-	^ true.
+        self doMoveOut.
+        ^ true.
     ].
     (rawKey == #CtrlCursorRight) ifTrue:[
-	self doMoveInNext.
-	^ true.
+        self doMoveInNext.
+        ^ true.
     ].
 
     ^ false.
+
+    "Modified: / 12-02-2019 / 10:56:08 / Claus Gittinger"
 ! !
 
 !MenuEditor methodsFor:'initialization & release'!