Handle arrow keys for dialog