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

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