Use EVT_CHAR instead of EVT_KEY_UP (fixes the case in which a key is
already down when the dialog appears)