diff options
| author | Jim Blandy | 1992-10-03 00:01:09 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-10-03 00:01:09 +0000 |
| commit | a1867fb1592e16f2fac4333cda5d53fcc9262b87 (patch) | |
| tree | bf242d6a9e939309a8d5a60bdc4a975a2c6e2f13 /src | |
| parent | ac501cd970e09514b7435b9aacdc9a054cde38fe (diff) | |
| download | emacs-a1867fb1592e16f2fac4333cda5d53fcc9262b87.tar.gz emacs-a1867fb1592e16f2fac4333cda5d53fcc9262b87.zip | |
* termhooks.h (struct input_event): Doc fix.
(NUM_MOUSE_BUTTONS): New constant.
(click_modifier): New modifier.
(NUM_MODIFIER_COMBOS): Removed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/termhooks.h | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/src/termhooks.h b/src/termhooks.h index 10d303100c4..695c5a316e5 100644 --- a/src/termhooks.h +++ b/src/termhooks.h | |||
| @@ -101,7 +101,9 @@ struct input_event { | |||
| 101 | was typed. | 101 | was typed. |
| 102 | .timestamp gives a timestamp (in | 102 | .timestamp gives a timestamp (in |
| 103 | milliseconds) for the keystroke. */ | 103 | milliseconds) for the keystroke. */ |
| 104 | mouse_click, /* The button number is in .code. | 104 | mouse_click, /* The button number is in .code; it must |
| 105 | be >= 0 and < NUM_MOUSE_BUTTONS, defined | ||
| 106 | below. | ||
| 105 | .modifiers holds the state of the | 107 | .modifiers holds the state of the |
| 106 | modifier keys. | 108 | modifier keys. |
| 107 | .x and .y give the mouse position, | 109 | .x and .y give the mouse position, |
| @@ -153,25 +155,38 @@ struct input_event { | |||
| 153 | unsigned long timestamp; | 155 | unsigned long timestamp; |
| 154 | }; | 156 | }; |
| 155 | 157 | ||
| 158 | /* This is used in keyboard.c, to tell how many buttons we will need | ||
| 159 | to track the positions of. */ | ||
| 160 | #define NUM_MOUSE_BUTTONS (5) | ||
| 161 | |||
| 156 | /* Bits in the modifiers member of the input_event structure. | 162 | /* Bits in the modifiers member of the input_event structure. |
| 157 | Note that reorder_modifiers assumes that the bits are in canonical | 163 | Note that reorder_modifiers assumes that the bits are in canonical |
| 158 | order. */ | 164 | order. |
| 165 | |||
| 166 | The modifiers applied to mouse clicks are rather ornate. The | ||
| 167 | window-system-specific code should store mouse clicks with | ||
| 168 | up_modifier or down_modifier set; the window-system independent | ||
| 169 | code turns all up_modifier events into either drag_modifier or | ||
| 170 | click_modifier. The click_modifier has no written representation | ||
| 171 | in the names of the symbols used as event heads, but it does appear | ||
| 172 | in the Qevent_symbol_components property of the event heads. */ | ||
| 159 | enum { | 173 | enum { |
| 160 | up_modifier = 1, /* This only applies to mouse buttons. */ | 174 | up_modifier = 1, /* Only used on mouse buttons - always |
| 175 | turned into a click or a drag modifier | ||
| 176 | before lisp code sees the event. */ | ||
| 161 | alt_modifier = 2, /* Under X, the XK_Alt_[LR] keysyms. */ | 177 | alt_modifier = 2, /* Under X, the XK_Alt_[LR] keysyms. */ |
| 162 | ctrl_modifier = 4, | 178 | ctrl_modifier = 4, |
| 163 | hyper_modifier= 8, /* Under X, the XK_Hyper_[LR] keysyms. */ | 179 | hyper_modifier= 8, /* Under X, the XK_Hyper_[LR] keysyms. */ |
| 164 | meta_modifier = 16, /* Under X, the XK_Meta_[LR] keysyms. */ | 180 | meta_modifier = 16, /* Under X, the XK_Meta_[LR] keysyms. */ |
| 165 | shift_modifier= 32, | 181 | shift_modifier= 32, |
| 166 | super_modifier= 64, /* Under X, the XK_Super_[LR] keysyms. */ | 182 | super_modifier= 64, /* Under X, the XK_Super_[LR] keysyms. */ |
| 167 | down_modifier = 128, /* The window-system independent code finds | 183 | down_modifier = 128, /* Only used on mouse buttons. */ |
| 168 | it handy to have this modifier, but | 184 | drag_modifier = 256, /* This is never used in the event |
| 169 | it is ignored in the event queue. */ | 185 | queue; it's only used internally by |
| 170 | drag_modifier = 256, /* Same as down_modifier. */ | 186 | the window-system-independent code. */ |
| 187 | click_modifier= 512, /* See drag_modifier. */ | ||
| 171 | last_modifier /* This should always be one more than the | 188 | last_modifier /* This should always be one more than the |
| 172 | highest modifier bit defined. */ | 189 | highest modifier bit defined. */ |
| 173 | }; | 190 | }; |
| 174 | 191 | ||
| 175 | #define NUM_MODIFIER_COMBOS ((last_modifier-1) << 1) | ||
| 176 | |||
| 177 | #endif | 192 | #endif |