So long as the computer that you are writing about is owned by the person who places the key-logger on it or a computer surveillance program there is nothing illegal or improper under the laws of all states with respect to what was done. Most employers do such on the computers that are loaned out to employees as a security measure.