diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2007-11-15 16:36:03 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2007-11-15 16:36:03 +0000 |
commit | f2c232a244ce2633c532f3b045fb0b200c3a506d (patch) | |
tree | f5c8d0c86e124423ebaac9f8cc52569992bcd48e /lisp/emulation | |
parent | 4befebc175da7d623ed2cde234b548c6188bc950 (diff) | |
download | emacs-f2c232a244ce2633c532f3b045fb0b200c3a506d.tar.gz emacs-f2c232a244ce2633c532f3b045fb0b200c3a506d.tar.bz2 emacs-f2c232a244ce2633c532f3b045fb0b200c3a506d.zip |
(cua--pre-command-handler-1):
Use input-decode-map instead of function-key-map.
Use event-modifiers now that it works reliably.
Diffstat (limited to 'lisp/emulation')
-rw-r--r-- | lisp/emulation/cua-base.el | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index fbb39ee66d3..c720a78d650 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el @@ -1225,22 +1225,26 @@ If ARG is the atom `-', scroll upward by nearly full screen." ;; Handle shifted cursor keys and other movement commands. ;; If region is not active, region is activated if key is shifted. - ;; If region is active, region is cancelled if key is unshifted (and region not started with C-SPC). - ;; If rectangle is active, expand rectangle in specified direction and ignore the movement. + ;; If region is active, region is cancelled if key is unshifted + ;; (and region not started with C-SPC). + ;; If rectangle is active, expand rectangle in specified direction and + ;; ignore the movement. ((if window-system + ;; Shortcut for window-system, assuming that input-decode-map is empty. (memq 'shift (event-modifiers (aref (this-single-command-raw-keys) 0))) (or + ;; Check if the final key-sequence was shifted. (memq 'shift (event-modifiers (aref (this-single-command-keys) 0))) - ;; See if raw escape sequence maps to a shifted event, e.g. S-up or C-S-home. - (and (boundp 'local-function-key-map) - local-function-key-map - (let ((ev (lookup-key local-function-key-map - (this-single-command-raw-keys)))) - (and (vector ev) - (symbolp (setq ev (aref ev 0))) - (string-match "S-" (symbol-name ev))))))) + ;; If not, maybe the raw key-sequence was mapped by input-decode-map + ;; to a shifted key (and then mapped down to its unshifted form). + (let* ((keys (this-single-command-raw-keys)) + (ev (lookup-key input-decode-map keys))) + (or (and (vector ev) (memq 'shift (event-modifiers (aref ev 0)))) + ;; Or maybe, the raw key-sequence was not an escape sequence + ;; and was shifted (and then mapped down to its unshifted form). + (memq 'shift (event-modifiers (aref keys 0))))))) (unless mark-active (push-mark-command nil t)) (setq cua--last-region-shifted t) |