Bug #1273

shift enter doesn't works on shops on mac

Added by vl about 4 years ago. Updated over 3 years ago.

Status:Closed Start date:04/18/2011
Priority:Normal Due date:
Assignee:vl % Done:

100%

Category:OS: Mac
Target version:-

Description

In a shop, when you sell your object with SHIFT+ENTER, it's expected
to have an immediate sell, not re-sell to other players. However,
SHIFT+ENTER do a re-sell. The only way to have a direct sell (thus
destroying the object) is by clicking its button on the screen.

History

#1 Updated by vl about 4 years ago

Suggested patch, like on unix event emitter, we give the key modifier to the char event:

diff -r 2b5a5812d746 code/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.cpp
--- a/code/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.cpp Mon Mar 21 10:29:22 2011 -0500
+++ b/code/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.cpp Mon Apr 18 10:01:42 2011 +0200
@@ -359,7 +359,7 @@
                // push the key press event to the event server
                server->postEvent(new NLMISC::CEventKeyDown(
                        virtualKeycodeToNelKey([event keyCode]),
-                       modifierFlagsToNelKeyButton([event modifierFlags]),
+                       modifiers,
                        [event isARepeat] == NO, this));

                // if this was a text event
@@ -372,7 +372,7 @@

                        // push the text event to event server as well
                        server->postEvent(new NLMISC::CEventChar(
-                               ucstr[0], NLMISC::noKeyButton, this));
+                               ucstr[0], modifiers, this));
                }
                break;
        }
@@ -381,7 +381,7 @@
                // push the key release event to the event server
                server->postEvent(new NLMISC::CEventKeyUp(
                        virtualKeycodeToNelKey([event keyCode]),
-                       modifierFlagsToNelKeyButton([event modifierFlags]), this));
+                       modifiers, this));
                break;
        }
        case NSFlagsChanged:break;

#2 Updated by rti about 4 years ago

The first and the last change are obviously ok. I just forgot to update those lines when i added the local var modifiers.

The second change, which should be the one which really fixes the issue, is interesting. I would have never thought that the merchant window listens to CEventChar. I would have expected it to listen to CEventKeyDown / CEventKeyUp and thought CEventChar events are only used for real text input like chatting. But well, seems like I was wrong. So I think the patch is good. :)

#3 Updated by vl about 4 years ago

The issue #1137 was the same for linux and the patch is also almost the same. I'll commit it tomorrow.

#4 Updated by rti about 4 years ago

Ok. Thanks for fixing my bugs :)

#5 Updated by vl about 4 years ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Applied in changeset r1563.

#6 Updated by vl about 4 years ago

Applied in changeset r1563.

#7 Updated by sfb over 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF