B4J Question java.awt.Robot cannot send Ctrl+V in Linux outside the B4J application

hatzisn

Expert
Licensed User
Longtime User
Hi all,

I am using java.awt.Robot to send keys through a B4J app. In windows it works correctly sending Ctrl+V with no problem. Then in Linux I thought it was not working but then I noticed that Ctrl+V does work in the application but not outside of it. I am using Debian 12 in virtualbox. Is there a way to overcome this obstacle?
 

hatzisn

Expert
Licensed User
Longtime User
It is a Wayland issue. On X11 it works correctly. I changed the compatibility to "gnome classic at xorg" (it has to be installed also) and I ran the test command:

Bash:
echo $XDG_SESSION_TYPE

I tried different versions of gnome and when it displayed X11 instead of "wayland" everything worked as expected.
It is also explained here:

 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
It's worth trying if you haven't already don't know the details, but it definitely works differently than Crtl+v. But it's not new enough to have been tailored for Wayland, so fingers crossed.
 
Upvote 0

hatzisn

Expert
Licensed User
Longtime User
It's worth trying if you haven't already don't know the details, but it definitely works differently than Crtl+v. But it's not new enough to have been tailored for Wayland, so fingers crossed.

Hi... Thanks for answering. If I try your solution then I get "symbol not found". Maybe you are using another class.
In oracle site it displays this information:

 
Upvote 0
Top