root / input.c @ c05c7a73
History | View | Annotate | Download (8.1 kB)
1 | 8f0056b7 | Paolo Bonzini | /*
|
---|---|---|---|
2 | 8f0056b7 | Paolo Bonzini | * QEMU System Emulator
|
3 | 8f0056b7 | Paolo Bonzini | *
|
4 | 8f0056b7 | Paolo Bonzini | * Copyright (c) 2003-2008 Fabrice Bellard
|
5 | 8f0056b7 | Paolo Bonzini | *
|
6 | 8f0056b7 | Paolo Bonzini | * Permission is hereby granted, free of charge, to any person obtaining a copy
|
7 | 8f0056b7 | Paolo Bonzini | * of this software and associated documentation files (the "Software"), to deal
|
8 | 8f0056b7 | Paolo Bonzini | * in the Software without restriction, including without limitation the rights
|
9 | 8f0056b7 | Paolo Bonzini | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10 | 8f0056b7 | Paolo Bonzini | * copies of the Software, and to permit persons to whom the Software is
|
11 | 8f0056b7 | Paolo Bonzini | * furnished to do so, subject to the following conditions:
|
12 | 8f0056b7 | Paolo Bonzini | *
|
13 | 8f0056b7 | Paolo Bonzini | * The above copyright notice and this permission notice shall be included in
|
14 | 8f0056b7 | Paolo Bonzini | * all copies or substantial portions of the Software.
|
15 | 8f0056b7 | Paolo Bonzini | *
|
16 | 8f0056b7 | Paolo Bonzini | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17 | 8f0056b7 | Paolo Bonzini | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18 | 8f0056b7 | Paolo Bonzini | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
19 | 8f0056b7 | Paolo Bonzini | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20 | 8f0056b7 | Paolo Bonzini | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21 | 8f0056b7 | Paolo Bonzini | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22 | 8f0056b7 | Paolo Bonzini | * THE SOFTWARE.
|
23 | 8f0056b7 | Paolo Bonzini | */
|
24 | 8f0056b7 | Paolo Bonzini | |
25 | 8f0056b7 | Paolo Bonzini | #include "sysemu.h" |
26 | 8f0056b7 | Paolo Bonzini | #include "net.h" |
27 | 8f0056b7 | Paolo Bonzini | #include "monitor.h" |
28 | 8f0056b7 | Paolo Bonzini | #include "console.h" |
29 | 8f0056b7 | Paolo Bonzini | #include "qjson.h" |
30 | 8f0056b7 | Paolo Bonzini | |
31 | 8f0056b7 | Paolo Bonzini | static QEMUPutKBDEvent *qemu_put_kbd_event;
|
32 | 8f0056b7 | Paolo Bonzini | static void *qemu_put_kbd_event_opaque; |
33 | 03a23a85 | Gerd Hoffmann | static QTAILQ_HEAD(, QEMUPutLEDEntry) led_handlers = QTAILQ_HEAD_INITIALIZER(led_handlers);
|
34 | 6fef28ee | Anthony Liguori | static QTAILQ_HEAD(, QEMUPutMouseEntry) mouse_handlers =
|
35 | 6fef28ee | Anthony Liguori | QTAILQ_HEAD_INITIALIZER(mouse_handlers); |
36 | 7e581fb3 | Anthony Liguori | static NotifierList mouse_mode_notifiers =
|
37 | 7e581fb3 | Anthony Liguori | NOTIFIER_LIST_INITIALIZER(mouse_mode_notifiers); |
38 | 8f0056b7 | Paolo Bonzini | |
39 | 8f0056b7 | Paolo Bonzini | void qemu_add_kbd_event_handler(QEMUPutKBDEvent *func, void *opaque) |
40 | 8f0056b7 | Paolo Bonzini | { |
41 | 8f0056b7 | Paolo Bonzini | qemu_put_kbd_event_opaque = opaque; |
42 | 8f0056b7 | Paolo Bonzini | qemu_put_kbd_event = func; |
43 | 8f0056b7 | Paolo Bonzini | } |
44 | 8f0056b7 | Paolo Bonzini | |
45 | 7e581fb3 | Anthony Liguori | static void check_mode_change(void) |
46 | 7e581fb3 | Anthony Liguori | { |
47 | 7e581fb3 | Anthony Liguori | static int current_is_absolute, current_has_absolute; |
48 | 7e581fb3 | Anthony Liguori | int is_absolute;
|
49 | 7e581fb3 | Anthony Liguori | int has_absolute;
|
50 | 7e581fb3 | Anthony Liguori | |
51 | 7e581fb3 | Anthony Liguori | is_absolute = kbd_mouse_is_absolute(); |
52 | 7e581fb3 | Anthony Liguori | has_absolute = kbd_mouse_has_absolute(); |
53 | 7e581fb3 | Anthony Liguori | |
54 | 7e581fb3 | Anthony Liguori | if (is_absolute != current_is_absolute ||
|
55 | 7e581fb3 | Anthony Liguori | has_absolute != current_has_absolute) { |
56 | 7e581fb3 | Anthony Liguori | notifier_list_notify(&mouse_mode_notifiers); |
57 | 7e581fb3 | Anthony Liguori | } |
58 | 7e581fb3 | Anthony Liguori | |
59 | 7e581fb3 | Anthony Liguori | current_is_absolute = is_absolute; |
60 | 7e581fb3 | Anthony Liguori | current_has_absolute = has_absolute; |
61 | 7e581fb3 | Anthony Liguori | } |
62 | 7e581fb3 | Anthony Liguori | |
63 | 8f0056b7 | Paolo Bonzini | QEMUPutMouseEntry *qemu_add_mouse_event_handler(QEMUPutMouseEvent *func, |
64 | 8f0056b7 | Paolo Bonzini | void *opaque, int absolute, |
65 | 8f0056b7 | Paolo Bonzini | const char *name) |
66 | 8f0056b7 | Paolo Bonzini | { |
67 | 6fef28ee | Anthony Liguori | QEMUPutMouseEntry *s; |
68 | 6fef28ee | Anthony Liguori | static int mouse_index = 0; |
69 | 8f0056b7 | Paolo Bonzini | |
70 | 8f0056b7 | Paolo Bonzini | s = qemu_mallocz(sizeof(QEMUPutMouseEntry));
|
71 | 8f0056b7 | Paolo Bonzini | |
72 | 8f0056b7 | Paolo Bonzini | s->qemu_put_mouse_event = func; |
73 | 8f0056b7 | Paolo Bonzini | s->qemu_put_mouse_event_opaque = opaque; |
74 | 8f0056b7 | Paolo Bonzini | s->qemu_put_mouse_event_absolute = absolute; |
75 | 8f0056b7 | Paolo Bonzini | s->qemu_put_mouse_event_name = qemu_strdup(name); |
76 | 6fef28ee | Anthony Liguori | s->index = mouse_index++; |
77 | 8f0056b7 | Paolo Bonzini | |
78 | 6fef28ee | Anthony Liguori | QTAILQ_INSERT_TAIL(&mouse_handlers, s, node); |
79 | 8f0056b7 | Paolo Bonzini | |
80 | 7e581fb3 | Anthony Liguori | check_mode_change(); |
81 | 7e581fb3 | Anthony Liguori | |
82 | 8f0056b7 | Paolo Bonzini | return s;
|
83 | 8f0056b7 | Paolo Bonzini | } |
84 | 8f0056b7 | Paolo Bonzini | |
85 | 6fef28ee | Anthony Liguori | void qemu_activate_mouse_event_handler(QEMUPutMouseEntry *entry)
|
86 | 8f0056b7 | Paolo Bonzini | { |
87 | 6fef28ee | Anthony Liguori | QTAILQ_REMOVE(&mouse_handlers, entry, node); |
88 | 6fef28ee | Anthony Liguori | QTAILQ_INSERT_HEAD(&mouse_handlers, entry, node); |
89 | 8f0056b7 | Paolo Bonzini | |
90 | 6fef28ee | Anthony Liguori | check_mode_change(); |
91 | 6fef28ee | Anthony Liguori | } |
92 | 8f0056b7 | Paolo Bonzini | |
93 | 6fef28ee | Anthony Liguori | void qemu_remove_mouse_event_handler(QEMUPutMouseEntry *entry)
|
94 | 6fef28ee | Anthony Liguori | { |
95 | 6fef28ee | Anthony Liguori | QTAILQ_REMOVE(&mouse_handlers, entry, node); |
96 | 8f0056b7 | Paolo Bonzini | |
97 | 8f0056b7 | Paolo Bonzini | qemu_free(entry->qemu_put_mouse_event_name); |
98 | 8f0056b7 | Paolo Bonzini | qemu_free(entry); |
99 | 7e581fb3 | Anthony Liguori | |
100 | 7e581fb3 | Anthony Liguori | check_mode_change(); |
101 | 8f0056b7 | Paolo Bonzini | } |
102 | 8f0056b7 | Paolo Bonzini | |
103 | 03a23a85 | Gerd Hoffmann | QEMUPutLEDEntry *qemu_add_led_event_handler(QEMUPutLEDEvent *func, |
104 | 03a23a85 | Gerd Hoffmann | void *opaque)
|
105 | 03a23a85 | Gerd Hoffmann | { |
106 | 03a23a85 | Gerd Hoffmann | QEMUPutLEDEntry *s; |
107 | 03a23a85 | Gerd Hoffmann | |
108 | 03a23a85 | Gerd Hoffmann | s = qemu_mallocz(sizeof(QEMUPutLEDEntry));
|
109 | 03a23a85 | Gerd Hoffmann | |
110 | 03a23a85 | Gerd Hoffmann | s->put_led = func; |
111 | 03a23a85 | Gerd Hoffmann | s->opaque = opaque; |
112 | 03a23a85 | Gerd Hoffmann | QTAILQ_INSERT_TAIL(&led_handlers, s, next); |
113 | 03a23a85 | Gerd Hoffmann | return s;
|
114 | 03a23a85 | Gerd Hoffmann | } |
115 | 03a23a85 | Gerd Hoffmann | |
116 | 03a23a85 | Gerd Hoffmann | void qemu_remove_led_event_handler(QEMUPutLEDEntry *entry)
|
117 | 03a23a85 | Gerd Hoffmann | { |
118 | 03a23a85 | Gerd Hoffmann | if (entry == NULL) |
119 | 03a23a85 | Gerd Hoffmann | return;
|
120 | 03a23a85 | Gerd Hoffmann | QTAILQ_REMOVE(&led_handlers, entry, next); |
121 | 03a23a85 | Gerd Hoffmann | qemu_free(entry); |
122 | 03a23a85 | Gerd Hoffmann | } |
123 | 03a23a85 | Gerd Hoffmann | |
124 | 8f0056b7 | Paolo Bonzini | void kbd_put_keycode(int keycode) |
125 | 8f0056b7 | Paolo Bonzini | { |
126 | 8f0056b7 | Paolo Bonzini | if (qemu_put_kbd_event) {
|
127 | 8f0056b7 | Paolo Bonzini | qemu_put_kbd_event(qemu_put_kbd_event_opaque, keycode); |
128 | 8f0056b7 | Paolo Bonzini | } |
129 | 8f0056b7 | Paolo Bonzini | } |
130 | 8f0056b7 | Paolo Bonzini | |
131 | 03a23a85 | Gerd Hoffmann | void kbd_put_ledstate(int ledstate) |
132 | 03a23a85 | Gerd Hoffmann | { |
133 | 03a23a85 | Gerd Hoffmann | QEMUPutLEDEntry *cursor; |
134 | 03a23a85 | Gerd Hoffmann | |
135 | 03a23a85 | Gerd Hoffmann | QTAILQ_FOREACH(cursor, &led_handlers, next) { |
136 | 03a23a85 | Gerd Hoffmann | cursor->put_led(cursor->opaque, ledstate); |
137 | 03a23a85 | Gerd Hoffmann | } |
138 | 03a23a85 | Gerd Hoffmann | } |
139 | 03a23a85 | Gerd Hoffmann | |
140 | 8f0056b7 | Paolo Bonzini | void kbd_mouse_event(int dx, int dy, int dz, int buttons_state) |
141 | 8f0056b7 | Paolo Bonzini | { |
142 | 6fef28ee | Anthony Liguori | QEMUPutMouseEntry *entry; |
143 | 8f0056b7 | Paolo Bonzini | QEMUPutMouseEvent *mouse_event; |
144 | 8f0056b7 | Paolo Bonzini | void *mouse_event_opaque;
|
145 | 8f0056b7 | Paolo Bonzini | int width;
|
146 | 8f0056b7 | Paolo Bonzini | |
147 | 6fef28ee | Anthony Liguori | if (QTAILQ_EMPTY(&mouse_handlers)) {
|
148 | 8f0056b7 | Paolo Bonzini | return;
|
149 | 8f0056b7 | Paolo Bonzini | } |
150 | 8f0056b7 | Paolo Bonzini | |
151 | 6fef28ee | Anthony Liguori | entry = QTAILQ_FIRST(&mouse_handlers); |
152 | 6fef28ee | Anthony Liguori | |
153 | 6fef28ee | Anthony Liguori | mouse_event = entry->qemu_put_mouse_event; |
154 | 6fef28ee | Anthony Liguori | mouse_event_opaque = entry->qemu_put_mouse_event_opaque; |
155 | 8f0056b7 | Paolo Bonzini | |
156 | 8f0056b7 | Paolo Bonzini | if (mouse_event) {
|
157 | 8f0056b7 | Paolo Bonzini | if (graphic_rotate) {
|
158 | 6fef28ee | Anthony Liguori | if (entry->qemu_put_mouse_event_absolute)
|
159 | 8f0056b7 | Paolo Bonzini | width = 0x7fff;
|
160 | 8f0056b7 | Paolo Bonzini | else
|
161 | 8f0056b7 | Paolo Bonzini | width = graphic_width - 1;
|
162 | 8f0056b7 | Paolo Bonzini | mouse_event(mouse_event_opaque, |
163 | 6fef28ee | Anthony Liguori | width - dy, dx, dz, buttons_state); |
164 | 8f0056b7 | Paolo Bonzini | } else
|
165 | 8f0056b7 | Paolo Bonzini | mouse_event(mouse_event_opaque, |
166 | 6fef28ee | Anthony Liguori | dx, dy, dz, buttons_state); |
167 | 8f0056b7 | Paolo Bonzini | } |
168 | 8f0056b7 | Paolo Bonzini | } |
169 | 8f0056b7 | Paolo Bonzini | |
170 | 8f0056b7 | Paolo Bonzini | int kbd_mouse_is_absolute(void) |
171 | 8f0056b7 | Paolo Bonzini | { |
172 | 6fef28ee | Anthony Liguori | if (QTAILQ_EMPTY(&mouse_handlers)) {
|
173 | 8f0056b7 | Paolo Bonzini | return 0; |
174 | 6fef28ee | Anthony Liguori | } |
175 | 8f0056b7 | Paolo Bonzini | |
176 | 6fef28ee | Anthony Liguori | return QTAILQ_FIRST(&mouse_handlers)->qemu_put_mouse_event_absolute;
|
177 | 8f0056b7 | Paolo Bonzini | } |
178 | 8f0056b7 | Paolo Bonzini | |
179 | eb2e259d | Anthony Liguori | int kbd_mouse_has_absolute(void) |
180 | eb2e259d | Anthony Liguori | { |
181 | eb2e259d | Anthony Liguori | QEMUPutMouseEntry *entry; |
182 | eb2e259d | Anthony Liguori | |
183 | eb2e259d | Anthony Liguori | QTAILQ_FOREACH(entry, &mouse_handlers, node) { |
184 | eb2e259d | Anthony Liguori | if (entry->qemu_put_mouse_event_absolute) {
|
185 | eb2e259d | Anthony Liguori | return 1; |
186 | eb2e259d | Anthony Liguori | } |
187 | eb2e259d | Anthony Liguori | } |
188 | eb2e259d | Anthony Liguori | |
189 | eb2e259d | Anthony Liguori | return 0; |
190 | eb2e259d | Anthony Liguori | } |
191 | eb2e259d | Anthony Liguori | |
192 | 8f0056b7 | Paolo Bonzini | static void info_mice_iter(QObject *data, void *opaque) |
193 | 8f0056b7 | Paolo Bonzini | { |
194 | 8f0056b7 | Paolo Bonzini | QDict *mouse; |
195 | 8f0056b7 | Paolo Bonzini | Monitor *mon = opaque; |
196 | 8f0056b7 | Paolo Bonzini | |
197 | 8f0056b7 | Paolo Bonzini | mouse = qobject_to_qdict(data); |
198 | 1aaee43c | Anthony Liguori | monitor_printf(mon, "%c Mouse #%" PRId64 ": %s%s\n", |
199 | 8f0056b7 | Paolo Bonzini | (qdict_get_bool(mouse, "current") ? '*' : ' '), |
200 | 1aaee43c | Anthony Liguori | qdict_get_int(mouse, "index"), qdict_get_str(mouse, "name"), |
201 | 1aaee43c | Anthony Liguori | qdict_get_bool(mouse, "absolute") ? " (absolute)" : ""); |
202 | 8f0056b7 | Paolo Bonzini | } |
203 | 8f0056b7 | Paolo Bonzini | |
204 | 8f0056b7 | Paolo Bonzini | void do_info_mice_print(Monitor *mon, const QObject *data) |
205 | 8f0056b7 | Paolo Bonzini | { |
206 | 8f0056b7 | Paolo Bonzini | QList *mice_list; |
207 | 8f0056b7 | Paolo Bonzini | |
208 | 8f0056b7 | Paolo Bonzini | mice_list = qobject_to_qlist(data); |
209 | 8f0056b7 | Paolo Bonzini | if (qlist_empty(mice_list)) {
|
210 | 8f0056b7 | Paolo Bonzini | monitor_printf(mon, "No mouse devices connected\n");
|
211 | 8f0056b7 | Paolo Bonzini | return;
|
212 | 8f0056b7 | Paolo Bonzini | } |
213 | 8f0056b7 | Paolo Bonzini | |
214 | 8f0056b7 | Paolo Bonzini | qlist_iter(mice_list, info_mice_iter, mon); |
215 | 8f0056b7 | Paolo Bonzini | } |
216 | 8f0056b7 | Paolo Bonzini | |
217 | 8f0056b7 | Paolo Bonzini | /**
|
218 | 8f0056b7 | Paolo Bonzini | * do_info_mice(): Show VM mice information
|
219 | 8f0056b7 | Paolo Bonzini | *
|
220 | 8f0056b7 | Paolo Bonzini | * Each mouse is represented by a QDict, the returned QObject is a QList of
|
221 | 8f0056b7 | Paolo Bonzini | * all mice.
|
222 | 8f0056b7 | Paolo Bonzini | *
|
223 | 8f0056b7 | Paolo Bonzini | * The mouse QDict contains the following:
|
224 | 8f0056b7 | Paolo Bonzini | *
|
225 | 8f0056b7 | Paolo Bonzini | * - "name": mouse's name
|
226 | 8f0056b7 | Paolo Bonzini | * - "index": mouse's index
|
227 | 8f0056b7 | Paolo Bonzini | * - "current": true if this mouse is receiving events, false otherwise
|
228 | 1aaee43c | Anthony Liguori | * - "absolute": true if the mouse generates absolute input events
|
229 | 8f0056b7 | Paolo Bonzini | *
|
230 | 8f0056b7 | Paolo Bonzini | * Example:
|
231 | 8f0056b7 | Paolo Bonzini | *
|
232 | 1aaee43c | Anthony Liguori | * [ { "name": "QEMU Microsoft Mouse", "index": 0, "current": false, "absolute": false },
|
233 | 1aaee43c | Anthony Liguori | * { "name": "QEMU PS/2 Mouse", "index": 1, "current": true, "absolute": true } ]
|
234 | 8f0056b7 | Paolo Bonzini | */
|
235 | 8f0056b7 | Paolo Bonzini | void do_info_mice(Monitor *mon, QObject **ret_data)
|
236 | 8f0056b7 | Paolo Bonzini | { |
237 | 8f0056b7 | Paolo Bonzini | QEMUPutMouseEntry *cursor; |
238 | 8f0056b7 | Paolo Bonzini | QList *mice_list; |
239 | 6fef28ee | Anthony Liguori | int current;
|
240 | 8f0056b7 | Paolo Bonzini | |
241 | 8f0056b7 | Paolo Bonzini | mice_list = qlist_new(); |
242 | 8f0056b7 | Paolo Bonzini | |
243 | 6fef28ee | Anthony Liguori | if (QTAILQ_EMPTY(&mouse_handlers)) {
|
244 | 8f0056b7 | Paolo Bonzini | goto out;
|
245 | 8f0056b7 | Paolo Bonzini | } |
246 | 8f0056b7 | Paolo Bonzini | |
247 | 6fef28ee | Anthony Liguori | current = QTAILQ_FIRST(&mouse_handlers)->index; |
248 | 6fef28ee | Anthony Liguori | |
249 | 6fef28ee | Anthony Liguori | QTAILQ_FOREACH(cursor, &mouse_handlers, node) { |
250 | 8f0056b7 | Paolo Bonzini | QObject *obj; |
251 | 1aaee43c | Anthony Liguori | obj = qobject_from_jsonf("{ 'name': %s,"
|
252 | 1aaee43c | Anthony Liguori | " 'index': %d,"
|
253 | 1aaee43c | Anthony Liguori | " 'current': %i,"
|
254 | 1aaee43c | Anthony Liguori | " 'absolute': %i }",
|
255 | 8f0056b7 | Paolo Bonzini | cursor->qemu_put_mouse_event_name, |
256 | 6fef28ee | Anthony Liguori | cursor->index, |
257 | 1aaee43c | Anthony Liguori | cursor->index == current, |
258 | 1aaee43c | Anthony Liguori | !!cursor->qemu_put_mouse_event_absolute); |
259 | 8f0056b7 | Paolo Bonzini | qlist_append_obj(mice_list, obj); |
260 | 8f0056b7 | Paolo Bonzini | } |
261 | 8f0056b7 | Paolo Bonzini | |
262 | 8f0056b7 | Paolo Bonzini | out:
|
263 | 8f0056b7 | Paolo Bonzini | *ret_data = QOBJECT(mice_list); |
264 | 8f0056b7 | Paolo Bonzini | } |
265 | 8f0056b7 | Paolo Bonzini | |
266 | 8f0056b7 | Paolo Bonzini | void do_mouse_set(Monitor *mon, const QDict *qdict) |
267 | 8f0056b7 | Paolo Bonzini | { |
268 | 8f0056b7 | Paolo Bonzini | QEMUPutMouseEntry *cursor; |
269 | 8f0056b7 | Paolo Bonzini | int index = qdict_get_int(qdict, "index"); |
270 | 6fef28ee | Anthony Liguori | int found = 0; |
271 | 8f0056b7 | Paolo Bonzini | |
272 | 6fef28ee | Anthony Liguori | if (QTAILQ_EMPTY(&mouse_handlers)) {
|
273 | 8f0056b7 | Paolo Bonzini | monitor_printf(mon, "No mouse devices connected\n");
|
274 | 8f0056b7 | Paolo Bonzini | return;
|
275 | 8f0056b7 | Paolo Bonzini | } |
276 | 8f0056b7 | Paolo Bonzini | |
277 | 6fef28ee | Anthony Liguori | QTAILQ_FOREACH(cursor, &mouse_handlers, node) { |
278 | 6fef28ee | Anthony Liguori | if (cursor->index == index) {
|
279 | 6fef28ee | Anthony Liguori | found = 1;
|
280 | 6fef28ee | Anthony Liguori | qemu_activate_mouse_event_handler(cursor); |
281 | 6fef28ee | Anthony Liguori | break;
|
282 | 6fef28ee | Anthony Liguori | } |
283 | 8f0056b7 | Paolo Bonzini | } |
284 | 8f0056b7 | Paolo Bonzini | |
285 | 6fef28ee | Anthony Liguori | if (!found) {
|
286 | 8f0056b7 | Paolo Bonzini | monitor_printf(mon, "Mouse at given index not found\n");
|
287 | 6fef28ee | Anthony Liguori | } |
288 | 7e581fb3 | Anthony Liguori | |
289 | 7e581fb3 | Anthony Liguori | check_mode_change(); |
290 | 7e581fb3 | Anthony Liguori | } |
291 | 7e581fb3 | Anthony Liguori | |
292 | 7e581fb3 | Anthony Liguori | void qemu_add_mouse_mode_change_notifier(Notifier *notify)
|
293 | 7e581fb3 | Anthony Liguori | { |
294 | 7e581fb3 | Anthony Liguori | notifier_list_add(&mouse_mode_notifiers, notify); |
295 | 7e581fb3 | Anthony Liguori | } |
296 | 7e581fb3 | Anthony Liguori | |
297 | 7e581fb3 | Anthony Liguori | void qemu_remove_mouse_mode_change_notifier(Notifier *notify)
|
298 | 7e581fb3 | Anthony Liguori | { |
299 | 7e581fb3 | Anthony Liguori | notifier_list_remove(&mouse_mode_notifiers, notify); |
300 | 8f0056b7 | Paolo Bonzini | } |