Keygrab is a fullscreen key grabber that sends messages to Pure Data. Using the [netreceive 17777] object, you can receive keyboard events from a GTK window in Pure Data. See the patch in /usr/share/doc/keygrab/example.pd. The shortcut to toggle fullscreen mode is currently Control-Shift-F8.
Get the latest Ubuntu package at the download page.
Read the man page and try the Pure Data patch. See the open issues for things that are left to do.
See the ReleaseProcess page.