add key press action judge, otherwise the code will run twice after key press

Signed-off-by: ymback <ymback@sayyoulove.me>