xev
will show you output like this:
KeyRelease event, serial 36, synthetic NO, window 0x3200001,
root 0x530, subw 0x0, time 4335057, (943,136), root:(943,694),
state 0x0, keycode 78 (keysym 0xff14, Scroll_Lock), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False