self made test for creating and using key events