I'll look at the mmap() stuff -- somebody else has been nagging me for it anyway, and it should be the fastest operational method for this. But in the meanwhile, have a go at using /proc/empeg_screen.raw instead, which has lower system loading (but it may "sleep" your read() process briefly while it does a screen grab). Let me know how it works (or not) -- Hijack v145, in about 20 minutes or so.

As for feeding button codes, do it this way (shell script example):
#!/bin/sh

if [ -e /proc/empeg_notify ]; then
echo "BUTTON xxxxxxx" >/proc/empeg_notify
else
## use ioctls() as at present for the hijack-deprived
fi

But that limits things a little, n'est-ce pas? Well, not really, cuz you can also do LONG presses with:
	echo "BUTTON xxxxxxx.L" >/proc/empeg_notify

But that also limits things, so here is how EmpegVNC ought to do it:
	echo "BUTTONRAW 0xxxxxxx" >/proc/empeg_notify

## wait until user lets go of the button/icon, then do:
echo "BUTTONRAW 8xxxxxxx" >/proc/empeg_notify

The last method above allows/requires separate press/release codes for each button (except for knob rotations, which don't have release codes). A list of most/all button codes is in hijack.h in the patchfile.

Cheers