help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scrolling the editor via touch screen


From: Emanuel Berg
Subject: Re: Scrolling the editor via touch screen
Date: Mon, 11 Sep 2017 04:00:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Jorget Millani wrote:

> A quick question. One the things that could
> improve my workflow with Emacs the most is if,
> in my touch-screen monitor, I could scroll
> a text or programming script displayed in
> Emacs' editor by doing the traditional touch
> scrolling movement with fingers in the
> touch-screen.

You need to find the interface for that and
bind that input action to a function of
your liking.

Try eval this: (scroll-up 1)

In your case, your input device will probably
transmit some data to indicate how wide the
movement, which, perhaps with acceleration,
would be translated to the argument to
`scroll-up'/`scroll-down'.

If this will benefit workflow is another thing.
Personally I cannot stand touching screens but
I love typing. But that's just me. But all
programmers type so that's not just me. And if
they move their hands from the keyboard all the
time to mess with the screen I can't see how
that will benefit anyone. But perhaps it's just
me who cannot see that.

On another note, here is some other fun things
to do with scrolling that might help you if you
ever find the interface to your touch screen.
The code looks strange (the loop) and obviously
I don't remember what the thoughts were when
I wrote it way back. But it seems to work and
could even be useful, perhaps :)

;; scroll the current window
(defun scroll-up-1 ()
  (interactive)
  (scroll-down 1) )
(defun scroll-down-1 ()
  (interactive)
  (scroll-up 1) )

;; automatic scrolling
(defun start-automatic-scroll-down ()
  (interactive)
  (let ((win))
    (cl-loop do
             (progn (setq win (window-end))
                    (scroll-down-1)
                    (sleep-for 1) ; put speed here in seconds
                    (redisplay) )
     until (= win (window-end)) )))
;; (start-automatic-scroll-down)
;;                             ^ test here; abort with C-g

More scrolling:
http://user.it.uu.se/~embe8573/emacs-init/scroll.el

Good luck!

-- 
underground experts united
http://user.it.uu.se/~embe8573


reply via email to

[Prev in Thread] Current Thread [Next in Thread]