[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: SDL, VNC and ARAnyM



Hi Thorsten,

On 13 August 2013 22:30, Thorsten Glaser <tg@debian.org> wrote:
[...] Which is why I was hoping for an SDL VNC backend, so I can just
run ARAnyM in the background and connect to it using VNC possibly
over SSH. Maybe that would get the keys right…?

I've spent some time this evening getting it running again, and tried out the SDL test "testwm".  All the keys appear to be understood correctly through the VNC driver in the same way a local client would, with the exception that NumLock status is not propagated when using VNC.

I haven't tried running it with ARAnyM yet.

The input layer is handled in src/video/vnc/SDL_vncevents.c.  It provides some basic translation between the event types, as the SDL and libVNC events are nearly the same.

Depending on your local keyboard layout, you may get some strange behaviour from the keysym vs. scancode value of the key.  I believe it will output scancodes that correspond to the ASCII value of that letter, as VNC does not pass layout information.

I'll have to investigate making it pretend to have a particular keyboard layout on the server side, because applications like emulators will be passing the scancode to the guest OS for the guest OS to translate into the correct keymap.

I think there is also some strange behaviour with handling upper-case letters, it may be passing the wrong scancodes for those.

I was personally using the driver with non-input applications, so I've only had a small look at getting input to function.
 
How’s the status of integrating your backend into SDL 1.2 “proper”?
(Since SDL 2.0 is brand-new no applications are using it yet, so
that’s future music.)

I attempted to do this at the time I wrote it, and the SDL developers weren't receptive to the idea of implementing new features into SDL 1.2, and encouraged me to port it to, at the time, SDL 1.3 (which is now SDL 2.0).

I didn't have an interest in doing this myself, because as you've pointed out, everything is still using SDL 1.2.
 
Would integrating the patch as-is (it’s from 2010 AFAICT!) into
distro packaging of SDL 1.2 break anything (if the VNC backend
is not selected)? If not I’d probably try to get it into Debian
or, if must be, roll my own packages. (Best would be if it could
just be installed as a plugin that SDL loads when prompted, but
I have no idea whether that’s possible.)

It doesn't change anything except add a VNC driver.  When SDL is built with VNC support it will build it into libSDL.so like any other video driver (directfb, x11, etc.).

VNC doesn't activate by default -- it needs to be manually enabled at build time, and additionally manually enabled at runtime with the SDL_VIDEODRIVER environment variable.  I believe in Debian that'd mean it either has to be enabled all of the time, or have some other `libsdl1.2debian-vnc` package which has a SDL build with this option enabled.

I've rolled another version of this patched against SDL 1.2.15 and it appears to work with very minimal merge problems.  I've put this in a Git repository on the `sdlvnc` branch: https://github.com/micolous/sdl.git

I've got some other feedback in my inbox from about 2 years ago which I'll need to dig up, as there is a memory leak in the driver to fix.  I may have integrated it somewhere before, but I don't have an online copy of it.

I hope this helps you.

Regards,


Michael
 


Reply to: