Reimplement keyPressEvent for the widget.