aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Voelker1997-09-02 23:53:22 +0000
committerGeoff Voelker1997-09-02 23:53:22 +0000
commitd66be5718bcab4b95f19f972c64fd8c79e0aacaa (patch)
treea3774814f7f0f8506cbe3b9cdef57406dde10f62
parentf359fb79df064cd2b829df1c9bd4aa6bd60c7345 (diff)
downloademacs-d66be5718bcab4b95f19f972c64fd8c79e0aacaa.tar.gz
emacs-d66be5718bcab4b95f19f972c64fd8c79e0aacaa.zip
(w32-handle-scroll-bar-event): On up and
down events, place point at window start position. Bind f10 to menubar. Move keypad key definitions to w32-fns.el. (mouse-wheel-scroll-amount): New variable. (mouse-wheel-scroll-line, mouse-wheel-scroll-screen): New functions. Bind mouse-wheel events to mouse-wheel functions.
-rw-r--r--lisp/term/w32-win.el67
1 files changed, 37 insertions, 30 deletions
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index 3cc2986b69e..9867b964855 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -94,6 +94,7 @@
94 (select-window window) 94 (select-window window)
95 (cond 95 (cond
96 ((eq bar-part 'up) 96 ((eq bar-part 'up)
97 (goto-char (window-start window))
97 (scroll-down 1)) 98 (scroll-down 1))
98 ((eq bar-part 'above-handle) 99 ((eq bar-part 'above-handle)
99 (scroll-down)) 100 (scroll-down))
@@ -102,6 +103,7 @@
102 ((eq bar-part 'below-handle) 103 ((eq bar-part 'below-handle)
103 (scroll-up)) 104 (scroll-up))
104 ((eq bar-part 'down) 105 ((eq bar-part 'down)
106 (goto-char (window-start window))
105 (scroll-up 1)) 107 (scroll-up 1))
106 ))) 108 )))
107 (select-window old-window)))) 109 (select-window old-window))))
@@ -113,6 +115,35 @@
113 115
114;; (scroll-bar-mode nil) 116;; (scroll-bar-mode nil)
115 117
118(defvar mouse-wheel-scroll-amount 4
119 "*Number of lines to scroll per click of the mouse wheel.")
120
121(defun mouse-wheel-scroll-line (event)
122 "Scroll the current buffer by `mouse-wheel-scroll-amount'."
123 (interactive "e")
124 (condition-case nil
125 (if (< (car (cdr (cdr event))) 0)
126 (scroll-up mouse-wheel-scroll-amount)
127 (scroll-down mouse-wheel-scroll-amount))
128 (error nil)))
129
130;; for scroll-in-place.el, this way the -scroll-line and -scroll-screen
131;; commands won't interact
132(setq scroll-command-groups (list '(mouse-wheel-scroll-line)))
133
134(defun mouse-wheel-scroll-screen (event)
135 "Scroll the current buffer by `mouse-wheel-scroll-amount'."
136 (interactive "e")
137 (condition-case nil
138 (if (< (car (cdr (cdr event))) 0)
139 (scroll-up)
140 (scroll-down))
141 (error nil)))
142
143;; Bind the mouse-wheel event:
144(global-set-key [mouse-wheel] 'mouse-wheel-scroll-line)
145(global-set-key [C-mouse-wheel] 'mouse-wheel-scroll-screen)
146
116(defvar x-invocation-args) 147(defvar x-invocation-args)
117 148
118(defvar x-command-line-resources nil) 149(defvar x-command-line-resources nil)
@@ -462,8 +493,14 @@ The value may be different for frames on different X displays."
462 (setq defined-colors (cons this-color defined-colors)))) 493 (setq defined-colors (cons this-color defined-colors))))
463 defined-colors)) 494 defined-colors))
464 495
496
465;;;; Function keys 497;;;; Function keys
466 498
499;;; make f10 activate the real menubar rather than the mini-buffer menu
500;;; navigation feature.
501(global-set-key [f10] (lambda ()
502 (interactive) (w32-send-sys-command ?\xf100)))
503
467(defun iconify-or-deiconify-frame () 504(defun iconify-or-deiconify-frame ()
468 "Iconify the selected frame, or deiconify if it's currently an icon." 505 "Iconify the selected frame, or deiconify if it's currently an icon."
469 (interactive) 506 (interactive)
@@ -474,36 +511,6 @@ The value may be different for frames on different X displays."
474(substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame 511(substitute-key-definition 'suspend-emacs 'iconify-or-deiconify-frame
475 global-map) 512 global-map)
476 513
477;; Map certain keypad keys into ASCII characters
478;; that people usually expect.
479(define-key function-key-map [tab] [?\t])
480(define-key function-key-map [linefeed] [?\n])
481(define-key function-key-map [clear] [11])
482(define-key function-key-map [return] [13])
483(define-key function-key-map [escape] [?\e])
484(define-key function-key-map [M-tab] [?\M-\t])
485(define-key function-key-map [M-linefeed] [?\M-\n])
486(define-key function-key-map [M-clear] [?\M-\013])
487(define-key function-key-map [M-return] [?\M-\015])
488(define-key function-key-map [M-escape] [?\M-\e])
489
490;; These don't do the right thing (voelker)
491;(define-key function-key-map [backspace] [127])
492;(define-key function-key-map [delete] [127])
493;(define-key function-key-map [M-backspace] [?\M-\d])
494;(define-key function-key-map [M-delete] [?\M-\d])
495
496;; These tell read-char how to convert
497;; these special chars to ASCII.
498(put 'tab 'ascii-character ?\t)
499(put 'linefeed 'ascii-character ?\n)
500(put 'clear 'ascii-character 12)
501(put 'return 'ascii-character 13)
502(put 'escape 'ascii-character ?\e)
503;; These don't seem to be necessary (voelker)
504;(put 'backspace 'ascii-character 127)
505;(put 'delete 'ascii-character 127)
506
507 514
508;;;; Selections and cut buffers 515;;;; Selections and cut buffers
509 516