Showing revision 3

repeat.pl

Difference between revision 2 and revision 3

Changed:

< * Negative repeat for <subroutine>!VolumeUp</> is <subroutine>!VolumeDown</> and vice versa. That's the most predictable use. (See [[amixer.pl]])
< * Negative repeat for <subroutine>!WatchTime</> (a command that tells current time) is <subroutine>!WatchDate</> (tells current date) and other way round. This is pretty straightforward. What else is it supposed to do anyway, right? (See [[watch.pl]])
< * However, sometimes it is not obvious. Key{Backspace} is one of the easiest keys to press, so it makes sense to use it whenever we can. Negative repeat for <subroutine>!CmusPause</> (pause/continue music) is <subroutine>!CmusNext</> (next song). The only reason is that it is very likely for a user to change the song after turning it on, and repeating <subroutine>!CmusPause</> already acts like a toggle. (See [[cmus.pl]])

to

> * Negative repeat for <subroutine>VolumeUp</> is <subroutine>VolumeDown</> and vice versa. That's the most predictable use. (See [[amixer.pl]])
> * Negative repeat for <subroutine>WatchTime</> (a command that tells current time) is <subroutine>WatchDate</> (tells current date) and other way round. This is pretty straightforward. What else is it supposed to do anyway, right? (See [[watch.pl]])
> * However, sometimes it is not obvious. Key{Backspace} is one of the easiest keys to press, so it makes sense to use it whenever we can. Negative repeat for <subroutine>CmusPause</> (pause/continue music) is <subroutine>CmusNext</> (next song). The only reason is that it is very likely for a user to change the song after turning it on, and repeating <subroutine>CmusPause</> already acts like a toggle. (See [[cmus.pl]])


Source code: repeat.pl

Description

This module implements one of the main features of the input system.

Space (Sx Sx) repeats previous action, like if you typed it again yourself. Usually this will not cause any side effects, although some modules might handle it differently.

Backspace (xS xS) repeats previous action "negatively". Result depends on the module implementing previous action. Some modules might treat it as "Undo", while others might simply call another action that is commonly used after the previous one.

It is best to understand it by example:

Usually you will know what it is supposed to do naturally. It might be hard to learn what every negative repeat does, but you will save a lot of time if you master it :)

If the module does not handle negative repeats, using Backspace (xS xS) will work like a regular repeat.