xref: /openbmc/qemu/qapi/ui.json (revision 1d4bfc54)
1# -*- Mode: Python -*-
2#
3
4##
5# = Remote desktop
6##
7
8{ 'include': 'sockets.json' }
9
10##
11# @set_password:
12#
13# Sets the password of a remote display session.
14#
15# @protocol: `vnc' to modify the VNC server password
16#            `spice' to modify the Spice server password
17#
18# @password: the new password
19#
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
25#
26# Returns: Nothing on success
27#          If Spice is not enabled, DeviceNotFound
28#
29# Since: 0.14.0
30#
31# Example:
32#
33# -> { "execute": "set_password", "arguments": { "protocol": "vnc",
34#                                                "password": "secret" } }
35# <- { "return": {} }
36#
37##
38{ 'command': 'set_password',
39  'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
40
41##
42# @expire_password:
43#
44# Expire the password of a remote display server.
45#
46# @protocol: the name of the remote display protocol `vnc' or `spice'
47#
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
53#
54# Returns: Nothing on success
55#          If @protocol is `spice' and Spice is not active, DeviceNotFound
56#
57# Since: 0.14.0
58#
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.
63#
64# Example:
65#
66# -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
67#                                                   "time": "+60" } }
68# <- { "return": {} }
69#
70##
71{ 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
72
73##
74# @screendump:
75#
76# Write a PPM of the VGA screen to a file.
77#
78# @filename: the path of a new PPM file to store the image
79#
80# Returns: Nothing on success
81#
82# Since: 0.14.0
83#
84# Example:
85#
86# -> { "execute": "screendump",
87#      "arguments": { "filename": "/tmp/image" } }
88# <- { "return": {} }
89#
90##
91{ 'command': 'screendump', 'data': {'filename': 'str'} }
92
93##
94# == Spice
95##
96
97##
98# @SpiceBasicInfo:
99#
100# The basic information for SPICE network connection
101#
102# @host: IP address
103#
104# @port: port number
105#
106# @family: address family
107#
108# Since: 2.1
109##
110{ 'struct': 'SpiceBasicInfo',
111  'data': { 'host': 'str',
112            'port': 'str',
113            'family': 'NetworkAddressFamily' } }
114
115##
116# @SpiceServerInfo:
117#
118# Information about a SPICE server
119#
120# @auth: authentication method
121#
122# Since: 2.1
123##
124{ 'struct': 'SpiceServerInfo',
125  'base': 'SpiceBasicInfo',
126  'data': { '*auth': 'str' } }
127
128##
129# @SpiceChannel:
130#
131# Information about a SPICE client channel.
132#
133# @connection-id: SPICE connection id number.  All channels with the same id
134#                 belong to the same SPICE session.
135#
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
139#
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
143#
144# @tls: true if the channel is encrypted, false otherwise.
145#
146# Since: 0.14.0
147##
148{ 'struct': 'SpiceChannel',
149  'base': 'SpiceBasicInfo',
150  'data': {'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
151           'tls': 'bool'} }
152
153##
154# @SpiceQueryMouseMode:
155#
156# An enumeration of Spice mouse states.
157#
158# @client: Mouse cursor position is determined by the client.
159#
160# @server: Mouse cursor position is determined by the server.
161#
162# @unknown: No information is available about mouse mode used by
163#           the spice server.
164#
165# Note: spice/enums.h has a SpiceMouseMode already, hence the name.
166#
167# Since: 1.1
168##
169{ 'enum': 'SpiceQueryMouseMode',
170  'data': [ 'client', 'server', 'unknown' ] }
171
172##
173# @SpiceInfo:
174#
175# Information about the SPICE session.
176#
177# @enabled: true if the SPICE server is enabled, false otherwise
178#
179# @migrated: true if the last guest migration completed and spice
180#            migration had completed as well. false otherwise. (since 1.4)
181#
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.
184#
185# @port: The SPICE server's port number.
186#
187# @compiled-version: SPICE server version.
188#
189# @tls-port: The SPICE server's TLS port number.
190#
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
195#
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)
199#
200# @channels: a list of @SpiceChannel for each active spice channel
201#
202# Since: 0.14.0
203##
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']} }
208
209##
210# @query-spice:
211#
212# Returns information about the current SPICE server
213#
214# Returns: @SpiceInfo
215#
216# Since: 0.14.0
217#
218# Example:
219#
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#    }
250#
251##
252{ 'command': 'query-spice', 'returns': 'SpiceInfo' }
253
254##
255# @SPICE_CONNECTED:
256#
257# Emitted when a SPICE client establishes a connection
258#
259# @server: server information
260#
261# @client: client information
262#
263# Since: 0.14.0
264#
265# Example:
266#
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#    }}
273#
274##
275{ 'event': 'SPICE_CONNECTED',
276  'data': { 'server': 'SpiceBasicInfo',
277            'client': 'SpiceBasicInfo' } }
278
279##
280# @SPICE_INITIALIZED:
281#
282# Emitted after initial handshake and authentication takes place (if any)
283# and the SPICE channel is up and running
284#
285# @server: server information
286#
287# @client: client information
288#
289# Since: 0.14.0
290#
291# Example:
292#
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#    }}
301#
302##
303{ 'event': 'SPICE_INITIALIZED',
304  'data': { 'server': 'SpiceServerInfo',
305            'client': 'SpiceChannel' } }
306
307##
308# @SPICE_DISCONNECTED:
309#
310# Emitted when the SPICE connection is closed
311#
312# @server: server information
313#
314# @client: client information
315#
316# Since: 0.14.0
317#
318# Example:
319#
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#    }}
326#
327##
328{ 'event': 'SPICE_DISCONNECTED',
329  'data': { 'server': 'SpiceBasicInfo',
330            'client': 'SpiceBasicInfo' } }
331
332##
333# @SPICE_MIGRATE_COMPLETED:
334#
335# Emitted when SPICE migration has completed
336#
337# Since: 1.3
338#
339# Example:
340#
341# <- { "timestamp": {"seconds": 1290688046, "microseconds": 417172},
342#      "event": "SPICE_MIGRATE_COMPLETED" }
343#
344##
345{ 'event': 'SPICE_MIGRATE_COMPLETED' }
346
347##
348# == VNC
349##
350
351##
352# @VncBasicInfo:
353#
354# The basic information for vnc network connection
355#
356# @host: IP address
357#
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.
361#
362# @family: address family
363#
364# @websocket: true in case the socket is a websocket (since 2.3).
365#
366# Since: 2.1
367##
368{ 'struct': 'VncBasicInfo',
369  'data': { 'host': 'str',
370            'service': 'str',
371            'family': 'NetworkAddressFamily',
372            'websocket': 'bool' } }
373
374##
375# @VncServerInfo:
376#
377# The network connection information for server
378#
379# @auth: authentication method used for
380#        the plain (non-websocket) VNC server
381#
382# Since: 2.1
383##
384{ 'struct': 'VncServerInfo',
385  'base': 'VncBasicInfo',
386  'data': { '*auth': 'str' } }
387
388##
389# @VncClientInfo:
390#
391# Information about a connected VNC client.
392#
393# @x509_dname: If x509 authentication is in use, the Distinguished
394#              Name of the client.
395#
396# @sasl_username: If SASL authentication is in use, the SASL username
397#                 used for authentication.
398#
399# Since: 0.14.0
400##
401{ 'struct': 'VncClientInfo',
402  'base': 'VncBasicInfo',
403  'data': { '*x509_dname': 'str', '*sasl_username': 'str' } }
404
405##
406# @VncInfo:
407#
408# Information about the VNC session.
409#
410# @enabled: true if the VNC server is enabled, false otherwise
411#
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.
414#
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
419#
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.
423#
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
436#
437# @clients: a list of @VncClientInfo of all currently connected clients
438#
439# Since: 0.14.0
440##
441{ 'struct': 'VncInfo',
442  'data': {'enabled': 'bool', '*host': 'str',
443           '*family': 'NetworkAddressFamily',
444           '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
445
446##
447# @VncPrimaryAuth:
448#
449# vnc primary authentication method.
450#
451# Since: 2.3
452##
453{ 'enum': 'VncPrimaryAuth',
454  'data': [ 'none', 'vnc', 'ra2', 'ra2ne', 'tight', 'ultra',
455            'tls', 'vencrypt', 'sasl' ] }
456
457##
458# @VncVencryptSubAuth:
459#
460# vnc sub authentication method with vencrypt.
461#
462# Since: 2.3
463##
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' ] }
470
471
472##
473# @VncServerInfo2:
474#
475# The network connection information for server
476#
477# @auth: The current authentication type used by the servers
478#
479# @vencrypt: The vencrypt sub authentication type used by the
480#            servers, only specified in case auth == vencrypt.
481#
482# Since: 2.9
483##
484{ 'struct': 'VncServerInfo2',
485  'base': 'VncBasicInfo',
486  'data': { 'auth'      : 'VncPrimaryAuth',
487            '*vencrypt' : 'VncVencryptSubAuth' } }
488
489
490##
491# @VncInfo2:
492#
493# Information about a vnc server
494#
495# @id: vnc server name.
496#
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.
501#
502# @clients: A list of @VncClientInfo of all currently connected clients.
503#           The list can be empty, for obvious reasons.
504#
505# @auth: The current authentication type used by the non-websockets servers
506#
507# @vencrypt: The vencrypt authentication type used by the servers,
508#            only specified in case auth == vencrypt.
509#
510# @display: The display device the vnc server is linked to.
511#
512# Since: 2.3
513##
514{ 'struct': 'VncInfo2',
515  'data': { 'id'        : 'str',
516            'server'    : ['VncServerInfo2'],
517            'clients'   : ['VncClientInfo'],
518            'auth'      : 'VncPrimaryAuth',
519            '*vencrypt' : 'VncVencryptSubAuth',
520            '*display'  : 'str' } }
521
522##
523# @query-vnc:
524#
525# Returns information about the current VNC server
526#
527# Returns: @VncInfo
528#
529# Since: 0.14.0
530#
531# Example:
532#
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#    }
549#
550##
551{ 'command': 'query-vnc', 'returns': 'VncInfo' }
552
553##
554# @query-vnc-servers:
555#
556# Returns a list of vnc servers.  The list can be empty.
557#
558# Returns: a list of @VncInfo2
559#
560# Since: 2.3
561##
562{ 'command': 'query-vnc-servers', 'returns': ['VncInfo2'] }
563
564##
565# @change-vnc-password:
566#
567# Change the VNC server password.
568#
569# @password:  the new password to use with VNC authentication
570#
571# Since: 1.1
572#
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.
575##
576{ 'command': 'change-vnc-password', 'data': {'password': 'str'} }
577
578##
579# @VNC_CONNECTED:
580#
581# Emitted when a VNC client establishes a connection
582#
583# @server: server information
584#
585# @client: client information
586#
587# Note: This event is emitted before any authentication takes place, thus
588# the authentication ID is not provided
589#
590# Since: 0.13.0
591#
592# Example:
593#
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 } }
601#
602##
603{ 'event': 'VNC_CONNECTED',
604  'data': { 'server': 'VncServerInfo',
605            'client': 'VncBasicInfo' } }
606
607##
608# @VNC_INITIALIZED:
609#
610# Emitted after authentication takes place (if any) and the VNC session is
611# made active
612#
613# @server: server information
614#
615# @client: client information
616#
617# Since: 0.13.0
618#
619# Example:
620#
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 } }
628#
629##
630{ 'event': 'VNC_INITIALIZED',
631  'data': { 'server': 'VncServerInfo',
632            'client': 'VncClientInfo' } }
633
634##
635# @VNC_DISCONNECTED:
636#
637# Emitted when the connection is closed
638#
639# @server: server information
640#
641# @client: client information
642#
643# Since: 0.13.0
644#
645# Example:
646#
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 } }
654#
655##
656{ 'event': 'VNC_DISCONNECTED',
657  'data': { 'server': 'VncServerInfo',
658            'client': 'VncClientInfo' } }
659
660##
661# = Input
662##
663
664##
665# @MouseInfo:
666#
667# Information about a mouse device.
668#
669# @name: the name of the mouse device
670#
671# @index: the index of the mouse device
672#
673# @current: true if this device is currently receiving mouse events
674#
675# @absolute: true if this device supports absolute coordinates as input
676#
677# Since: 0.14.0
678##
679{ 'struct': 'MouseInfo',
680  'data': {'name': 'str', 'index': 'int', 'current': 'bool',
681           'absolute': 'bool'} }
682
683##
684# @query-mice:
685#
686# Returns information about each active mouse device
687#
688# Returns: a list of @MouseInfo for each device
689#
690# Since: 0.14.0
691#
692# Example:
693#
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#    }
710#
711##
712{ 'command': 'query-mice', 'returns': ['MouseInfo'] }
713
714##
715# @QKeyCode:
716#
717# An enumeration of key name.
718#
719# This is used by the @send-key command.
720#
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
730#
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
750#
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.
757#
758# Since: 1.3.0
759#
760##
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' ] }
784
785##
786# @KeyValue:
787#
788# Represents a keyboard key.
789#
790# Since: 1.3.0
791##
792{ 'union': 'KeyValue',
793  'data': {
794    'number': 'int',
795    'qcode': 'QKeyCode' } }
796
797##
798# @send-key:
799#
800# Send keys to guest.
801#
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
806#
807# @hold-time: time to delay key up events, milliseconds. Defaults
808#             to 100
809#
810# Returns: Nothing on success
811#          If key is unknown or redundant, InvalidParameter
812#
813# Since: 1.3.0
814#
815# Example:
816#
817# -> { "execute": "send-key",
818#      "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
819#                               { "type": "qcode", "data": "alt" },
820#                               { "type": "qcode", "data": "delete" } ] } }
821# <- { "return": {} }
822#
823##
824{ 'command': 'send-key',
825  'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
826
827##
828# @InputButton:
829#
830# Button of a pointer input device (mouse, tablet).
831#
832# @side: front side button of a 5-button mouse (since 2.9)
833#
834# @extra: rear side button of a 5-button mouse (since 2.9)
835#
836# Since: 2.0
837##
838{ 'enum'  : 'InputButton',
839  'data'  : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down', 'side',
840  'extra' ] }
841
842##
843# @InputAxis:
844#
845# Position axis of a pointer input device (mouse, tablet).
846#
847# Since: 2.0
848##
849{ 'enum'  : 'InputAxis',
850  'data'  : [ 'x', 'y' ] }
851
852##
853# @InputKeyEvent:
854#
855# Keyboard input event.
856#
857# @key:    Which key this event is for.
858# @down:   True for key-down and false for key-up events.
859#
860# Since: 2.0
861##
862{ 'struct'  : 'InputKeyEvent',
863  'data'  : { 'key'     : 'KeyValue',
864              'down'    : 'bool' } }
865
866##
867# @InputBtnEvent:
868#
869# Pointer button input event.
870#
871# @button: Which button this event is for.
872# @down:   True for key-down and false for key-up events.
873#
874# Since: 2.0
875##
876{ 'struct'  : 'InputBtnEvent',
877  'data'  : { 'button'  : 'InputButton',
878              'down'    : 'bool' } }
879
880##
881# @InputMoveEvent:
882#
883# Pointer motion input event.
884#
885# @axis:   Which axis is referenced by @value.
886# @value:  Pointer position.  For absolute coordinates the
887#          valid range is 0 -> 0x7ffff
888#
889# Since: 2.0
890##
891{ 'struct'  : 'InputMoveEvent',
892  'data'  : { 'axis'    : 'InputAxis',
893              'value'   : 'int' } }
894
895##
896# @InputEvent:
897#
898# Input event union.
899#
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
905#
906# Since: 2.0
907##
908{ 'union' : 'InputEvent',
909  'data'  : { 'key'     : 'InputKeyEvent',
910              'btn'     : 'InputBtnEvent',
911              'rel'     : 'InputMoveEvent',
912              'abs'     : 'InputMoveEvent' } }
913
914##
915# @input-send-event:
916#
917# Send input event(s) to guest.
918#
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.
923#
924# Returns: Nothing on success.
925#
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.
936#
937# Since: 2.6
938#
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.
943#
944# Example:
945#
946# 1. Press left mouse button.
947#
948# -> { "execute": "input-send-event",
949#     "arguments": { "device": "video0",
950#                    "events": [ { "type": "btn",
951#                    "data" : { "down": true, "button": "left" } } ] } }
952# <- { "return": {} }
953#
954# -> { "execute": "input-send-event",
955#     "arguments": { "device": "video0",
956#                    "events": [ { "type": "btn",
957#                    "data" : { "down": false, "button": "left" } } ] } }
958# <- { "return": {} }
959#
960# 2. Press ctrl-alt-del.
961#
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": {} }
971#
972# 3. Move mouse pointer to absolute coordinates (20000, 400).
973#
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": {} }
979#
980##
981{ 'command': 'input-send-event',
982  'data': { '*device': 'str',
983            '*head'  : 'int',
984            'events' : [ 'InputEvent' ] } }
985