comparison lisp/w32-fns.el @ 105009:b520d55cdd72

* simple.el: Add mapping for backspace/delete/clear/tab/escape/return to function-key-map, and give them ascii-character property. * term/x-win.el (x-alternatives-map): * term/ns-win.el (ns-alternatives-map): * term/internal.el (msdos-key-remapping-map): * w32-fns.el (x-alternatives-map): Remove redundant mappings.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 14 Sep 2009 01:22:42 +0000
parents 68150c643e2e
children f937670ddf40
comparison
equal deleted inserted replaced
105008:b9b9c3b2718d 105009:b520d55cdd72
32 ;;;; Function keys 32 ;;;; Function keys
33 33
34 (defvar x-alternatives-map 34 (defvar x-alternatives-map
35 (let ((map (make-sparse-keymap))) 35 (let ((map (make-sparse-keymap)))
36 ;; Map certain keypad keys into ASCII characters that people usually expect. 36 ;; Map certain keypad keys into ASCII characters that people usually expect.
37 (define-key map [backspace] [127])
38 (define-key map [delete] [127])
39 (define-key map [tab] [?\t])
40 (define-key map [linefeed] [?\n])
41 (define-key map [clear] [?\C-l])
42 (define-key map [return] [?\C-m])
43 (define-key map [escape] [?\e])
44 (define-key map [M-backspace] [?\M-\d]) 37 (define-key map [M-backspace] [?\M-\d])
45 (define-key map [M-delete] [?\M-\d]) 38 (define-key map [M-delete] [?\M-\d])
46 (define-key map [M-tab] [?\M-\t]) 39 (define-key map [M-tab] [?\M-\t])
47 (define-key map [M-linefeed] [?\M-\n]) 40 (define-key map [M-linefeed] [?\M-\n])
48 (define-key map [M-clear] [?\M-\C-l]) 41 (define-key map [M-clear] [?\M-\C-l])
366 ;; The "Windows" keys on newer keyboards bring up the Start menu 359 ;; The "Windows" keys on newer keyboards bring up the Start menu
367 ;; whether you want it or not - make Emacs ignore these keystrokes 360 ;; whether you want it or not - make Emacs ignore these keystrokes
368 ;; rather than beep. 361 ;; rather than beep.
369 (global-set-key [lwindow] 'ignore) 362 (global-set-key [lwindow] 'ignore)
370 (global-set-key [rwindow] 'ignore) 363 (global-set-key [rwindow] 'ignore)
371
372 ;; These tell read-char how to convert
373 ;; these special chars to ASCII.
374 (put 'tab 'ascii-character ?\t)
375 (put 'linefeed 'ascii-character ?\n)
376 (put 'clear 'ascii-character 12)
377 (put 'return 'ascii-character 13)
378 (put 'escape 'ascii-character ?\e)
379 (put 'backspace 'ascii-character 127)
380 (put 'delete 'ascii-character 127)
381 364
382 (defun w32-add-charset-info (xlfd-charset windows-charset codepage) 365 (defun w32-add-charset-info (xlfd-charset windows-charset codepage)
383 "Function to add character sets to display with Windows fonts. 366 "Function to add character sets to display with Windows fonts.
384 Creates entries in `w32-charset-info-alist'. 367 Creates entries in `w32-charset-info-alist'.
385 XLFD-CHARSET is a string which will appear in the XLFD font name to 368 XLFD-CHARSET is a string which will appear in the XLFD font name to