Need to give input once logged in to server in script

Hi ,
when i am logging to the server i need to give input of specific key like k or l or m etc. and then need to put enter. need to use this in script . please assist.

A bit more info would be nice. What protocol/terminal client do you use? Have a look into the tool expect .