Changeset 33061 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 12, 2010 12:42:20 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxShell/vboxshell.py
r32531 r33061 297 297 exec cmds 298 298 299 def printMouseEvent(ctx, mev): 300 print "Mouse: x=%d y=%d z=%d" %(mev.x, mev.y, mev.z) 301 302 def printKbdEvent(ctx, kev): 303 print "Kbd: ", ctx['global'].getArray(kev, 'scancodes') 304 299 305 def monitorSource(ctx, es, active, dur): 300 306 def handleEventImpl(ev): … … 317 323 else: 318 324 print "pointer shape event: w=%d h=%d shape len=%d" %(psev.width, psev.height, len(shape)) 325 elif type == ctx['global'].constants.VBoxEventType_OnGuestMouseEvent: 326 mev = ctx['global'].queryInterface(ev, 'IGuestMouseEvent') 327 if mev: 328 printMouseEvent(ctx, mev) 329 elif type == ctx['global'].constants.VBoxEventType_OnGuestKeyboardEvent: 330 kev = ctx['global'].queryInterface(ev, 'IGuestKeyboardEvent') 331 if kev: 332 printKbdEvent(ctx, kev) 319 333 320 334 class EventListener: … … 1345 1359 return 0 1346 1360 1361 def monitorGuestKbdCmd(ctx, args): 1362 if (len(args) < 2): 1363 print "usage: monitorGuestKbd name (duration)" 1364 return 0 1365 mach = argsToMach(ctx,args) 1366 if mach == None: 1367 return 0 1368 dur = 5 1369 if len(args) > 2: 1370 dur = float(args[2]) 1371 active = False 1372 cmdExistingVm(ctx, mach, 'guestlambda', [lambda ctx,mach,console,args: monitorSource(ctx, console.keyboard.eventSource, active, dur)]) 1373 return 0 1374 1375 def monitorGuestMouseCmd(ctx, args): 1376 if (len(args) < 2): 1377 print "usage: monitorGuestMouse name (duration)" 1378 return 0 1379 mach = argsToMach(ctx,args) 1380 if mach == None: 1381 return 0 1382 dur = 5 1383 if len(args) > 2: 1384 dur = float(args[2]) 1385 active = False 1386 cmdExistingVm(ctx, mach, 'guestlambda', [lambda ctx,mach,console,args: monitorSource(ctx, console.mouse.eventSource, active, dur)]) 1387 return 0 1347 1388 1348 1389 def monitorVBoxCmd(ctx, args): … … 2825 2866 'guest':['Execute command for guest: guest Win32 \'console.mouse.putMouseEvent(20, 20, 0, 0, 0)\'', guestCmd, 0], 2826 2867 'monitorGuest':['Monitor what happens with the guest for some time: monitorGuest Win32 10', monitorGuestCmd, 0], 2868 'monitorGuestKbd':['Monitor guest keyboardfor some time: monitorGuestKbd Win32 10', monitorGuestKbdCmd, 0], 2869 'monitorGuestMouse':['Monitor guest keyboardfor some time: monitorGuestMouse Win32 10', monitorGuestMouseCmd, 0], 2827 2870 'monitorVBox':['Monitor what happens with Virtual Box for some time: monitorVBox 10', monitorVBoxCmd, 0], 2828 2871 'portForward':['Setup permanent port forwarding for a VM, takes adapter number host port and guest port: portForward Win32 0 8080 80', portForwardCmd, 0],
Note:
See TracChangeset
for help on using the changeset viewer.