David replied to the topic 'Kstars/VNC keyboard issue' in the forum. 7 years ago

Hi there.

I ran into this last year when I was trying to do the same thing (headless VNC display) and couldn't get kstars to speak. I too resorted to exporting a physical X11 display, but this was never satisfactory in my opinion.

Today I ran into the same issues with qtcreator (a programming app). The common link is QT. After a bit of digging it turns out this is a (IMO) bug in QT5 that, if XKEYBOARD extensions are not present (as they're not on the usual headless vncservers, tightvncserver in my case) it defaults to some pre-programmed keyboard mappings.

Any attempts to override them with the environment variables they check for just this purpose failed dismally.

The workaround I've found and tested is to use TigerVNC server instead which does support the XKEYBOARD extension. This, apparently, may not work with all keyboard mappings, but does seem to do the job with my UK Mac one for both qtcreator and kstars. I haven't tried it out on my Pi, but don't see why it shouldn't work if compiled from source.

Have a look, it may solve your problem without needing you to run with actual display hardware:





I've not seen a recurrence since my initial work around, to be honest, so I never got to the bottom of it.

It does seem a strange one, doesn't it? Perhaps some kind of timing issue/race condition and the wrapper simply adds a couple of milliseconds delay whilst it fires up bash?

Difficult to see where it could be coming from, though.