Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00019 * All rights reserved. 00020 * 00021 * Contributor(s): Blender Foundation 00022 * 00023 * ***** END GPL LICENSE BLOCK ***** 00024 */ 00025 00031 /* 00032 * These define have its origin at sgi, where all device defines were written down in device.h. 00033 * Blender copied the conventions quite some, and expanded it with internal new defines (ton) 00034 * 00035 */ 00036 00037 00038 #ifndef WM_EVENT_TYPES_H 00039 #define WM_EVENT_TYPES_H 00040 00041 /* customdata type */ 00042 #define EVT_DATA_TABLET 1 00043 #define EVT_DATA_GESTURE 2 00044 #define EVT_DATA_TIMER 3 00045 #define EVT_DATA_LISTBASE 4 00046 #define EVT_DATA_NDOF_MOTION 5 00047 00048 /* tablet active, matches GHOST_TTabletMode */ 00049 #define EVT_TABLET_NONE 0 00050 #define EVT_TABLET_STYLUS 1 00051 #define EVT_TABLET_ERASER 2 00052 00053 #define MOUSEX 4 00054 #define MOUSEY 5 00055 00056 /* MOUSE : 0x00x */ 00057 #define LEFTMOUSE 1 00058 #define MIDDLEMOUSE 2 00059 #define RIGHTMOUSE 3 00060 #define MOUSEMOVE 4 00061 /* only use if you want user option switch possible */ 00062 #define ACTIONMOUSE 5 00063 #define SELECTMOUSE 6 00064 /* Extra mouse buttons */ 00065 #define BUTTON4MOUSE 7 00066 #define BUTTON5MOUSE 8 00067 /* Extra trackpad gestures */ 00068 #define MOUSEPAN 14 00069 #define MOUSEZOOM 15 00070 #define MOUSEROTATE 16 00071 /* defaults from ghost */ 00072 #define WHEELUPMOUSE 10 00073 #define WHEELDOWNMOUSE 11 00074 /* mapped with userdef */ 00075 #define WHEELINMOUSE 12 00076 #define WHEELOUTMOUSE 13 00077 #define INBETWEEN_MOUSEMOVE 17 00078 00079 00080 /* NDOF (from SpaceNavigator & friends) 00081 These should be kept in sync with GHOST_NDOFManager.h 00082 Ordering matters, exact values do not. */ 00083 00084 #define NDOF_MOTION 400 00085 00086 enum { 00087 // used internally, never sent 00088 NDOF_BUTTON_NONE = NDOF_MOTION, 00089 // these two are available from any 3Dconnexion device 00090 NDOF_BUTTON_MENU, 00091 NDOF_BUTTON_FIT, 00092 // standard views 00093 NDOF_BUTTON_TOP, 00094 NDOF_BUTTON_BOTTOM, 00095 NDOF_BUTTON_LEFT, 00096 NDOF_BUTTON_RIGHT, 00097 NDOF_BUTTON_FRONT, 00098 NDOF_BUTTON_BACK, 00099 // more views 00100 NDOF_BUTTON_ISO1, 00101 NDOF_BUTTON_ISO2, 00102 // 90 degree rotations 00103 NDOF_BUTTON_ROLL_CW, 00104 NDOF_BUTTON_ROLL_CCW, 00105 NDOF_BUTTON_SPIN_CW, 00106 NDOF_BUTTON_SPIN_CCW, 00107 NDOF_BUTTON_TILT_CW, 00108 NDOF_BUTTON_TILT_CCW, 00109 // device control 00110 NDOF_BUTTON_ROTATE, 00111 NDOF_BUTTON_PANZOOM, 00112 NDOF_BUTTON_DOMINANT, 00113 NDOF_BUTTON_PLUS, 00114 NDOF_BUTTON_MINUS, 00115 // general-purpose buttons 00116 NDOF_BUTTON_1, 00117 NDOF_BUTTON_2, 00118 NDOF_BUTTON_3, 00119 NDOF_BUTTON_4, 00120 NDOF_BUTTON_5, 00121 NDOF_BUTTON_6, 00122 NDOF_BUTTON_7, 00123 NDOF_BUTTON_8, 00124 NDOF_BUTTON_9, 00125 NDOF_BUTTON_10, 00126 NDOF_LAST 00127 }; 00128 00129 00130 /* SYSTEM : 0x01xx */ 00131 #define INPUTCHANGE 0x0103 /* input connected or disconnected */ 00132 #define WINDEACTIVATE 0x0104 /* window is deactivated, focus lost */ 00133 00134 #define TIMER 0x0110 /* timer event, passed on to all queues */ 00135 #define TIMER0 0x0111 /* timer event, slot for internal use */ 00136 #define TIMER1 0x0112 /* timer event, slot for internal use */ 00137 #define TIMER2 0x0113 /* timer event, slot for internal use */ 00138 #define TIMERJOBS 0x0114 /* timer event, jobs system */ 00139 #define TIMERAUTOSAVE 0x0115 /* timer event, autosave */ 00140 #define TIMERREPORT 0x0116 /* timer event, reports */ 00141 #define TIMERF 0x011F /* last timer */ 00142 00143 /* test whether the event is timer event */ 00144 #define ISTIMER(event) (event >= TIMER && event <= TIMERF) 00145 00146 00147 /* standard keyboard */ 00148 #define AKEY 'a' 00149 #define BKEY 'b' 00150 #define CKEY 'c' 00151 #define DKEY 'd' 00152 #define EKEY 'e' 00153 #define FKEY 'f' 00154 #define GKEY 'g' 00155 #define HKEY 'h' 00156 #define IKEY 'i' 00157 #define JKEY 'j' 00158 #define KKEY 'k' 00159 #define LKEY 'l' 00160 #define MKEY 'm' 00161 #define NKEY 'n' 00162 #define OKEY 'o' 00163 #define PKEY 'p' 00164 #define QKEY 'q' 00165 #define RKEY 'r' 00166 #define SKEY 's' 00167 #define TKEY 't' 00168 #define UKEY 'u' 00169 #define VKEY 'v' 00170 #define WKEY 'w' 00171 #define XKEY 'x' 00172 #define YKEY 'y' 00173 #define ZKEY 'z' 00174 00175 #define ZEROKEY '0' 00176 #define ONEKEY '1' 00177 #define TWOKEY '2' 00178 #define THREEKEY '3' 00179 #define FOURKEY '4' 00180 #define FIVEKEY '5' 00181 #define SIXKEY '6' 00182 #define SEVENKEY '7' 00183 #define EIGHTKEY '8' 00184 #define NINEKEY '9' 00185 00186 #define CAPSLOCKKEY 211 00187 00188 #define LEFTCTRLKEY 212 00189 #define LEFTALTKEY 213 00190 #define RIGHTALTKEY 214 00191 #define RIGHTCTRLKEY 215 00192 #define RIGHTSHIFTKEY 216 00193 #define LEFTSHIFTKEY 217 00194 00195 #define ESCKEY 218 00196 #define TABKEY 219 00197 #define RETKEY 220 00198 #define SPACEKEY 221 00199 #define LINEFEEDKEY 222 00200 #define BACKSPACEKEY 223 00201 #define DELKEY 224 00202 #define SEMICOLONKEY 225 00203 #define PERIODKEY 226 00204 #define COMMAKEY 227 00205 #define QUOTEKEY 228 00206 #define ACCENTGRAVEKEY 229 00207 #define MINUSKEY 230 00208 #define SLASHKEY 232 00209 #define BACKSLASHKEY 233 00210 #define EQUALKEY 234 00211 #define LEFTBRACKETKEY 235 00212 #define RIGHTBRACKETKEY 236 00213 00214 #define LEFTARROWKEY 137 00215 #define DOWNARROWKEY 138 00216 #define RIGHTARROWKEY 139 00217 #define UPARROWKEY 140 00218 00219 #define PAD0 150 00220 #define PAD1 151 00221 #define PAD2 152 00222 #define PAD3 153 00223 #define PAD4 154 00224 #define PAD5 155 00225 #define PAD6 156 00226 #define PAD7 157 00227 #define PAD8 158 00228 #define PAD9 159 00229 00230 00231 #define PADPERIOD 199 00232 #define PADSLASHKEY 161 00233 #define PADASTERKEY 160 00234 00235 #define PADMINUS 162 00236 #define PADENTER 163 00237 #define PADPLUSKEY 164 00238 00239 #define F1KEY 300 00240 #define F2KEY 301 00241 #define F3KEY 302 00242 #define F4KEY 303 00243 #define F5KEY 304 00244 #define F6KEY 305 00245 #define F7KEY 306 00246 #define F8KEY 307 00247 #define F9KEY 308 00248 #define F10KEY 309 00249 #define F11KEY 310 00250 #define F12KEY 311 00251 #define F13KEY 312 00252 #define F14KEY 313 00253 #define F15KEY 314 00254 #define F16KEY 315 00255 #define F17KEY 316 00256 #define F18KEY 317 00257 #define F19KEY 318 00258 00259 #define PAUSEKEY 165 00260 #define INSERTKEY 166 00261 #define HOMEKEY 167 00262 #define PAGEUPKEY 168 00263 #define PAGEDOWNKEY 169 00264 #define ENDKEY 170 00265 00266 #define UNKNOWNKEY 171 00267 #define OSKEY 172 00268 #define GRLESSKEY 173 00269 00270 // XXX: are these codes ok? 00271 #define MEDIAPLAY 174 00272 #define MEDIASTOP 175 00273 #define MEDIAFIRST 176 00274 #define MEDIALAST 177 00275 00276 /* for event checks */ 00277 /* only used for KM_TEXTINPUT, so assume that we want all user-inputtable ascii codes included */ 00278 #define ISTEXTINPUT(event) (event >=' ' && event <=255) 00279 00280 /* test whether the event is a key on the keyboard */ 00281 #define ISKEYBOARD(event) (event >=' ' && event <=320) 00282 00283 /* test whether the event is a modifier key */ 00284 #define ISKEYMODIFIER(event) ((event >= LEFTCTRLKEY && event <= LEFTSHIFTKEY) || event == OSKEY) 00285 00286 /* test whether the event is a mouse button */ 00287 #define ISMOUSE(event) (event >= LEFTMOUSE && event <= MOUSEROTATE) 00288 00289 /* test whether the event is tweak event */ 00290 #define ISTWEAK(event) (event >= EVT_TWEAK_L && event <= EVT_GESTURE) 00291 00292 /* test whether the event is a NDOF event */ 00293 #define ISNDOF(event) (event >= NDOF_MOTION && event < NDOF_LAST) 00294 00295 /* test whether event type is acceptable as hotkey, excluding modifiers */ 00296 #define ISHOTKEY(event) ((ISKEYBOARD(event) || ISMOUSE(event) || ISNDOF(event)) && event!=ESCKEY && !(event>=LEFTCTRLKEY && event<=LEFTSHIFTKEY) && !(event>=UNKNOWNKEY && event<=GRLESSKEY)) 00297 00298 /* **************** BLENDER GESTURE EVENTS (0x5000) **************** */ 00299 00300 #define EVT_ACTIONZONE_AREA 20480 00301 #define EVT_ACTIONZONE_REGION 20481 00302 00303 /* tweak events, for L M R mousebuttons */ 00304 #define EVT_TWEAK_L 20482 00305 #define EVT_TWEAK_M 20483 00306 #define EVT_TWEAK_R 20484 00307 /* tweak events for action or select mousebutton */ 00308 #define EVT_TWEAK_A 20485 00309 #define EVT_TWEAK_S 20486 00310 00311 #define EVT_GESTURE 20496 00312 00313 /* value of tweaks and line gestures, note, KM_ANY (-1) works for this case too */ 00314 #define EVT_GESTURE_N 1 00315 #define EVT_GESTURE_NE 2 00316 #define EVT_GESTURE_E 3 00317 #define EVT_GESTURE_SE 4 00318 #define EVT_GESTURE_S 5 00319 #define EVT_GESTURE_SW 6 00320 #define EVT_GESTURE_W 7 00321 #define EVT_GESTURE_NW 8 00322 /* value of corner gestures */ 00323 #define EVT_GESTURE_N_E 9 00324 #define EVT_GESTURE_N_W 10 00325 #define EVT_GESTURE_E_N 11 00326 #define EVT_GESTURE_E_S 12 00327 #define EVT_GESTURE_S_E 13 00328 #define EVT_GESTURE_S_W 14 00329 #define EVT_GESTURE_W_S 15 00330 #define EVT_GESTURE_W_N 16 00331 00332 /* **************** OTHER BLENDER EVENTS ********************* */ 00333 00334 /* event->type */ 00335 #define EVT_FILESELECT 0x5020 00336 00337 /* event->val */ 00338 #define EVT_FILESELECT_OPEN 1 00339 #define EVT_FILESELECT_FULL_OPEN 2 00340 #define EVT_FILESELECT_EXEC 3 00341 #define EVT_FILESELECT_CANCEL 4 00342 #define EVT_FILESELECT_EXTERNAL_CANCEL 5 00343 00344 /* event->type */ 00345 #define EVT_BUT_OPEN 0x5021 00346 #define EVT_MODAL_MAP 0x5022 00347 #define EVT_DROP 0x5023 00348 #define EVT_BUT_CANCEL 0x5024 00349 00350 /* NOTE: these defines are saved in keymap files, do not change values but just add new ones */ 00351 #define GESTURE_MODAL_CANCEL 1 00352 #define GESTURE_MODAL_CONFIRM 2 00353 00354 #define GESTURE_MODAL_SELECT 3 00355 #define GESTURE_MODAL_DESELECT 4 00356 00357 #define GESTURE_MODAL_NOP 5 /* circle select when no mouse button is pressed */ 00358 00359 #define GESTURE_MODAL_CIRCLE_ADD 6 /* circle sel: larger brush */ 00360 #define GESTURE_MODAL_CIRCLE_SUB 7 /* circle sel: smaller brush */ 00361 00362 #define GESTURE_MODAL_BEGIN 8 /* border select/straight line, activate, use release to detect which button */ 00363 00364 #define GESTURE_MODAL_IN 9 00365 #define GESTURE_MODAL_OUT 10 00366 00367 00368 #endif /* WM_EVENT_TYPES_H */ 00369