| 1 | /* Copyright 2000 Kjetil S. Matheussen |
| 2 | |
| 3 | This program is free software; you can redistribute it and/or |
| 4 | modify it under the terms of the GNU General Public License |
| 5 | as published by the Free Software Foundation; either version 2 |
| 6 | of the License, or (at your option) any later version. |
| 7 | |
| 8 | This program is distributed in the hope that it will be useful, |
| 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | GNU General Public License for more details. |
| 12 | |
| 13 | You should have received a copy of the GNU General Public License |
| 14 | along with this program; if not, write to the Free Software |
| 15 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
| 16 | |
| 17 | |
| 18 | #ifndef TRACKER_EVENTS_DEFINE |
| 19 | #define TRACKER_EVENTS_DEFINE 1 |
| 20 | |
| 21 | #include "keyboard_sub_ids.h" |
| 22 | |
| 23 | /* Event IDs: */ |
| 24 | |
| 25 | #define TR_MOUSEMOVE 0 |
| 26 | #define TR_LEFTMOUSEDOWN 1 |
| 27 | #define TR_LEFTMOUSEUP 2 |
| 28 | #define TR_MIDDLEMOUSEDOWN 3 |
| 29 | #define TR_MIDDLEMOUSEUP 4 |
| 30 | #define TR_RIGHTMOUSEDOWN 5 |
| 31 | #define TR_RIGHTMOUSEUP 6 |
| 32 | |
| 33 | #define TR_KEYBOARD 7 |
| 34 | |
| 35 | #define TR_WINDOWMOVE 8 |
| 36 | #define TR_WINDOWRESIZE 9 |
| 37 | #define TR_WINDOWVISIBLE 10 |
| 38 | #define TR_WINDOWNOTVISIBLE 11 |
| 39 | #define TR_WINDOWCLOSE 12 |
| 40 | |
| 41 | #define TR_KEYBOARDUP 13 |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | /* KEYSWITCHes: */ |
| 47 | |
| 48 | #define EVENT_LEFTCTRL (1<<EVENT_CTRL_L) |
| 49 | #define EVENT_RIGHTCTRL (1<<EVENT_CTRL_R) |
| 50 | #define EVENT_CAPSLOCK (1<<EVENT_CAPS) |
| 51 | #define EVENT_LEFTSHIFT (1<<EVENT_SHIFT_L) |
| 52 | #define EVENT_RIGHTSHIFT (1<<EVENT_SHIFT_R) |
| 53 | #define EVENT_LEFTALT (1<<EVENT_ALT_L) |
| 54 | #define EVENT_RIGHTALT (1<<EVENT_ALT_R) |
| 55 | |
| 56 | #define EVENT_LEFTEXTRA1 (1<<EVENT_EXTRA_L) /*Amiga: Amiga, PC: "Meta"/Windows key */ |
| 57 | #define EVENT_RIGHTEXTRA1 (1<<EVENT_EXTRA_R) /*Amiga: Amiga, PC: "Meta"/Windows key */ |
| 58 | #define EVENT_UP2 (1<<EVENT_UP) /* Up key, i.e. key is released. */ |
| 59 | |
| 60 | #define NoSwitch(a) (a==0) |
| 61 | #define LeftCtrl(a) (a&EVENT_LEFTCTRL) |
| 62 | #define RightCtrl(a) (a&EVENT_RIGHTCTRL) |
| 63 | #define CapsLock(a) (a&EVENT_CAPSLOCK) |
| 64 | #define LeftShift(a) (a&EVENT_LEFTSHIFT) |
| 65 | #define RightShift(a) (a&EVENT_RIGHTSHIFT) |
| 66 | #define AnyShift(a) (LeftShift(a) | RightShift(a)) |
| 67 | #define LeftAlt(a) (a&EVENT_LEFTALT) |
| 68 | #define RightAlt(a) (a&EVENT_RIGHTALT) |
| 69 | #define LeftExtra(a) (a&EVENT_LEFTEXTRA1) |
| 70 | #define RightExtra(a) (a&EVENT_RIGHTEXTRA1) |
| 71 | |
| 72 | #define OnlyLeftShift(a) (a==EVENT_LEFTSHIFT) |
| 73 | #define OnlyLeftAlt(a) (a==EVENT_LEFTALT) |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | struct TEvent{ |
| 79 | int ID; |
| 80 | int SubID; |
| 81 | uint32_t keyswitch; |
| 82 | int x; |
| 83 | int y; |
| 84 | }; |
| 85 | |
| 86 | struct TEventFIFO{ |
| 87 | struct TEventFIFO *next; |
| 88 | struct TEvent t; |
| 89 | }; |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | struct WrapFuncList{ |
| 95 | char *funcname; |
| 96 | void *func; |
| 97 | }; |
| 98 | |
| 99 | |
| 100 | #endif |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 |