Fix virtual keyboard exit (issue #1775)