From: <re...@us...> - 2004-12-21 23:27:10
|
Update of /cvsroot/crystal/CS/plugins/video/canvas/xwindow In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17260/plugins/video/canvas/xwindow Modified Files: xwindow.cpp Log Message: res made the following changes: - Added enum for mouse button constants (csmbXXX). - Added support for mouse wheel and Xbuttons (e.g. thumb buttons on some mice) to Win32 port. - Fixed handling of high mouse buttons in X window plugin. It read beyond the end of an array for buttons > 5. Index: xwindow.cpp =================================================================== RCS file: /cvsroot/crystal/CS/plugins/video/canvas/xwindow/xwindow.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- xwindow.cpp 8 Oct 2004 12:08:30 -0000 1.42 +++ xwindow.cpp 21 Dec 2004 23:27:00 -0000 1.43 @@ -478,7 +478,8 @@ bool csXWindow::HandleEvent (iEvent &Event) { - static int button_mapping[6] = {0, 1, 3, 2, 4, 5}; + static int buttonMapping[6] = {0, 1, 3, 2}; + const int buttonMapCount = sizeof (buttonMapping) / sizeof (int) XEvent event; KeySym xKey; utf32_char csKeyRaw = 0, csKeyCooked = 0; @@ -522,11 +523,13 @@ } break; case ButtonPress: - EventOutlet->Mouse (button_mapping [event.xbutton.button], + EventOutlet->Mouse (event.xbutton.button < buttonMapCount ? + buttonMapping [event.xbutton.button] : event.xbutton.button, true, event.xbutton.x, event.xbutton.y); break; case ButtonRelease: - EventOutlet->Mouse (button_mapping [event.xbutton.button], + EventOutlet->Mouse (event.xbutton.button < buttonMapCount ? + buttonMapping [event.xbutton.button] : event.xbutton.button, false, event.xbutton.x, event.xbutton.y); break; case MotionNotify: |