Fix handling of Alt and Ctrl keys