74 |
((screen-mouse-x (min (1- (frame-width)) ;don't hit column 86! |
((screen-mouse-x (min (1- (frame-width)) ;don't hit column 86! |
75 |
(/ (bg-get-tty-num semicolon) 9))) |
(/ (bg-get-tty-num semicolon) 9))) |
76 |
(screen-mouse-y (- (1- (frame-height)) ;assume default font size. |
(screen-mouse-y (- (1- (frame-height)) ;assume default font size. |
77 |
(/ (bg-get-tty-num semicolon) 16))) |
(/ (bg-get-tty-num semicolon) 16))) |
78 |
(bg-mouse-buttons (% (bg-get-tty-num ?c) 8)) |
(bg-mouse-buttons (% (bg-get-tty-num ?c) 8)) |
79 |
(bg-mouse-window (bg-window-from-x-y screen-mouse-x screen-mouse-y)) |
(bg-mouse-window (bg-window-from-x-y screen-mouse-x screen-mouse-y)) |
80 |
(bg-cursor-window (selected-window)) |
(bg-cursor-window (selected-window)) |
171 |
(scroll-up bg-mouse-y)) |
(scroll-up bg-mouse-y)) |
172 |
|
|
173 |
(defun bg-mouse-line-to-center () |
(defun bg-mouse-line-to-center () |
174 |
"Scroll the line pointed to by the BitGraph mouse to the center |
"Scroll the line pointed to by the BitGraph mouse to the center |
175 |
of the window" |
of the window" |
176 |
(interactive) |
(interactive) |
177 |
(scroll-up (/ (+ 2 bg-mouse-y bg-mouse-y (- (window-height))) 2))) |
(scroll-up (/ (+ 2 bg-mouse-y bg-mouse-y (- (window-height))) 2))) |
255 |
(defun bg-window-from-x-y (x y) |
(defun bg-window-from-x-y (x y) |
256 |
"Find window corresponding to screen coordinates. |
"Find window corresponding to screen coordinates. |
257 |
X and Y are 0-based character positions on the screen." |
X and Y are 0-based character positions on the screen." |
258 |
(get-window-with-predicate (lambda (w) |
(get-window-with-predicate (lambda (w) |
259 |
(coordinates-in-window-p (cons x y) w)))) |
(coordinates-in-window-p (cons x y) w)))) |
260 |
|
|
261 |
(defun bg-command-execute (bg-command) |
(defun bg-command-execute (bg-command) |
277 |
"Bind bg-mouse CLICK-CODE to run FUNCTION." |
"Bind bg-mouse CLICK-CODE to run FUNCTION." |
278 |
(define-key mouse-map (char-to-string click-code) function)) |
(define-key mouse-map (char-to-string click-code) function)) |
279 |
|
|
280 |
(bind-bg-mouse-click bg-button-l 'bg-set-point) |
(bind-bg-mouse-click bg-button-l 'bg-set-point) |
281 |
(bind-bg-mouse-click bg-button-m 'bg-yank) |
(bind-bg-mouse-click bg-button-m 'bg-yank) |
282 |
(bind-bg-mouse-click bg-button-r 'bg-set-mark) |
(bind-bg-mouse-click bg-button-r 'bg-set-mark) |
283 |
(bind-bg-mouse-click (+ bg-button-l bg-button-m) 'yank-pop-1) |
(bind-bg-mouse-click (+ bg-button-l bg-button-m) 'yank-pop-1) |