[PATCH 3/4] pktsize.c: move keypress and packet handling into separate functions