Sending mouse or touch events to VirtualBox VM from host shell?

后端 未结 1 971
北海茫月
北海茫月 2021-01-20 02:12

I know how to send keyboard events (keystrokes) to a VirtualBox Virtual Machine, using VBoxManage controlvm keyboardputscancode

相关标签:
1条回答
  • 2021-01-20 03:03

    You can do this using Python and https://pypi.org/project/vboxapi/

    from vboxapi import VirtualBoxManager
    
    mgr = VirtualBoxManager(None, None)
    vbox = mgr.getVirtualBox()
    machine = vbox.findMachine('CentOS')
    session = mgr.getSessionObject(vbox)
    machine.LockMachine(session, mgr.constants.LockType_Shared)
    session.Console.Mouse.putMouseEventAbsolute(100,100,0,0,1)
    

    for more information, please see it here

    0 讨论(0)
提交回复
热议问题