]> git.tdb.fi Git - libs/gui.git/blob - source/input/mouse.h
Normalize device axis ranges to [-1, 1]
[libs/gui.git] / source / input / mouse.h
1 /* $Id$
2
3 This file is part of libmspgbase
4 Copyright © 2007 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GBASE_MOUSE_H_
9 #define MSP_GBASE_MOUSE_H_
10
11 #include "device.h"
12 #include "../gbase/window.h"
13
14 namespace Msp {
15 namespace Input {
16
17 /**
18 Mouse device.  Receives events from a Graphics::Window and presents them in a
19 uniform way.
20
21 Note: Y axis grows upwards.
22 */
23 class Mouse: public Device
24 {
25 private:
26         Graphics::Window &window;
27
28 public:
29         Mouse(Graphics::Window &);
30         virtual std::string get_button_name(unsigned) const;
31         virtual std::string get_axis_name(unsigned) const;
32 private:
33         void button_press(int, int, unsigned, unsigned);
34         void button_release(int, int, unsigned, unsigned);
35         void pointer_motion(int, int);
36 };
37
38 } // namespace Input
39 } // namespace Msp
40
41 #endif