terminal: decode_terminal_escape_sequence ignores previous value of *ev. There is no need to check whether ev->ev == EVENT_KBD; if decode_terminal_escape_sequence called decode_terminal_mouse_escape_sequence, then the former neither modified kbd.key nor passed &kbd to the latter, so kbd.key remains KBD_UNDEF.
If ev->ev was not checked, then it should not be trusted either.
So reinitialize the whole *ev if a keyboard event was indeed found.
---
commit 637a41b0a4f69328e4acd6bef723966d44cf2ffa
tree a73ec568f40c5a0faf8b7674af34ec6c3871ef69
parent 129c5bb4dcafbfcf62d75c3e02db45699fb56536
author Kalle Olavi Niemitalo <[EMAIL PROTECTED]> Sat, 05 Aug 2006 11:08:48 +0300
committer Kalle Olavi Niemitalo <[EMAIL PROTECTED]> Sat, 05 Aug 2006 20:00:28 +0300
src/terminal/kbd.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/terminal/kbd.c b/src/terminal/kbd.c
index 84a8d02..6aeb297 100644
--- a/src/terminal/kbd.c
+++ b/src/terminal/kbd.c
@@ -770,10 +770,9 @@ #endif /* CONFIG_MOUSE */
break;
}
- /* The event might have been changed to a mouse event */
- if (ev->ev == EVENT_KBD && kbd.key != KBD_UNDEF) {
- copy_struct(&ev->info.keyboard, &kbd);
- }
+ /* KBD_UNDEF here means it was unrecognized or a mouse event. */
+ if (kbd.key != KBD_UNDEF)
+ set_kbd_term_event(ev, kbd.key, kbd.modifier);
return el;
}
pgpeTJ4VTmpOF.pgp
Description: PGP signature
_______________________________________________ elinks-dev mailing list [email protected] http://linuxfromscratch.org/mailman/listinfo/elinks-dev
