Modified simulating key events.