1
Index: Sources/Display/Input/X11/mouse_x11.cpp
2
===================================================================
3
RCS file: /var/lib/cvs/Libs/ClanLib-0.6/Sources/Display/Input/X11/mouse_x11.cpp,v
4
retrieving revision 1.11
5
diff -u -r1.11 mouse_x11.cpp
6
--- Sources/Display/Input/X11/mouse_x11.cpp 17 May 2002 08:47:58 -0000 1.11
7
+++ Sources/Display/Input/X11/mouse_x11.cpp 30 Mar 2003 13:09:11 -0000
9
for (int i=0; i<NUM_MOUSE_BUTTONS; i++)
10
buttons[i] = new CL_InputButton_Mouse_XWin();
13
+ on_xevent_slot = CL_XWindow_CompatibleCard::sig_xevent.connect(this, &CL_Mouse_XWin::on_xevent);
16
CL_Mouse_XWin::~CL_Mouse_XWin()
19
for (int i=0; i<NUM_MOUSE_BUTTONS; i++) delete buttons[i];
24
+CL_Mouse_XWin::on_xevent(XEvent& event)
30
+ if (event.xbutton.button == 4)
31
+ CL_Mouse::sig_button_press()(CL_Key(CL_MOUSE_WHEELUP, CL_Key::Pressed, -1, cursor->x, cursor->y));
32
+ else if (event.xbutton.button == 5)
33
+ CL_Mouse::sig_button_press()(CL_Key(CL_MOUSE_WHEELDOWN, CL_Key::Pressed, -1, cursor->x, cursor->y));
37
+ if (event.xbutton.button == 4)
38
+ CL_Mouse::sig_button_release()(CL_Key(CL_MOUSE_WHEELUP, CL_Key::Released, -1, cursor->x, cursor->y));
39
+ else if (event.xbutton.button == 5)
40
+ CL_Mouse::sig_button_release()(CL_Key(CL_MOUSE_WHEELDOWN, CL_Key::Released, -1, cursor->x, cursor->y));
45
CL_InputDevice::InputDeviceType CL_Mouse_XWin::get_type() const
46
Index: Sources/Display/Input/X11/mouse_x11.h
47
===================================================================
48
RCS file: /var/lib/cvs/Libs/ClanLib-0.6/Sources/Display/Input/X11/mouse_x11.h,v
49
retrieving revision 1.3
50
diff -u -r1.3 mouse_x11.h
51
--- Sources/Display/Input/X11/mouse_x11.h 17 May 2002 08:47:59 -0000 1.3
52
+++ Sources/Display/Input/X11/mouse_x11.h 30 Mar 2003 13:09:12 -0000
54
CL_InputButton_Mouse_XWin **buttons;
55
CL_InputCursor_Mouse_XWin *cursor;
56
CL_InputAxis_Mouse_XWin *axes;
57
+ CL_Slot on_xevent_slot;
60
CL_Mouse_XWin(CL_XWindow_CompatibleCard *card);
62
virtual CL_InputCursor *get_cursor(int cursor_num);
64
virtual void keep_alive();
66
+ void on_xevent(XEvent&);