SDL read keys while out of focus

I am wondering is it possible to make some kind of global key hook on Linux so
that my SDL application can still catch keyboard events if it’s window does not
have a focus (for example I launched external application from it).

Anyone did this?