I've done similar detections. Basically just use keyboard dynamics: by measuring the precise timing of keystrokes (key down, key up) you can tell if it is likely typed by a user manually.
I haven't done it but I think mouse movements could be used too. Add onMouseMove event listeners all over the page and see how they are triggered.