add keyboard handler test
make gui handler more reliable