Fix issue with keystrokes, for both #1300 and #1282