From: Peter H. <pe...@sy...> - 2007-10-04 14:39:57
|
ha...@li... wrote: > Axel Simon wrote: > The documentation at > http://library.gnome.org/devel/gdk/unstable/gdk-Event-Structures.html#id2919978 > claims > > "guint button; the button which was pressed or released, numbered from 1 to 5. > Normally button 1 is the left mouse button, 2 is the middle button, and 3 is the > right button. On 2-button mice, the middle button can often be simulated by > pressing both mouse buttons together." > > So while I do not use gtk/gtk2hs I suspect that the button index can only reach > up to 5 in the present code. > > That said, it is also apparent that they could easily extend this in future > releases to any guint value. > > So why are MouseButton6 and 7 needed? > >> data MouseButton = LeftButton >> | MiddleButton >> | RightButton >> | MouseButton4 >> | MouseButton5 >> deriving (Eq,Show) > > If you want to be paranoid about crashing, then you would need: > >> data MouseButton = LeftButton >> | MiddleButton >> | RightButton >> | MouseButton4 >> | MouseButton5 >> | MouseButtonUInt Word32 >> deriving (Eq,Show) > That is very possibly correct that buttons 6 and 7 cannot be used now. I have only 5 button mouse with wheel (so plus scroll up and down). So stripping it down to 5 buttons tops is ok for me. But may not be for others (possibly only after gtk gets extended too). I added also 6th and 7th button since my brother has a mouse with 7 (standard) buttons plus a wheel. I do not know if my version of gtk can process the additional buttons. I tested with my mouse only. I'm glad you decided to apply at least the changes for button 4 and 5 though :-D Peter. |