fixes file transmission bug that appends a character

and added keycode that can be used to determine the which keys are
pressed by user…