2

I've been directed to try and make a small proof of concept. In order to make it work, I need to be able to move a mouse onto an xvfb-generated virtual display. Is this possible? I can't seem to find any way to get the mouse onto the virtual screen, since it's not really "connected" to the other screens.

I'm using a perl script to automate some mouse movements, so the end-goal is to get my script to move the mouse onto that screen, but I suspect the first step is to just get my mouse onto the xvfb screen, then from there figure out how to automate the action using perl.

Edit: If it matters, I'm on RHEL.

Edit 2: Also, I'm using X11::GUITest

Kulahan
  • 512
  • 1
  • 9
  • 23
  • 1
    Can you clarify "move mouse Onto screen" ? Do you really want to move the mouse, or just to send "Mouse movement" events to the program running inside XVFB ? Most program do not query the mouse position, instead they get mouse movement, or mouse click. – dash-o Jun 14 '20 at 15:02
  • 1
    It will also help if you provide information about the program that you are trying to control - what kind of GUI tool it uses (GTK, ...), some of the toolkit provide a way to replay events. – dash-o Jun 14 '20 at 15:03
  • We use X11:GUITest for our screen interactions. It looks like, right now, we utilize MoveMouseAbs(x,y) to get our mouse to our desired location, as an example. I'm having a hard time finding documentation on how that works, though so I'm not sure if I can overload it to support moving it to the correct XServer – Kulahan Jun 15 '20 at 21:40
  • Also, I suppose sending mouse movement events to the program could potentially work - do you have a good resource for reading up on that? I'll do some searching on my own as well. – Kulahan Jun 15 '20 at 21:41
  • 1
    If you use 'MoveMouseAbs' (with the DISPLAY pointing to the XVFB port), it should move the (XVFB) mouse for the application (by sending mouse movement).You do not need to display the XVFB, or move physical mouse into the XVFB. You might have to "Click" on the mouse, depending on the way the window manager/application is set to get the FOCUS into the application. – dash-o Jun 16 '20 at 07:00
  • Okay, it looks like my issue lies elsewhere, then. Thanks for the help! – Kulahan Jun 16 '20 at 18:16

1 Answers1

0

If you use TK there is a module for you to do this: https://metacpan.org/pod/Tk::CursorControl