Show
Ignore:
Timestamp:
08/10/06 11:19:54 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lispref/commands.texi

    r4131 r4140  
    10881088 
    10891089Most of the time, it's not useful to distinguish the two.  So normally 
    1090 @code{function-key-map} (@pxref{Translating Input}) is set up to map 
     1090@code{function-key-map} (@pxref{Translation Keymaps}) is set up to map 
    10911091@code{tab} into 9.  Thus, a key binding for character code 9 (the 
    10921092character @kbd{C-i}) also applies to @code{tab}.  Likewise for the other 
     
    20522052and @code{sit-for} in @ref{Waiting}.  @xref{Terminal Input}, for 
    20532053functions and variables for controlling terminal input modes and 
    2054 debugging terminal input.  @xref{Translating Input}, for features you 
    2055 can use for translating or modifying input events while reading them. 
     2054debugging terminal input. 
    20562055 
    20572056  For higher-level input facilities, see @ref{Minibuffers}. 
     
    20602059* Key Sequence Input::          How to read one key sequence. 
    20612060* Reading One Event::           How to read just one event. 
     2061* Event Mod::                   How Emacs modifies events as they are read. 
    20622062* Invoking the Input Method::   How reading an event uses the input method. 
    20632063* Quoted Character Input::      Asking the user to specify a character. 
     
    20892089 
    20902090Reading a key sequence includes translating the events in various 
    2091 ways.  @xref{Translating Input}. 
     2091ways.  @xref{Translation Keymaps}. 
    20922092 
    20932093The argument @var{prompt} is either a string to be displayed in the 
     
    22912291@end defvar 
    22922292 
     2293@node Event Mod 
     2294@subsection Modifying and Translating Input Events 
     2295 
     2296  Emacs modifies every event it reads according to 
     2297@code{extra-keyboard-modifiers}, then translates it through 
     2298@code{keyboard-translate-table} (if applicable), before returning it 
     2299from @code{read-event}. 
     2300 
     2301@c Emacs 19 feature 
     2302@defvar extra-keyboard-modifiers 
     2303This variable lets Lisp programs ``press'' the modifier keys on the 
     2304keyboard.  The value is a character.  Only the modifiers of the 
     2305character matter.  Each time the user types a keyboard key, it is 
     2306altered as if those modifier keys were held down.  For instance, if 
     2307you bind @code{extra-keyboard-modifiers} to @code{?\C-\M-a}, then all 
     2308keyboard input characters typed during the scope of the binding will 
     2309have the control and meta modifiers applied to them.  The character 
     2310@code{?\C-@@}, equivalent to the integer 0, does not count as a control 
     2311character for this purpose, but as a character with no modifiers. 
     2312Thus, setting @code{extra-keyboard-modifiers} to zero cancels any 
     2313modification. 
     2314 
     2315When using a window system, the program can ``press'' any of the 
     2316modifier keys in this way.  Otherwise, only the @key{CTL} and @key{META} 
     2317keys can be virtually pressed. 
     2318 
     2319Note that this variable applies only to events that really come from 
     2320the keyboard, and has no effect on mouse events or any other events. 
     2321@end defvar 
     2322 
     2323@defvar keyboard-translate-table 
     2324This variable is the translate table for keyboard characters.  It lets 
     2325you reshuffle the keys on the keyboard without changing any command 
     2326bindings.  Its value is normally a char-table, or else @code{nil}. 
     2327(It can also be a string or vector, but this is considered obsolete.) 
     2328 
     2329If @code{keyboard-translate-table} is a char-table 
     2330(@pxref{Char-Tables}), then each character read from the keyboard is 
     2331looked up in this char-table.  If the value found there is 
     2332non-@code{nil}, then it is used instead of the actual input character. 
     2333 
     2334Note that this translation is the first thing that happens to a 
     2335character after it is read from the terminal.  Record-keeping features 
     2336such as @code{recent-keys} and dribble files record the characters after 
     2337translation. 
     2338 
     2339Note also that this translation is done before the characters are 
     2340supplied to input methods (@pxref{Input Methods}).  Use 
     2341@code{translation-table-for-input} (@pxref{Translation of Characters}), 
     2342if you want to translate characters after input methods operate. 
     2343@end defvar 
     2344 
     2345@defun keyboard-translate from to 
     2346This function modifies @code{keyboard-translate-table} to translate 
     2347character code @var{from} into character code @var{to}.  It creates 
     2348the keyboard translate table if necessary. 
     2349@end defun 
     2350 
     2351  Here's an example of using the @code{keyboard-translate-table} to 
     2352make @kbd{C-x}, @kbd{C-c} and @kbd{C-v} perform the cut, copy and paste 
     2353operations: 
     2354 
     2355@example 
     2356(keyboard-translate ?\C-x 'control-x) 
     2357(keyboard-translate ?\C-c 'control-c) 
     2358(keyboard-translate ?\C-v 'control-v) 
     2359(global-set-key [control-x] 'kill-region) 
     2360(global-set-key [control-c] 'kill-ring-save) 
     2361(global-set-key [control-v] 'yank) 
     2362@end example 
     2363 
     2364@noindent 
     2365On a graphical terminal that supports extended @acronym{ASCII} input, 
     2366you can still get the standard Emacs meanings of one of those 
     2367characters by typing it with the shift key.  That makes it a different 
     2368character as far as keyboard translation is concerned, but it has the 
     2369same usual meaning. 
     2370 
     2371  @xref{Translation Keymaps}, for mechanisms that translate event sequences 
     2372at the level of @code{read-key-sequence}. 
     2373 
    22932374@node Invoking the Input Method 
    22942375@subsection Invoking the Input Method