I want to run a function every time the user presses any key. I have already looked through the autocommand documentation and there does not seem to be one for this. Is there any function I do not know of that will detect any keypress?
There is not a direct way in vim to hook all key presses. If you are open to source modifications, one idea would be to edit the source code of the gtk version of vim.
However, there are a number of events which you can hook into; e.g.,
au CursorMoved,CursorMovedI,TextChanged,TextChangedP,CmdlineEnter,CmdlineLeave,CmdlineChanged * call cmd()
You can come up with key presses that don't raise one of these autocmds, but it would be rare in a normal editing session.