ui: add trace events related to VNC client throttling
[qemu/ar7.git] / qapi / ui.json
blob07b468f6250217a1c10656ac85837806b16c687a
1 # -*- Mode: Python -*-
4 ##
5 # = Remote desktop
6 ##
8 { 'include': 'sockets.json' }
11 # @set_password:
13 # Sets the password of a remote display session.
15 # @protocol: `vnc' to modify the VNC server password
16 #            `spice' to modify the Spice server password
18 # @password: the new password
20 # @connected: how to handle existing clients when changing the
21 #                       password.  If nothing is specified, defaults to `keep'
22 #                       `fail' to fail the command if clients are connected
23 #                       `disconnect' to disconnect existing clients
24 #                       `keep' to maintain existing clients
26 # Returns: Nothing on success
27 #          If Spice is not enabled, DeviceNotFound
29 # Since: 0.14.0
31 # Example:
33 # -> { "execute": "set_password", "arguments": { "protocol": "vnc",
34 #                                                "password": "secret" } }
35 # <- { "return": {} }
38 { 'command': 'set_password',
39   'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
42 # @expire_password:
44 # Expire the password of a remote display server.
46 # @protocol: the name of the remote display protocol `vnc' or `spice'
48 # @time: when to expire the password.
49 #        `now' to expire the password immediately
50 #        `never' to cancel password expiration
51 #        `+INT' where INT is the number of seconds from now (integer)
52 #        `INT' where INT is the absolute time in seconds
54 # Returns: Nothing on success
55 #          If @protocol is `spice' and Spice is not active, DeviceNotFound
57 # Since: 0.14.0
59 # Notes: Time is relative to the server and currently there is no way to
60 #        coordinate server time with client time.  It is not recommended to
61 #        use the absolute time version of the @time parameter unless you're
62 #        sure you are on the same machine as the QEMU instance.
64 # Example:
66 # -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
67 #                                                   "time": "+60" } }
68 # <- { "return": {} }
71 { 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
74 # @screendump:
76 # Write a PPM of the VGA screen to a file.
78 # @filename: the path of a new PPM file to store the image
80 # Returns: Nothing on success
82 # Since: 0.14.0
84 # Example:
86 # -> { "execute": "screendump",
87 #      "arguments": { "filename": "/tmp/image" } }
88 # <- { "return": {} }
91 { 'command': 'screendump', 'data': {'filename': 'str'} }
94 # == Spice
98 # @SpiceBasicInfo:
100 # The basic information for SPICE network connection
102 # @host: IP address
104 # @port: port number
106 # @family: address family
108 # Since: 2.1
110 { 'struct': 'SpiceBasicInfo',
111   'data': { 'host': 'str',
112             'port': 'str',
113             'family': 'NetworkAddressFamily' } }
116 # @SpiceServerInfo:
118 # Information about a SPICE server
120 # @auth: authentication method
122 # Since: 2.1
124 { 'struct': 'SpiceServerInfo',
125   'base': 'SpiceBasicInfo',
126   'data': { '*auth': 'str' } }
129 # @SpiceChannel:
131 # Information about a SPICE client channel.
133 # @connection-id: SPICE connection id number.  All channels with the same id
134 #                 belong to the same SPICE session.
136 # @channel-type: SPICE channel type number.  "1" is the main control
137 #                channel, filter for this one if you want to track spice
138 #                sessions only
140 # @channel-id: SPICE channel ID number.  Usually "0", might be different when
141 #              multiple channels of the same type exist, such as multiple
142 #              display channels in a multihead setup
144 # @tls: true if the channel is encrypted, false otherwise.
146 # Since: 0.14.0
148 { 'struct': 'SpiceChannel',
149   'base': 'SpiceBasicInfo',
150   'data': {'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
151            'tls': 'bool'} }
154 # @SpiceQueryMouseMode:
156 # An enumeration of Spice mouse states.
158 # @client: Mouse cursor position is determined by the client.
160 # @server: Mouse cursor position is determined by the server.
162 # @unknown: No information is available about mouse mode used by
163 #           the spice server.
165 # Note: spice/enums.h has a SpiceMouseMode already, hence the name.
167 # Since: 1.1
169 { 'enum': 'SpiceQueryMouseMode',
170   'data': [ 'client', 'server', 'unknown' ] }
173 # @SpiceInfo:
175 # Information about the SPICE session.
177 # @enabled: true if the SPICE server is enabled, false otherwise
179 # @migrated: true if the last guest migration completed and spice
180 #            migration had completed as well. false otherwise. (since 1.4)
182 # @host: The hostname the SPICE server is bound to.  This depends on
183 #        the name resolution on the host and may be an IP address.
185 # @port: The SPICE server's port number.
187 # @compiled-version: SPICE server version.
189 # @tls-port: The SPICE server's TLS port number.
191 # @auth: the current authentication type used by the server
192 #        'none'  if no authentication is being used
193 #        'spice' uses SASL or direct TLS authentication, depending on command
194 #                line options
196 # @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
197 #              be determined by the client or the server, or unknown if spice
198 #              server doesn't provide this information. (since: 1.1)
200 # @channels: a list of @SpiceChannel for each active spice channel
202 # Since: 0.14.0
204 { 'struct': 'SpiceInfo',
205   'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
206            '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
207            'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
210 # @query-spice:
212 # Returns information about the current SPICE server
214 # Returns: @SpiceInfo
216 # Since: 0.14.0
218 # Example:
220 # -> { "execute": "query-spice" }
221 # <- { "return": {
222 #          "enabled": true,
223 #          "auth": "spice",
224 #          "port": 5920,
225 #          "tls-port": 5921,
226 #          "host": "0.0.0.0",
227 #          "channels": [
228 #             {
229 #                "port": "54924",
230 #                "family": "ipv4",
231 #                "channel-type": 1,
232 #                "connection-id": 1804289383,
233 #                "host": "127.0.0.1",
234 #                "channel-id": 0,
235 #                "tls": true
236 #             },
237 #             {
238 #                "port": "36710",
239 #                "family": "ipv4",
240 #                "channel-type": 4,
241 #                "connection-id": 1804289383,
242 #                "host": "127.0.0.1",
243 #                "channel-id": 0,
244 #                "tls": false
245 #             },
246 #             [ ... more channels follow ... ]
247 #          ]
248 #       }
249 #    }
252 { 'command': 'query-spice', 'returns': 'SpiceInfo' }
255 # @SPICE_CONNECTED:
257 # Emitted when a SPICE client establishes a connection
259 # @server: server information
261 # @client: client information
263 # Since: 0.14.0
265 # Example:
267 # <- { "timestamp": {"seconds": 1290688046, "microseconds": 388707},
268 #      "event": "SPICE_CONNECTED",
269 #      "data": {
270 #        "server": { "port": "5920", "family": "ipv4", "host": "127.0.0.1"},
271 #        "client": {"port": "52873", "family": "ipv4", "host": "127.0.0.1"}
272 #    }}
275 { 'event': 'SPICE_CONNECTED',
276   'data': { 'server': 'SpiceBasicInfo',
277             'client': 'SpiceBasicInfo' } }
280 # @SPICE_INITIALIZED:
282 # Emitted after initial handshake and authentication takes place (if any)
283 # and the SPICE channel is up and running
285 # @server: server information
287 # @client: client information
289 # Since: 0.14.0
291 # Example:
293 # <- { "timestamp": {"seconds": 1290688046, "microseconds": 417172},
294 #      "event": "SPICE_INITIALIZED",
295 #      "data": {"server": {"auth": "spice", "port": "5921",
296 #                          "family": "ipv4", "host": "127.0.0.1"},
297 #               "client": {"port": "49004", "family": "ipv4", "channel-type": 3,
298 #                          "connection-id": 1804289383, "host": "127.0.0.1",
299 #                          "channel-id": 0, "tls": true}
300 #    }}
303 { 'event': 'SPICE_INITIALIZED',
304   'data': { 'server': 'SpiceServerInfo',
305             'client': 'SpiceChannel' } }
308 # @SPICE_DISCONNECTED:
310 # Emitted when the SPICE connection is closed
312 # @server: server information
314 # @client: client information
316 # Since: 0.14.0
318 # Example:
320 # <- { "timestamp": {"seconds": 1290688046, "microseconds": 388707},
321 #      "event": "SPICE_DISCONNECTED",
322 #      "data": {
323 #        "server": { "port": "5920", "family": "ipv4", "host": "127.0.0.1"},
324 #        "client": {"port": "52873", "family": "ipv4", "host": "127.0.0.1"}
325 #    }}
328 { 'event': 'SPICE_DISCONNECTED',
329   'data': { 'server': 'SpiceBasicInfo',
330             'client': 'SpiceBasicInfo' } }
333 # @SPICE_MIGRATE_COMPLETED:
335 # Emitted when SPICE migration has completed
337 # Since: 1.3
339 # Example:
341 # <- { "timestamp": {"seconds": 1290688046, "microseconds": 417172},
342 #      "event": "SPICE_MIGRATE_COMPLETED" }
345 { 'event': 'SPICE_MIGRATE_COMPLETED' }
348 # == VNC
352 # @VncBasicInfo:
354 # The basic information for vnc network connection
356 # @host: IP address
358 # @service: The service name of the vnc port. This may depend on the host
359 #           system's service database so symbolic names should not be relied
360 #           on.
362 # @family: address family
364 # @websocket: true in case the socket is a websocket (since 2.3).
366 # Since: 2.1
368 { 'struct': 'VncBasicInfo',
369   'data': { 'host': 'str',
370             'service': 'str',
371             'family': 'NetworkAddressFamily',
372             'websocket': 'bool' } }
375 # @VncServerInfo:
377 # The network connection information for server
379 # @auth: authentication method used for
380 #        the plain (non-websocket) VNC server
382 # Since: 2.1
384 { 'struct': 'VncServerInfo',
385   'base': 'VncBasicInfo',
386   'data': { '*auth': 'str' } }
389 # @VncClientInfo:
391 # Information about a connected VNC client.
393 # @x509_dname: If x509 authentication is in use, the Distinguished
394 #              Name of the client.
396 # @sasl_username: If SASL authentication is in use, the SASL username
397 #                 used for authentication.
399 # Since: 0.14.0
401 { 'struct': 'VncClientInfo',
402   'base': 'VncBasicInfo',
403   'data': { '*x509_dname': 'str', '*sasl_username': 'str' } }
406 # @VncInfo:
408 # Information about the VNC session.
410 # @enabled: true if the VNC server is enabled, false otherwise
412 # @host: The hostname the VNC server is bound to.  This depends on
413 #        the name resolution on the host and may be an IP address.
415 # @family: 'ipv6' if the host is listening for IPv6 connections
416 #                    'ipv4' if the host is listening for IPv4 connections
417 #                    'unix' if the host is listening on a unix domain socket
418 #                    'unknown' otherwise
420 # @service: The service name of the server's port.  This may depends
421 #           on the host system's service database so symbolic names should not
422 #           be relied on.
424 # @auth: the current authentication type used by the server
425 #        'none' if no authentication is being used
426 #        'vnc' if VNC authentication is being used
427 #        'vencrypt+plain' if VEncrypt is used with plain text authentication
428 #        'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
429 #        'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
430 #        'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
431 #        'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
432 #        'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
433 #        'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
434 #        'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
435 #        'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
437 # @clients: a list of @VncClientInfo of all currently connected clients
439 # Since: 0.14.0
441 { 'struct': 'VncInfo',
442   'data': {'enabled': 'bool', '*host': 'str',
443            '*family': 'NetworkAddressFamily',
444            '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
447 # @VncPrimaryAuth:
449 # vnc primary authentication method.
451 # Since: 2.3
453 { 'enum': 'VncPrimaryAuth',
454   'data': [ 'none', 'vnc', 'ra2', 'ra2ne', 'tight', 'ultra',
455             'tls', 'vencrypt', 'sasl' ] }
458 # @VncVencryptSubAuth:
460 # vnc sub authentication method with vencrypt.
462 # Since: 2.3
464 { 'enum': 'VncVencryptSubAuth',
465   'data': [ 'plain',
466             'tls-none',  'x509-none',
467             'tls-vnc',   'x509-vnc',
468             'tls-plain', 'x509-plain',
469             'tls-sasl',  'x509-sasl' ] }
473 # @VncServerInfo2:
475 # The network connection information for server
477 # @auth: The current authentication type used by the servers
479 # @vencrypt: The vencrypt sub authentication type used by the
480 #            servers, only specified in case auth == vencrypt.
482 # Since: 2.9
484 { 'struct': 'VncServerInfo2',
485   'base': 'VncBasicInfo',
486   'data': { 'auth'      : 'VncPrimaryAuth',
487             '*vencrypt' : 'VncVencryptSubAuth' } }
491 # @VncInfo2:
493 # Information about a vnc server
495 # @id: vnc server name.
497 # @server: A list of @VncBasincInfo describing all listening sockets.
498 #          The list can be empty (in case the vnc server is disabled).
499 #          It also may have multiple entries: normal + websocket,
500 #          possibly also ipv4 + ipv6 in the future.
502 # @clients: A list of @VncClientInfo of all currently connected clients.
503 #           The list can be empty, for obvious reasons.
505 # @auth: The current authentication type used by the non-websockets servers
507 # @vencrypt: The vencrypt authentication type used by the servers,
508 #            only specified in case auth == vencrypt.
510 # @display: The display device the vnc server is linked to.
512 # Since: 2.3
514 { 'struct': 'VncInfo2',
515   'data': { 'id'        : 'str',
516             'server'    : ['VncServerInfo2'],
517             'clients'   : ['VncClientInfo'],
518             'auth'      : 'VncPrimaryAuth',
519             '*vencrypt' : 'VncVencryptSubAuth',
520             '*display'  : 'str' } }
523 # @query-vnc:
525 # Returns information about the current VNC server
527 # Returns: @VncInfo
529 # Since: 0.14.0
531 # Example:
533 # -> { "execute": "query-vnc" }
534 # <- { "return": {
535 #          "enabled":true,
536 #          "host":"0.0.0.0",
537 #          "service":"50402",
538 #          "auth":"vnc",
539 #          "family":"ipv4",
540 #          "clients":[
541 #             {
542 #                "host":"127.0.0.1",
543 #                "service":"50401",
544 #                "family":"ipv4"
545 #             }
546 #          ]
547 #       }
548 #    }
551 { 'command': 'query-vnc', 'returns': 'VncInfo' }
554 # @query-vnc-servers:
556 # Returns a list of vnc servers.  The list can be empty.
558 # Returns: a list of @VncInfo2
560 # Since: 2.3
562 { 'command': 'query-vnc-servers', 'returns': ['VncInfo2'] }
565 # @change-vnc-password:
567 # Change the VNC server password.
569 # @password:  the new password to use with VNC authentication
571 # Since: 1.1
573 # Notes:  An empty password in this command will set the password to the empty
574 #         string.  Existing clients are unaffected by executing this command.
576 { 'command': 'change-vnc-password', 'data': {'password': 'str'} }
579 # @VNC_CONNECTED:
581 # Emitted when a VNC client establishes a connection
583 # @server: server information
585 # @client: client information
587 # Note: This event is emitted before any authentication takes place, thus
588 # the authentication ID is not provided
590 # Since: 0.13.0
592 # Example:
594 # <- { "event": "VNC_CONNECTED",
595 #      "data": {
596 #            "server": { "auth": "sasl", "family": "ipv4",
597 #                        "service": "5901", "host": "0.0.0.0" },
598 #            "client": { "family": "ipv4", "service": "58425",
599 #                        "host": "127.0.0.1" } },
600 #      "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
603 { 'event': 'VNC_CONNECTED',
604   'data': { 'server': 'VncServerInfo',
605             'client': 'VncBasicInfo' } }
608 # @VNC_INITIALIZED:
610 # Emitted after authentication takes place (if any) and the VNC session is
611 # made active
613 # @server: server information
615 # @client: client information
617 # Since: 0.13.0
619 # Example:
621 # <-  { "event": "VNC_INITIALIZED",
622 #       "data": {
623 #            "server": { "auth": "sasl", "family": "ipv4",
624 #                        "service": "5901", "host": "0.0.0.0"},
625 #            "client": { "family": "ipv4", "service": "46089",
626 #                        "host": "127.0.0.1", "sasl_username": "luiz" } },
627 #       "timestamp": { "seconds": 1263475302, "microseconds": 150772 } }
630 { 'event': 'VNC_INITIALIZED',
631   'data': { 'server': 'VncServerInfo',
632             'client': 'VncClientInfo' } }
635 # @VNC_DISCONNECTED:
637 # Emitted when the connection is closed
639 # @server: server information
641 # @client: client information
643 # Since: 0.13.0
645 # Example:
647 # <- { "event": "VNC_DISCONNECTED",
648 #      "data": {
649 #            "server": { "auth": "sasl", "family": "ipv4",
650 #                        "service": "5901", "host": "0.0.0.0" },
651 #            "client": { "family": "ipv4", "service": "58425",
652 #                        "host": "127.0.0.1", "sasl_username": "luiz" } },
653 #      "timestamp": { "seconds": 1262976601, "microseconds": 975795 } }
656 { 'event': 'VNC_DISCONNECTED',
657   'data': { 'server': 'VncServerInfo',
658             'client': 'VncClientInfo' } }
661 # = Input
665 # @MouseInfo:
667 # Information about a mouse device.
669 # @name: the name of the mouse device
671 # @index: the index of the mouse device
673 # @current: true if this device is currently receiving mouse events
675 # @absolute: true if this device supports absolute coordinates as input
677 # Since: 0.14.0
679 { 'struct': 'MouseInfo',
680   'data': {'name': 'str', 'index': 'int', 'current': 'bool',
681            'absolute': 'bool'} }
684 # @query-mice:
686 # Returns information about each active mouse device
688 # Returns: a list of @MouseInfo for each device
690 # Since: 0.14.0
692 # Example:
694 # -> { "execute": "query-mice" }
695 # <- { "return": [
696 #          {
697 #             "name":"QEMU Microsoft Mouse",
698 #             "index":0,
699 #             "current":false,
700 #             "absolute":false
701 #          },
702 #          {
703 #             "name":"QEMU PS/2 Mouse",
704 #             "index":1,
705 #             "current":true,
706 #             "absolute":true
707 #          }
708 #       ]
709 #    }
712 { 'command': 'query-mice', 'returns': ['MouseInfo'] }
715 # @QKeyCode:
717 # An enumeration of key name.
719 # This is used by the @send-key command.
721 # @unmapped: since 2.0
722 # @pause: since 2.0
723 # @ro: since 2.4
724 # @kp_comma: since 2.4
725 # @kp_equals: since 2.6
726 # @power: since 2.6
727 # @hiragana: since 2.9
728 # @henkan: since 2.9
729 # @yen: since 2.9
731 # @sleep: since 2.10
732 # @wake: since 2.10
733 # @audionext: since 2.10
734 # @audioprev: since 2.10
735 # @audiostop: since 2.10
736 # @audioplay: since 2.10
737 # @audiomute: since 2.10
738 # @volumeup: since 2.10
739 # @volumedown: since 2.10
740 # @mediaselect: since 2.10
741 # @mail: since 2.10
742 # @calculator: since 2.10
743 # @computer: since 2.10
744 # @ac_home: since 2.10
745 # @ac_back: since 2.10
746 # @ac_forward: since 2.10
747 # @ac_refresh: since 2.10
748 # @ac_bookmarks: since 2.10
749 # altgr, altgr_r: dropped in 2.10
751 # 'sysrq' was mistakenly added to hack around the fact that
752 # the ps2 driver was not generating correct scancodes sequences
753 # when 'alt+print' was pressed. This flaw is now fixed and the
754 # 'sysrq' key serves no further purpose. Any further use of
755 # 'sysrq' will be transparently changed to 'print', so they
756 # are effectively synonyms.
758 # Since: 1.3.0
761 { 'enum': 'QKeyCode',
762   'data': [ 'unmapped',
763             'shift', 'shift_r', 'alt', 'alt_r', 'ctrl',
764             'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
765             '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
766             'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
767             'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
768             'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
769             'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
770             'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
771             'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
772             'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
773             'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
774             'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
775             'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
776             'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
777             'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
778             'ro', 'hiragana', 'henkan', 'yen',
779             'kp_comma', 'kp_equals', 'power', 'sleep', 'wake',
780             'audionext', 'audioprev', 'audiostop', 'audioplay', 'audiomute',
781             'volumeup', 'volumedown', 'mediaselect',
782             'mail', 'calculator', 'computer',
783             'ac_home', 'ac_back', 'ac_forward', 'ac_refresh', 'ac_bookmarks' ] }
786 # @KeyValue:
788 # Represents a keyboard key.
790 # Since: 1.3.0
792 { 'union': 'KeyValue',
793   'data': {
794     'number': 'int',
795     'qcode': 'QKeyCode' } }
798 # @send-key:
800 # Send keys to guest.
802 # @keys: An array of @KeyValue elements. All @KeyValues in this array are
803 #        simultaneously sent to the guest. A @KeyValue.number value is sent
804 #        directly to the guest, while @KeyValue.qcode must be a valid
805 #        @QKeyCode value
807 # @hold-time: time to delay key up events, milliseconds. Defaults
808 #             to 100
810 # Returns: Nothing on success
811 #          If key is unknown or redundant, InvalidParameter
813 # Since: 1.3.0
815 # Example:
817 # -> { "execute": "send-key",
818 #      "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
819 #                               { "type": "qcode", "data": "alt" },
820 #                               { "type": "qcode", "data": "delete" } ] } }
821 # <- { "return": {} }
824 { 'command': 'send-key',
825   'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
828 # @InputButton:
830 # Button of a pointer input device (mouse, tablet).
832 # @side: front side button of a 5-button mouse (since 2.9)
834 # @extra: rear side button of a 5-button mouse (since 2.9)
836 # Since: 2.0
838 { 'enum'  : 'InputButton',
839   'data'  : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down', 'side',
840   'extra' ] }
843 # @InputAxis:
845 # Position axis of a pointer input device (mouse, tablet).
847 # Since: 2.0
849 { 'enum'  : 'InputAxis',
850   'data'  : [ 'x', 'y' ] }
853 # @InputKeyEvent:
855 # Keyboard input event.
857 # @key:    Which key this event is for.
858 # @down:   True for key-down and false for key-up events.
860 # Since: 2.0
862 { 'struct'  : 'InputKeyEvent',
863   'data'  : { 'key'     : 'KeyValue',
864               'down'    : 'bool' } }
867 # @InputBtnEvent:
869 # Pointer button input event.
871 # @button: Which button this event is for.
872 # @down:   True for key-down and false for key-up events.
874 # Since: 2.0
876 { 'struct'  : 'InputBtnEvent',
877   'data'  : { 'button'  : 'InputButton',
878               'down'    : 'bool' } }
881 # @InputMoveEvent:
883 # Pointer motion input event.
885 # @axis:   Which axis is referenced by @value.
886 # @value:  Pointer position.  For absolute coordinates the
887 #          valid range is 0 -> 0x7ffff
889 # Since: 2.0
891 { 'struct'  : 'InputMoveEvent',
892   'data'  : { 'axis'    : 'InputAxis',
893               'value'   : 'int' } }
896 # @InputEvent:
898 # Input event union.
900 # @type: the input type, one of:
901 #  - 'key': Input event of Keyboard
902 #  - 'btn': Input event of pointer buttons
903 #  - 'rel': Input event of relative pointer motion
904 #  - 'abs': Input event of absolute pointer motion
906 # Since: 2.0
908 { 'union' : 'InputEvent',
909   'data'  : { 'key'     : 'InputKeyEvent',
910               'btn'     : 'InputBtnEvent',
911               'rel'     : 'InputMoveEvent',
912               'abs'     : 'InputMoveEvent' } }
915 # @input-send-event:
917 # Send input event(s) to guest.
919 # @device: display device to send event(s) to.
920 # @head: head to send event(s) to, in case the
921 #        display device supports multiple scanouts.
922 # @events: List of InputEvent union.
924 # Returns: Nothing on success.
926 # The @device and @head parameters can be used to send the input event
927 # to specific input devices in case (a) multiple input devices of the
928 # same kind are added to the virtual machine and (b) you have
929 # configured input routing (see docs/multiseat.txt) for those input
930 # devices.  The parameters work exactly like the device and head
931 # properties of input devices.  If @device is missing, only devices
932 # that have no input routing config are admissible.  If @device is
933 # specified, both input devices with and without input routing config
934 # are admissible, but devices with input routing config take
935 # precedence.
937 # Since: 2.6
939 # Note: The consoles are visible in the qom tree, under
940 # /backend/console[$index]. They have a device link and head property,
941 # so it is possible to map which console belongs to which device and
942 # display.
944 # Example:
946 # 1. Press left mouse button.
948 # -> { "execute": "input-send-event",
949 #     "arguments": { "device": "video0",
950 #                    "events": [ { "type": "btn",
951 #                    "data" : { "down": true, "button": "left" } } ] } }
952 # <- { "return": {} }
954 # -> { "execute": "input-send-event",
955 #     "arguments": { "device": "video0",
956 #                    "events": [ { "type": "btn",
957 #                    "data" : { "down": false, "button": "left" } } ] } }
958 # <- { "return": {} }
960 # 2. Press ctrl-alt-del.
962 # -> { "execute": "input-send-event",
963 #      "arguments": { "events": [
964 #         { "type": "key", "data" : { "down": true,
965 #           "key": {"type": "qcode", "data": "ctrl" } } },
966 #         { "type": "key", "data" : { "down": true,
967 #           "key": {"type": "qcode", "data": "alt" } } },
968 #         { "type": "key", "data" : { "down": true,
969 #           "key": {"type": "qcode", "data": "delete" } } } ] } }
970 # <- { "return": {} }
972 # 3. Move mouse pointer to absolute coordinates (20000, 400).
974 # -> { "execute": "input-send-event" ,
975 #   "arguments": { "events": [
976 #                { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
977 #                { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
978 # <- { "return": {} }
981 { 'command': 'input-send-event',
982   'data': { '*device': 'str',
983             '*head'  : 'int',
984             'events' : [ 'InputEvent' ] } }