Check-in [50904ddda0]
Not logged in
Overview
Comment:Added sendkey command
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 50904ddda05bd783694b7ba9bebdbf4ca453bfef
User & Date: vitus on 2016-03-24 07:34:32
Other Links: manifest | tags
Context
2016-04-05
13:37
Fixed some pylint warnings check-in: 0fda55579a user: vitus tags: trunk
2016-03-24
07:34
Added sendkey command check-in: 50904ddda0 user: vitus tags: trunk
2016-02-22
10:10
Fix handling of relative path in --install option of create command check-in: 32b7960ce4 user: vitus tags: trunk
Changes

Modified vws from [2dc71bb74e] to [ef68b74609].

159
160
161
162
163
164
165

166
167
168
169
170
171
172
            send_command(options.sock, "delvm " + snapshot_id)
    else:
        if options.snapshot or options.args:
            print >>sys.stderr, ("Cannot change qemu options. " +
                                 "VM is already running")
        if options.cdrom:
            options.file = options.cdrom[0]

            cmd_cdrom(options)
    if options.gui:
        uri = spiceurl(options)
        os.system((config.get('tools', 'viewer') + "&") % uri)
    elif not options.stopped:
        print >>sys.stderr, "VM already running"








>







159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
            send_command(options.sock, "delvm " + snapshot_id)
    else:
        if options.snapshot or options.args:
            print >>sys.stderr, ("Cannot change qemu options. " +
                                 "VM is already running")
        if options.cdrom:
            options.file = options.cdrom[0]
            options.id = None
            cmd_cdrom(options)
    if options.gui:
        uri = spiceurl(options)
        os.system((config.get('tools', 'viewer') + "&") % uri)
    elif not options.stopped:
        print >>sys.stderr, "VM already running"

352
353
354
355
356
357
358





359
360
361
362
363
364
365
    answer = send_command(options.sock, "info capture")
    match = re.search('\\[(\\d+)\\]: ', answer)
    if not match:
        print >>sys.stderr, "No sound recording in progress"
        sys.exit(1)
    else:
        print send_command(options.sock, "stopcapture " + match.group(1))





def cmd_version(dummy_options):
    """ vws cersion """
    print VERSION


def cmd_snapshot(options):
    """ vws snapshot - create snapshot """







>
>
>
>
>







353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
    answer = send_command(options.sock, "info capture")
    match = re.search('\\[(\\d+)\\]: ', answer)
    if not match:
        print >>sys.stderr, "No sound recording in progress"
        sys.exit(1)
    else:
        print send_command(options.sock, "stopcapture " + match.group(1))

def cmd_sendkey(options):
    """ vws sendkey """
    print send_command(options.sock,"sendkey "+options.keyspec);
    
def cmd_version(dummy_options):
    """ vws cersion """
    print VERSION


def cmd_snapshot(options):
    """ vws snapshot - create snapshot """
708
709
710
711
712
713
714


715
716
717
718
719
720
721
p = new_command(cmds, 'snapshots', help='List existing snapshots')
# Screenshoits and recording
p = new_command(cmds, 'screenshot', help='take a screenshot')
p.add_argument('filename', help='PPM image filename to write screenshot to')
p = new_command(cmds, 'record', help='Record audio output from VM')
p.add_argument('filename', help='wav file to record autdio to')
new_command(cmds, 'stoprecord', help='stop recording audio')


# Create new VM
p = new_command(cmds, 'create', help="Create new VW")
p.add_argument("--no-usb", help="Disable USB controller", action='store_const',
               const=False, default=True, dest="usb")
p.add_argument("--size", metavar='size', help="Size of primary disk images",
               dest="size", default=config.get('create options', 'size'))
p.add_argument("--arch", metavar='cputype', help="Emulated architecture",







>
>







714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
p = new_command(cmds, 'snapshots', help='List existing snapshots')
# Screenshoits and recording
p = new_command(cmds, 'screenshot', help='take a screenshot')
p.add_argument('filename', help='PPM image filename to write screenshot to')
p = new_command(cmds, 'record', help='Record audio output from VM')
p.add_argument('filename', help='wav file to record autdio to')
new_command(cmds, 'stoprecord', help='stop recording audio')
p = new_command(cmds, 'sendkey', help='Send a keystroke to VM')
p.add_argument('keyspec',help='key specification like ctrl-alt-delete');
# Create new VM
p = new_command(cmds, 'create', help="Create new VW")
p.add_argument("--no-usb", help="Disable USB controller", action='store_const',
               const=False, default=True, dest="usb")
p.add_argument("--size", metavar='size', help="Size of primary disk images",
               dest="size", default=config.get('create options', 'size'))
p.add_argument("--arch", metavar='cputype', help="Emulated architecture",

Modified vws.mkd from [b8823e1241] to [9774ce70a4].

42
43
44
45
46
47
48


49
50
51
52
53
54
55

**vws screenshot** *name* *filename.ppm*

**vws record** *name* *filename.wav*

**vws stoprecord**  *name*



**vws monitor** *name*

**vws spiceuri** *name*

**vws version** 

DESCRIPTION







>
>







42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

**vws screenshot** *name* *filename.ppm*

**vws record** *name* *filename.wav*

**vws stoprecord**  *name*

**vws sendkey** *name* *keyspec*

**vws monitor** *name*

**vws spiceuri** *name*

**vws version** 

DESCRIPTION
258
259
260
261
262
263
264


































265
266
267
268
269
270
271
**monitor** command running.

**vws spiceuri** *machine*

Prints out URI you should feed into your spice viewer to access this
machine.




































CONFIGURATION FILE
==================

Configuration file for [vws], which uses standard .ini format.

There are following sections







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
**monitor** command running.

**vws spiceuri** *machine*

Prints out URI you should feed into your spice viewer to access this
machine.


**vws sendkey** *machine* *keyspec*

Allows to send some key combination to the virtual machine. For example
if windows screen is locked spice client is sometimes unable to deliver
key stroke to the virtual machine in order to get it out of sleep. 

In this case **vws sendkey** *machine* **ctrl-alt-delete** helps.

One **vws sendkey** command sends only one key combination

See **KEY SPECS** below about format of key specification.

KEY SPECS
=========

Following key names are avalable:

shift shift_r alti alt_r altgr altgr_r ctrl ctrl_r menu

esc	1 2 3 4 5 6 7 8
9 0 minus  equal backspace  tab
q w e r t y u i o p ret 
a s d f  g  h  j k l
z  x  c  v b n m  comma  dot  slash
asterisk  spc  caps_lock  f1  f2  f3 f4  f5  f6  f7  f8  f9
f10  num_lock  scroll_lock  kp_divide  kp_multiply
kp_subtract kp_add  kp_enter  kp_decimal  sysrq  kp_0  kp_1
kp_2  kp_3  kp_4  kp_5  kp_6  kp_7 kp_8  kp_9  <  f11  f12  
print home  pgup  pgdn  end  left  up
down  right  insert  delete

Several key names can be joined together with '-' sign to form key with
modificators sequence.

CONFIGURATION FILE
==================

Configuration file for [vws], which uses standard .ini format.

There are following sections