From 73a686feae4327dd23a2d7c350b528ceed5d5119 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Sat, 4 Jan 2025 12:32:24 -0800 Subject: [PATCH v2] Improve the doc of key-valid-p * lisp/keymap.el (key-valid-p): Add an function key and mouse button example. Mention as a cursor control key instead of a function key. Briefly explain what an event may be. --- lisp/keymap.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lisp/keymap.el b/lisp/keymap.el index 3aed1d4b4cac..d1ff52ea3974 100644 --- a/lisp/keymap.el +++ b/lisp/keymap.el @@ -327,21 +327,26 @@ key-valid-p with a single space character separating one key stroke from another. Each key stroke is either a single character, or the name of an -event, surrounded by angle brackets . In addition, any -key stroke may be preceded by one or more modifier keys. Finally, -a limited number of characters have a special shorthand syntax. +event, surrounded by angle brackets . An event may be +pushing a key, clicking on a menu item, pressing a mouse button, etc. +In addition, any key stroke may be preceded by one or more modifier +keys. Finally, a limited number of characters have a special shorthand +syntax. Here are some example of valid key sequences. \"f\" (the key `f') + \"\" (the function key named \"F6\") + \"\" (the mouse button named \"mouse-1\", commonly referred to as + the left button) \"S o m\" (a three-key sequence of the keys `S', `o' and `m') \"C-c o\" (a two-key sequence: the key `c' with the control modifier followed by the key `o') - \"H-\" (the function key named \"left\" with the hyper modifier) + \"H-\" (the cursor control key named \"left\" with the hyper modifier) \"M-RET\" (the \"return\" key with a meta modifier) \"C-M-\" (the \"space\" key with both the control and meta modifiers) -These are the characters that have special shorthand syntax: +These characters have special shorthand syntax: NUL, RET, TAB, LFD, ESC, SPC, DEL. Modifiers have to be specified in this order: -- 2.47.1