When an object is in motion?

How do I know when an object is in motion? The problem relates to the object which controls the keyboard and I can not capture the keys and mouse which controls the object.

You can track the movement in an Update function:

var lastPos : Vector3 = Vector3.zero;
var objectToTrack : GameObject; //assign in Inspector or with GameObject.Find (or other)

function Update()
  var velocity = objectToTrack.transform.position - lastPos;
  lastPos = objectToTrack.transform.position;
  // if any component of velocity is non-zero, it's moving