Revision 1aaee43c input.c
b/input.c | ||
---|---|---|
195 | 195 |
Monitor *mon = opaque; |
196 | 196 |
|
197 | 197 |
mouse = qobject_to_qdict(data); |
198 |
monitor_printf(mon, "%c Mouse #%" PRId64 ": %s\n", |
|
198 |
monitor_printf(mon, "%c Mouse #%" PRId64 ": %s%s\n",
|
|
199 | 199 |
(qdict_get_bool(mouse, "current") ? '*' : ' '), |
200 |
qdict_get_int(mouse, "index"), qdict_get_str(mouse, "name")); |
|
200 |
qdict_get_int(mouse, "index"), qdict_get_str(mouse, "name"), |
|
201 |
qdict_get_bool(mouse, "absolute") ? " (absolute)" : ""); |
|
201 | 202 |
} |
202 | 203 |
|
203 | 204 |
void do_info_mice_print(Monitor *mon, const QObject *data) |
... | ... | |
224 | 225 |
* - "name": mouse's name |
225 | 226 |
* - "index": mouse's index |
226 | 227 |
* - "current": true if this mouse is receiving events, false otherwise |
228 |
* - "absolute": true if the mouse generates absolute input events |
|
227 | 229 |
* |
228 | 230 |
* Example: |
229 | 231 |
* |
230 |
* [ { "name": "QEMU Microsoft Mouse", "index": 0, "current": false }, |
|
231 |
* { "name": "QEMU PS/2 Mouse", "index": 1, "current": true } ] |
|
232 |
* [ { "name": "QEMU Microsoft Mouse", "index": 0, "current": false, "absolute": false },
|
|
233 |
* { "name": "QEMU PS/2 Mouse", "index": 1, "current": true, "absolute": true } ]
|
|
232 | 234 |
*/ |
233 | 235 |
void do_info_mice(Monitor *mon, QObject **ret_data) |
234 | 236 |
{ |
... | ... | |
246 | 248 |
|
247 | 249 |
QTAILQ_FOREACH(cursor, &mouse_handlers, node) { |
248 | 250 |
QObject *obj; |
249 |
obj = qobject_from_jsonf("{ 'name': %s, 'index': %d, 'current': %i }", |
|
251 |
obj = qobject_from_jsonf("{ 'name': %s," |
|
252 |
" 'index': %d," |
|
253 |
" 'current': %i," |
|
254 |
" 'absolute': %i }", |
|
250 | 255 |
cursor->qemu_put_mouse_event_name, |
251 | 256 |
cursor->index, |
252 |
cursor->index == current); |
|
257 |
cursor->index == current, |
|
258 |
!!cursor->qemu_put_mouse_event_absolute); |
|
253 | 259 |
qlist_append_obj(mice_list, obj); |
254 | 260 |
} |
255 | 261 |
|
Also available in: Unified diff