1 /* This file is part of the Pangolin Project.
2  * http://github.com/stevenlovegrove/Pangolin
3  *
4  * Copyright (c) 2013 Steven Lovegrove
5  *
6  * Permission is hereby granted, free of charge, to any person
7  * obtaining a copy of this software and associated documentation
8  * files (the "Software"), to deal in the Software without
9  * restriction, including without limitation the rights to use,
10  * copy, modify, merge, publish, distribute, sublicense, and/or sell
11  * copies of the Software, and to permit persons to whom the
12  * Software is furnished to do so, subject to the following
13  * conditions:
14  *
15  * The above copyright notice and this permission notice shall be
16  * included in all copies or substantial portions of the Software.
17  *
18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
20  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
22  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  */
27 
28 #pragma once
29 
30 namespace pangolin
31 {
32 
33 // Supported Key modifiers for GlobalKeyPressCallback.
34 // e.g. PANGO_CTRL + 'r', PANGO_SPECIAL + PANGO_KEY_RIGHT, etc.
35 const int PANGO_SPECIAL = 128;
36 const int PANGO_CTRL = -96;
37 const int PANGO_OPTN = 132;
38 
39 // Ordinary keys
40 const int PANGO_KEY_TAB       = 9;
41 const int PANGO_KEY_ESCAPE    = 27;
42 
43 // Special Keys (same as GLUT_ defines)
44 const int PANGO_KEY_F1        = 1;
45 const int PANGO_KEY_F2        = 2;
46 const int PANGO_KEY_F3        = 3;
47 const int PANGO_KEY_F4        = 4;
48 const int PANGO_KEY_F5        = 5;
49 const int PANGO_KEY_F6        = 6;
50 const int PANGO_KEY_F7        = 7;
51 const int PANGO_KEY_F8        = 8;
52 const int PANGO_KEY_F9        = 9;
53 const int PANGO_KEY_F10       = 10;
54 const int PANGO_KEY_F11       = 11;
55 const int PANGO_KEY_F12       = 12;
56 const int PANGO_KEY_LEFT      = 100;
57 const int PANGO_KEY_UP        = 101;
58 const int PANGO_KEY_RIGHT     = 102;
59 const int PANGO_KEY_DOWN      = 103;
60 const int PANGO_KEY_PAGE_UP   = 104;
61 const int PANGO_KEY_PAGE_DOWN = 105;
62 const int PANGO_KEY_HOME      = 106;
63 const int PANGO_KEY_END	      = 107;
64 const int PANGO_KEY_INSERT	  = 108;
65 
66 enum MouseButton
67 {
68     MouseButtonLeft = 1,
69     MouseButtonMiddle = 2,
70     MouseButtonRight = 4,
71     MouseWheelUp = 8,
72     MouseWheelDown = 16,
73     MouseWheelRight = 32,
74     MouseWheelLeft = 64,
75 };
76 
77 enum KeyModifier
78 {
79     KeyModifierShift = 1<<16,
80     KeyModifierCtrl  = 1<<17,
81     KeyModifierAlt   = 1<<18,
82     KeyModifierCmd   = 1<<19,
83     KeyModifierFnc   = 1<<20
84 };
85 
86 enum InputSpecial
87 {
88     InputSpecialScroll,
89     InputSpecialZoom,
90     InputSpecialRotate,
91     InputSpecialTablet
92 };
93 
94 }
95