It is not possible to reliable simulate key-events when running in Xvfb, whereas a "native" X-Server does not cause any problems. Some key-events are received by the client-application twice, others get completly lost. I first thought this is a specific problem of the library I used for this task (java.awt.Robot class in java) and wrote my own library in plain C using XTest which is heavily based on the code of Xvkbd-2.7 and it shows exactly the same sympthoms. If I insert a wait of 200ms after each key everything works like expected with both libraries (100ms do not work). For my testing I used Xvfb delivered with Xorg-6.8.2, running with the following flags: Xvfb :1 -screen :1 500x1000x24 -fbdir /tmp/ I attached a a test-case which is derivated from xkdbd-2.7 which shows the problem (have a look at main() of CRobot.c) and a simple bash-script to compile the test-case. Note: Although the Xtest-code is really ugly hacked withought any deep knowledge whats going on behind the scenes (thats why I unmap Xkdbd's main-window immediatly after creating it instead of not mapping it at all) I think its a bug in Xvfb since I had absolutly the same problems when using java.awt.Robot from Java which does only provide low-level keyPressed/keyReleased methods. Note that this problem sometimes shows up and sometimes not. I already tried to find it myself, however I think I lack too much x knowledge :-( Good luck with fixing it, lg Clemens
Created attachment 3552 [details] Test-case modified xvfkbd-source, see main() in CRobot.c
btw. if needed I could also create a testcase written in java using the java.awt.Robot class which shows the same problem independent of the ugly hacked code testcase I've submitted.
Sorry about the phenomenal bug spam, guys. Adding xorg-team@ to the QA contact so bugs don't get lost in future.
wow, this was 3,5y ago :-/
can't believe it - I filed this bug 6 years ago ;)
This is not a bug with the keyboard driver. Xvfb doesn't even use the keyboard driver. Do you have the problem when using teh Xorg DDX with the xf86-video-nested driver?
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/191.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.