Try a app called Tasker. It is the most complete automation suite for android. Not sure bout using it as a keylogger, but it can be used to record phone calls in the background, take screen shots,...