full screen background image

sosto.net blog - 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*

hastags

Tutti gli hashtags.

ricerca


links sosto.net

Instagram

clemspace.ch


archivio

dicembre (0)
novembre (1)
ottobre (1)

Archivio

articoli più letti

Da Bosco Gurin alla Val Bedretto, via Basodino

Gazzirola e Camoghè

Via alta della Val Carassina

settings

A–   A+

italiano
français
english

sosto.net - top of the page


cross cross cross sandwich fullscreen fullscreen resize resize fullscreen fullscreen fullscreen fullscreen fullscreen fullscreen fullscreen