Looks like it is easy to log keystrokes of all processes of the same user. A basic keylogger is 'xinput'.
The command generates log of all key-presses. Unfortunately, this includes passwords in gnome-terminal. Googling suggested that grabbing keyboard may prevent other windows from capturing key strokes.
Is there a way to prevent XI2 logging in gnome-terminal? Or is there an X terminal that has this feature?