Displaced mouse throu vboxwebsvr
-
- Posts: 8
- Joined: 30. Mar 2023, 22:40
Displaced mouse throu vboxwebsvr
Trying to control virtualbox programatically some unexpected behaviour occoure. The mouse is displaced. I call putMouseEventAbsolute and then putMouseEvent
but the position of the mouse is wrong. By this forum I am not allowed to reference the handbook here.
I am using virtualbox 7.0.6 r155176 (Qt 5.15.8)
but the position of the mouse is wrong. By this forum I am not allowed to reference the handbook here.
I am using virtualbox 7.0.6 r155176 (Qt 5.15.8)
-
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows, Linux
Re: Displaced mouse throu vboxwebsvr
Moved to "Virtualbox API" for the deep gurus to ponder.
-
- Site Moderator
- Posts: 5231
- Joined: 13. Jan 2012, 11:14
- Primary OS: Debian other
- VBox Version: OSE Debian
- Guest OSses: Debian, Win 2k8, Win 7
- Contact:
Re: Displaced mouse throu vboxwebsvr
Please read the Posting Guidelines and provide all listed information please.Scott Grim wrote:Trying to control virtualbox programatically some unexpected behaviour occoure. The mouse is displaced. I call putMouseEventAbsolute and then putMouseEvent
but the position of the mouse is wrong. By this forum I am not allowed to reference the handbook here.
I am using virtualbox 7.0.6 r155176 (Qt 5.15.8)
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Manage your VirtualBox infrastructure the free way!
-
- Posts: 8
- Joined: 30. Mar 2023, 22:40
Re: Displaced mouse throu vboxwebsvr
I tried but can not for some wierd reason: Because I am not member for at least one day since last year. I try to post it step by step.
I am using virtualbox 7.0.6 r155176 (Qt 5.15.8)
I am using virtualbox 7.0.6 r155176 (Qt 5.15.8)
-
- Posts: 8
- Joined: 30. Mar 2023, 22:40
Re: Displaced mouse throu vboxwebsvr
The API is generated automatically throu webservice.
-
- Posts: 8
- Joined: 30. Mar 2023, 22:40
Re: Displaced mouse throu vboxwebsvr
The Connection type (Webservice) is Webservice throu vboxwebsrv.
The language used is java.
The os used is
The language used is java.
The os used is
-
- Posts: 8
- Joined: 30. Mar 2023, 22:40
Re: Displaced mouse throu vboxwebsvr
THE OS used is linux
-
- Posts: 8
- Joined: 30. Mar 2023, 22:40
Re: Displaced mouse throu vboxwebsvr
The standalone code is:
Code: Select all
VirtualBoxManager manager = VirtualBoxManager.createInstance(null);
private IVirtualBox connect() throws IOException, FileNotFoundException {
manager.connect("http://localhost:18083", "user", "pass");
return manager.getVBox();
}
public void testMousePos() throws Exception {
IVirtualBox box = connect();
for (IMachine machine : box.getMachines()) {
if (machine.getState() == MachineState.Running) {
ISession session = manager.getSessionObject();
machine.lockMachine(session, LockType.Shared);
try {
IConsole console = session.getConsole();
IMouse mouse = console.getMouse();
mouse.putMouseEventAbsolute(200, 200, 0, 0, 0x00);
mouse.putMouseEvent(10, 10, 0, 0, 0x00);
} finally {
session.unlockMachine();
}
}
}
}
-
- Posts: 8
- Joined: 30. Mar 2023, 22:40
Re: Displaced mouse throu vboxwebsvr
Sorry the requirements point out that: "Make sure your code is readable/documented" and can run without dependencies is not possible. I will not place the JDK in here because the JDK is pretty huge, please download the jdk by yourself instead.
It is very hard to meet the posting guidelines. I posted more informations elsewhere but am not allowed to tell where.
It is very hard to meet the posting guidelines. I posted more informations elsewhere but am not allowed to tell where.
-
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows, Linux
Re: Displaced mouse throu vboxwebsvr
Scott, you should be past the one day no links limit now.
-
- Posts: 8
- Joined: 30. Mar 2023, 22:40