comparison lisp/term/ns-win.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 3727134fef6c
children a46a26bd9a4c
comparison
equal deleted inserted replaced
105008:b9b9c3b2718d 105009:b520d55cdd72
185 (list (cons 'width (string-to-number (match-string 7 geom))))))))) 185 (list (cons 'width (string-to-number (match-string 7 geom)))))))))
186 186
187 ;;;; Keyboard mapping. 187 ;;;; Keyboard mapping.
188 188
189 ;; These tell read-char how to convert these special chars to ASCII. 189 ;; These tell read-char how to convert these special chars to ASCII.
190 ;;TODO: all terms have these, and at least the return mapping is necessary
191 ;; for tramp to recognize the enter key.
192 ;; Perhaps they should be moved into common code somewhere
193 ;; (when a window system is active).
194 ;; Remove if no problems for some time after 2008-08-06.
195 (put 'backspace 'ascii-character 127)
196 (put 'delete 'ascii-character 127)
197 (put 'tab 'ascii-character ?\t)
198 (put 'S-tab 'ascii-character (logior 16 ?\t)) 190 (put 'S-tab 'ascii-character (logior 16 ?\t))
199 (put 'linefeed 'ascii-character ?\n)
200 (put 'clear 'ascii-character 12)
201 (put 'return 'ascii-character 13)
202 (put 'escape 'ascii-character ?\e)
203
204 191
205 (defvar ns-alternatives-map 192 (defvar ns-alternatives-map
206 (let ((map (make-sparse-keymap))) 193 (let ((map (make-sparse-keymap)))
207 ;; Map certain keypad keys into ASCII characters 194 ;; Map certain keypad keys into ASCII characters
208 ;; that people usually expect. 195 ;; that people usually expect.
209 (define-key map [backspace] [?\d])
210 (define-key map [delete] [?\d])
211 (define-key map [tab] [?\t])
212 (define-key map [S-tab] [25]) 196 (define-key map [S-tab] [25])
213 (define-key map [linefeed] [?\n])
214 (define-key map [clear] [?\C-l])
215 (define-key map [return] [?\C-m])
216 (define-key map [escape] [?\e])
217 (define-key map [M-backspace] [?\M-\d]) 197 (define-key map [M-backspace] [?\M-\d])
218 (define-key map [M-delete] [?\M-\d]) 198 (define-key map [M-delete] [?\M-\d])
219 (define-key map [M-tab] [?\M-\t]) 199 (define-key map [M-tab] [?\M-\t])
220 (define-key map [M-linefeed] [?\M-\n]) 200 (define-key map [M-linefeed] [?\M-\n])
221 (define-key map [M-clear] [?\M-\C-l]) 201 (define-key map [M-clear] [?\M-\C-l])