A script that will assign "q" and "e" to horizontal rotation of character?

I’ve been trying to do a script that will assign rotation or translation values of character movement left and right to the q and e keys, but have failed miserably in getting whatever I come up with to work.

I’ve also been trying to do the same using mouse click + mouse move to invoke rotation, but the script I write for that falls through as well, I’m frustrated trying to figure this thing out for several hours.

Please help, preferably Javascript is what I work with

Which part are you having trouble with - the input getting or the rotation-doing?

Input getting

if (Input.GetKeyDown ("q"))
    print ("q");

For rotation, assuming your character never tilts, you can simply rotate around the y-axis.