VirtualKeyboard: Optimize some code a bit more