Short version:
Long version:
For various reasons, at the end of August I decided that I needed to get off my butt and learn C++. Naturally, this meant picking a project. Naturally, this meant a project to solve some kind of problem. Naturally, this meant a problem involving IRIX.
The problem I chose to solve was how unbelievably annoying it was to set up and use my SGIs. I have a capture card in my PC so I don't have to lug another monitor onto my desk, but that still leaves the problem of having 2 keyboards and mice. The solution is Cursor Magic, a pair of programs that communicate over the network so that using the connected SGI is similar to RDP or a VM.
Cursor and keyboard input is simulated using the XTest library; it should be transparent to all software.
The PC with the capture card is referred to as the "lord". The SGI (or other computer) being passed through and controlled is referred to as the "serf".
Existing feature set:
- Mouse position in capture window is sent to serf.
- Keyboard strokes are sent to serf when mouse is in capture window.
- Bi-directional clipboard for text (so long as the amount of copied text is under the X11 INCR size of 256K).
- first-pass of a GUI-driven profile system, for configuring both default settings and settings that are different for each serf.
There are still some things to come like video recording, more expansive profile controls, and possibly more sharable clipboard formats. However, the main features are implemented.
At present this only works with AVerMedia capture cards. Ideally, Cursor Magic would support DirectShow. We shall see, I haven't looked into that since I started this project (and I have learned a lot since then).
There is a lack of defensive coding. I know of many "not-normal, but foreseeable" situations that would cause undefined, potentially lockup behaviour. This situation is highest on my priority list. That said, it has been a long time since I have managed to break X11 such that it required a system reboot, so I'm moving in the right direction :p
Never ever EVER send X11 a "mouse button up" event when the mouse button is not in the depressed state. EVER.
Platforms:
At one point I compiled and ran the IRIX serf under Linux Mint and it worked perfectly. More recently, I tried this again and it would compile but did not actually do anything. I'm sure it's just a matter of a little debugging. In general, this serf application should compile for any POSIX-compliant Unix-like that uses X11R6 or later and has a C++ compiler. It would be nice to patch out the R6 requirement at some point, but that requires completely re-architecting the serf program to keep all X11 calls on one thread (which would be a PITA, but is doable).
The protocol is designed so that it is easy to create additional serf applications for more platforms. There is no reason I could not write a Serf application for early Windows machines, or any other OS that provides some means of simulating mouse/keyboard (sorry Wayland -_-). Expect a Windows 95/98+ implementation at some point.
It would be practical to backport this serf code to C; it does not use classes but it does use a few things from the STL (which could be re-implemented or replaced).
Performance:
On this 150MHz Indy, there is a noticeable bump in gr_osview CPU usage each time an input message is processed. I believe that this is down to the XTest library. So long as you keep the mouse polling rate down, it's not too bad. I've found 20 Ms polling to provide a nice balance of responsiveness and CPU usage. Mouse messages are only sent while the mouse is moving within the window.
Where can I get it:
I'm not ready to release this yet, especially because I plan to make some changes to the protocol. However, if you actually have an AVerMedia capture card and you really want to try out CursorMagic, contact me and I'll give you development builds of the lord and serf applications.
Once I am ready to release, both the binaries and source code will be made available from this post.