full screen background image

sosto.net - montagne del ticino
sosto.net blog - montagne del ticino

#linux

Mouse scroll with Emacs

Picture the scene: you have just completed the installation of your brand new Ubuntu Linux. Now, you download and install Emacs and you are ready to start developing a great application. It is then when you realize that you cannot scroll up and down the page using the mouse wheel. How to fix this problem? Just add the code below to the .emacs file in your home folder and that's it!


(defun up-slightly () (interactive) (scroll-up 5))
(defun down-slightly () (interactive) (scroll-down 5))
(global-set-key [mouse-4] 'down-slightly)
(global-set-key [mouse-5] 'up-slightly)

(defun up-one () (interactive) (scroll-up 1))
(defun down-one () (interactive) (scroll-down 1))
(global-set-key [S-mouse-4] 'down-one)
(global-set-key [S-mouse-5] 'up-one)


(defun up-a-lot () (interactive) (scroll-up))
(defun down-a-lot () (interactive) (scroll-down))
(global-set-key [C-mouse-4] 'down-a-lot)
(global-set-key [C-mouse-5] 'up-a-lot)


Save and restart Emacs. sosto.net tombstone

coshomments
Vuoi lasciare un commento?


nome* (massimo 20 caratteri)

e-mail di contatto (non sarà pubblicato)

commento*

Per evitare lo spam, per favore copia questo codice:
security code


hastags

View all hashtags.

ricerca


galleries

Instagram
lclem.vsco.co
clemspace.ch gallery

archivio

ottobre (2)
settembre (0)
agosto (2)

Archivio

articoli più letti

Perché sono contrario al ParcAdula

Via alta della Val Carassina

Cassarate, il fiume di Lugano

clemspace.ch

clemspace.ch

sosto.net - top of the page


cross sandwich resize fullscreen