comparison lisp/emacs-lisp/levents.el @ 49598:0d8b17d428b5

Trailing whitepace deleted.
author Juanma Barranquero <lekktu@gmail.com>
date Tue, 04 Feb 2003 13:24:35 +0000
parents abd085bfec0c
children 695cf19ef79e d7ddb3e565de
comparison
equal deleted inserted replaced
49597:e88404e8f2cf 49598:0d8b17d428b5
96 bucky bits. The character is the first argument, and the event to fill 96 bucky bits. The character is the first argument, and the event to fill
97 in is the second. This function contains knowledge about what the codes 97 in is the second. This function contains knowledge about what the codes
98 mean -- for example, the number 9 is converted to the character Tab, 98 mean -- for example, the number 9 is converted to the character Tab,
99 not the distinct character Control-I. 99 not the distinct character Control-I.
100 100
101 Beware that character-to-event and event-to-character are not strictly 101 Beware that character-to-event and event-to-character are not strictly
102 inverse functions, since events contain much more information than the 102 inverse functions, since events contain much more information than the
103 ASCII character set can encode." 103 ASCII character set can encode."
104 ch) 104 ch)
105 105
106 (defun copy-event (event1 &optional event2) 106 (defun copy-event (event1 &optional event2)
107 "Make a copy of the given event object. 107 "Make a copy of the given event object.
212 (posn-timestamp (event-end event)))) 212 (posn-timestamp (event-end event))))
213 213
214 (defun event-to-character (event &optional lenient) 214 (defun event-to-character (event &optional lenient)
215 "Returns the closest ASCII approximation to the given event object. 215 "Returns the closest ASCII approximation to the given event object.
216 If the event isn't a keypress, this returns nil. 216 If the event isn't a keypress, this returns nil.
217 If the second argument is non-nil, then this is lenient in its 217 If the second argument is non-nil, then this is lenient in its
218 translation; it will ignore modifier keys other than control and meta, 218 translation; it will ignore modifier keys other than control and meta,
219 and will ignore the shift modifier on those characters which have no 219 and will ignore the shift modifier on those characters which have no
220 shifted ASCII equivalent (Control-Shift-A for example, will be mapped to 220 shifted ASCII equivalent (Control-Shift-A for example, will be mapped to
221 the same ASCII code as Control-A.) If the second arg is nil, then nil 221 the same ASCII code as Control-A.) If the second arg is nil, then nil
222 will be returned for events which have no direct ASCII equivalent." 222 will be returned for events which have no direct ASCII equivalent."
223 (if (symbolp event) 223 (if (symbolp event)
224 (and lenient 224 (and lenient
225 (cdr (assq event '((backspace . 8) (delete . 127) (tab . 9) 225 (cdr (assq event '((backspace . 8) (delete . 127) (tab . 9)
226 (return . 10) (enter . 10))))) 226 (return . 10) (enter . 10)))))