patch 9.1.0563: Cannot process any Key event
Problem: Cannot process any Key event
Solution: Add the KeyInputPre autocmd
(Shougo Matsushita)
closes: #15182
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
Co-authored-by: K.Takata <kentkt@csc.jp>
Signed-off-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 23f1cbf..1e9c896 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -1,4 +1,4 @@
-*autocmd.txt* For Vim version 9.1. Last change: 2024 Jul 09
+*autocmd.txt* For Vim version 9.1. Last change: 2024 Jul 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -439,6 +439,8 @@
|CompleteDone| after Insert mode completion is done, after clearing
info
+|KeyInputPre| just before a key is processed
+
|User| to be used in combination with ":doautocmd"
|SigUSR1| after the SIGUSR1 signal has been detected
@@ -977,6 +979,21 @@
*InsertLeave*
InsertLeave Just after leaving Insert mode. Also when
using CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|.
+ *KeyInputPre*
+KeyInputPre Just before a key is processed. The pattern is
+ matched against a string that indicates the
+ current mode, which is the same as what is
+ returned by `mode(1)`.
+ The |v:char| variable indicates the key typed
+ and can be changed during the event to process
+ a different key. When |v:char| is not a
+ single character or a special key, the first
+ character is used.
+ The following values of |v:event| are set:
+ typed The key is typed or not.
+ It is not allowed to change the text
+ |textlock| or the current mode.
+ {only with the +eval feature}
*MenuPopup*
MenuPopup Just before showing the popup menu (under the
right mouse button). Useful for adjusting the