Logging keystrokes of a specific Qube

Hi,
I have a very sensitive Qube AppVM where I want every keystroke entered to be logged. From a discussion with @fepitre , all keystrokes go from dom0 to a qube via a RPC.

I’m wondering where could I find such examples to inspire from, and how to perform this keystroke logging for a Qube.

Thanks !