Keypress help please

hi i have mx 2004 and would like to know how to make a keypress sctipt for example when key a is down trace (“whatever”)
please help thanks
louis.