GNOME Bugzilla – Bug 668688
Add symbolic names for left, right and middle buttons
Last modified: 2012-01-27 08:50:17 UTC
Created attachment 206125 [details] [review] Add symbolic names for left, right and middle buttons Add GDK_BUTTON_LEFT, GDK_BUTTON_MIDDLE and GDK_BUTTON_RIGHT macros and use them everywhere in gtk source code. I've split the patch into several commits (once per file) as suggested by Company. Attached here as a single file to make it easier.
I'm not entirely sure encoding left/right is going to be a good plan. how's the layout for a left-handed pointer? if we're in the business of symbolic names, I'd go for _BUTTON_PRIMARY, _BUTTON_MIDDLE and _BUTTON_SECONDARY. in any case, I'll have to create a bug for Clutter as well. :-)
http://developer.qt.nokia.com/doc/qt-4.8/qt.html#MouseButton-enum http://msdn.microsoft.com/en-us/library/windows/desktop/ms646260%28v=vs.85%29.aspx http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-mouseevents 3 examples of using left/middle/right Any reason why we should not follow the rest of the world? :)
Apple: http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSEvent_Class/Reference/Reference.html though Apple has event types for left (up and down), and right (up and down), pointer events, and has no middle - just scroll. (In reply to comment #2) > Any reason why we should not follow the rest of the world? :) like my mother says, "if the rest of the world jumps off a cliff...". ;-) anyway, I'm more concerned of what happens on X11 when a left-handed user configures her mouse to be left-handed: do we flip the layout as well, so that the left-of-the-user button will still be the primary button, and the right-of-the-user will be the secondary button? because if we don't, we'd look pretty damn stupid.
all above, though, is not to be considered in any way, shape, or form a blocking comment: symbolic constants are fine by me.
Comment on attachment 206125 [details] [review] Add symbolic names for left, right and middle buttons I guess that means Carlos gets to decide - he wrote the code after all. So feel free to push the patchset with any name you prefer.
Given X11 flips the button numbers, so the usual 1 2 3 right-handed mapping turns into 3 2 1 on a left-handed setup, I see the left/middle/right naming prone to confusions. Even though there's prior art in some enums wrt RTL/LTR, I'm not so sure we should keep doing this, so primary/secondary makes most sense
we could just pull a Microsoft/Apple/Whatever, and decide that we don't support left-handed pointing devices in the API naming. :-)
Comment on attachment 206125 [details] [review] Add symbolic names for left, right and middle buttons Pushed using primary/secondary as suggested by ebassi and garnacho.