With this blog, I attempt to answer the question: How dangerous can an idea get?

A Tour of Your Keyboard...

Date/Time Permalink: 03/15/06 05:37:53 am
Category: HOWTOs and Guides

You spend some time in front of it every day, but what do you really
know about it? Herein, a guided tour of the modern keyboard; which is
an interesting lesson in the history of computing in itself! This
will be a discovery tour of the modern PC-keyboard, other systems may
not apply.

(hopefully, your keyboard looks like the one I'm describing, and if it
doesn't you can manage to follow along! Most modern keyboards differ
in only a few keys.)

"The Top Row":
The "Esc" key stands for "Escape". Originally used to mean "quit the
program", it is more often used to cancel the previous action without
leaving a given program. It is also used to substitute for an Alt or
Meta key, if the keyboard doesn't have one.

The keys F1 thru F12: The "F" stands for "Function", and have
historically been used strictly for "special" functions that the
programmer or user can define. Think of them as "generic"
keys. Their conventional uses have changed many times from decade to
decade. However, most systems currently assign "F1" to mean "help"
(by displaying the documentation interface) and "F2" usually means
to launch a program dialog. The F* keys also, when applied with
shift mods, are the canonical way to switch between virtual consoles
or desktops. This is so ingrained that upon sitting down to a new
system's desktop, if "Alt-1" through "Alt-4" doesn't take me to the
desktops, I immediately define them that way!

"Print Screen/SysRq": the screen printing originally meant sending the
text currently displayed on the terminal to the paper-printer, but
over time evolved in the GUI to mean "save the current desktop as an
image". The "SysRq" part of this key actually means "System
Requirements", and guess what: it's the "appendix" of the modern
keyboard, it's intended functionality lost in the mists of time and
never implemented! But just like the F1-12 keys, it can be programmed
to do something, at the developer's whim.

"Scroll Lock" the canonical key that nobody uses. It gets people's
attention, because it's one of the three keys that control one of the
green LED lights on the keyboard, which makes people doubly curious:
why is this "useless" key so special that it gets it's own light?
Scroll lock was used in text terminals, to keep the text printed to
the screen from "scrolling" off the monitor. Scroll lock was
originally useful for controlling text output the way you're reading
this now. For instance, if a command-line user typed

"cat my_big_text_file"

the whole file would "dump" to the screen in a blur, faster than
they could read it. Pressing and releasing the scroll lock key used
to be the way to view the text output incrementally, but today's
computers print text so fast that this is a useless method for
control. Occasional programs make use of it for arcane little

"Pause/Break": Originally used to pause execution of a program, or
break it's execution - in other words, to exit it. Originally used
mostly by programmers on BASIC boxes of long ago, for emergency
interrupt of a newly written program, should it get hung up while
testing. As a programmer, I can tell you that this happens all the
time, but modern conventions have created other alternatives for
emergency interrupts.

"The Main Bank":
The big block of keys that you use all the time. I won't belabor this
section, but I'll point out a few lesser-known high-lights:

The ~ is a tilde, used among other things to type a shortcut to your
home directory on a Linux system. Also means "complement of N" when
typed "~N" in several programming languages.

The ` is a back-quote. In batch-command type languages, this is a
way to signal the shell that you'll be entering a series of commands
which are to be taken as one big statement, no matter how many lines
they cover.

"Tab" is a shortcut meaning "four spaces" or whatever Tab is set to
by the program. OK, so not *everybody* knows that! Tab is frequently
used to navigate between the various buttons and boxes in a windowed
program, or with shift mods to cycle through windows. Typing in any
text context on a Linux system is also eased by "tab
completion". Longtime Linux users sometimes catch themselves
absently typing the first two characters of their password and
hitting tab!

The | is going to become your favorite keyboard character, if you
learn to program in Bash! It is called a "pipe" and it's used like a
piece of scotch tape to fasten two or more little programs together
to make one slightly bigger program. If you like building with legos
or tinker-toys, wait til you see how easily you can build your own
"custom" programs! The pipe, besides it's shape, is also called such
because in expressions:

"foo my_file | bar -z | baz -xy >> my_altered_file"

Foo processes my_file and pipes it to bar; bar with the -z option
set further processes this data and pipes it to baz, baz does some
other kind of twiddling with it's -x and -y options on the "data
stream" before finally dumping the output to my_altered_file.

The \ is a back-slash, so called because backward systems use it to
separate directory levels.

The "Caps-Lock" key, as you know from accidentally hitting it while
you're typing an email, MAKES ALL YOUR LETTERS CAPITALS. The
worst-placed key on the keyboard. A hold-over from manual
type-writers, where holding the shift key for more than a few
characters made your pinky sore. The modern user sometimes sees
Caps-Lock as such an annoyance that keyboards are frequently marketed
with the absence of this key touted as a feature!

The "Shift", "Ctrl", and "Alt" or "Meta" keys are known as
shift-mods. You almost never use these keys by themselves, as their
function is to change the meaning of other keys. By the way, if
you're coming here from Windows, the Ctrl-Alt combination works with
many other keys besides "Delete".

The "Windows" key on Windows-keyboards: though this key is
ubiquitous for most systems, Microsoft's insistence on placing this
key didn't lead to it's actually being used for anything. Functions
for it exist in Windows, but what good is that if they're all
undocumented? Never mind, Linux can use this key if you tell it
to. In fact, since Windows-key combinations are guaranteed to be
"open" in a Linux program, I like using it in the GUI to define
custom keyboard shortcuts! On Macintoshes, this is the "Feature"
key. It's a toss-up whether it exists anywhere under any other name.

Now, let's talk about those strange runes above the numbers on the
big bank:
!: Exclamation point, or "bang". Was used in "bang-paths" in
ancient UUCP mail addresses, now used in many programming
languages to mean "not".
@: The "at" symbol we use for email. The jargon file calls it a
strudel; but everyone else knows it's actually called a
"danish", right (-: ?
#: Pound sign or hash. Used in some programming languages to mean
"comment", and other more arcane uses.
$: Dollar sign. Money! Also used in Bash shell to mark a
$VARIABLE, in regexp-talk for "beginning of line", etc.
%: Percent. Math calculators usually recognize this
key. Frequently used in programming as a modulus operator.
^: Caret. Almost unknown outside of programming, where it's
frequently used to mean logical EXCLUSIVE-OR.
&: Ampersand. Used almost universally in programming languages to
either join two commands together, or as logical AND.
*: Star or Splat: Used in everything from emails to mark a
footnote, to regexp-syntax as a wildcard character.
"rm ./*.jpg", for instance, will delete all jpg pictures from
the current directory, while leaving everything else alone.

Other keys...these might be anything from "Super" or "Meta" on some
keyboards (other shift-mods), to arcane little runes to pictures of
things like a mouse pointer. Use obscured to non-existent. Recent
sad anecdote I must share: In Fluxbox, I wanted to use the little
menu-picture key that's been riding around unused since forever to
summon the root menu. Even though I fired up "xev" and trapped this
key and discovered that it's actually called "Menu", I failed to get
Fluxbox to recognize it from the keys definition file. Boo-hoo-hoo!

"The Small Bank"
Insert, Delete are sporadically used to edit text.
Home, End are frequently used to go to the beginning or end of a
file or a line or a paragraph.
Page Up, Page Down are used extensively to scroll up or down one
whole screenful of text at a time.

"The Cursor Keys"
Used extensively to manipulate the text cursor. You'll be using
those little arrows a lot whenever you're editing or reading a
document. In addition, the up-down arrows can control the scrollbar
on the side of a GUI window (try it now on your web browser!). Also
used canonically in games. Their presence on modern keyboards
renders obsolete a whole family of keyboard mod-letter combos
defined in many programs (notably Emacs and vi), but these
extensions are left in for hysterical raisins.

"The Number Pad"
All of these keys are duplicated in the rest of the keyboard, with
the exception of "Num Lock". Number Lock forces the numbered keys on
the number pad to generate numbers, while Number Lock off allows
these keys to mimic the function of Home, Page Up, End, Page Down,
Insert, Delete, and the cursor keys. This keypad is another
appendix, left over from the days when most data processing was done
in ten-key mode. It finds new functions in many programs, and it's
inclusion is often what makes it an "extended keyboard". Notably the
3D-meshing program Blender turns this bank into an entire navigation
system for 3D space! Another use for this bank: in the GUI of most
Linux systems, pressing Alt-shift-NumLock enables keyboard-mouse
control (pressing it again disables it; both presses greet you with
a system beep.) You can then manipulate the mouse in the GUI thusly:

/: define left-click *:define middle-click -:define right-click
4:left.......5:click(defined with /*-)..6:right

As an example: On the desktop starting with the mouse at
center-right, I press "4" to bring the mouse to the middle of the
screen. I press "-" to tell it I'm about to make a "right-click",
then press "5" to simulate the click. I scroll down the menu with
"2" until the pointer is on the menu selection I want. Then I have
to press "/" to define a "left-click", and press "5" to "click" on
the menu option I want.

That may seem confusing, but try it and practice with it...you may
be tempted to throw away the mouse! In any case, it's invaluable for
when your mouse suddenly stops working. It comes in most handy for
when you do lots of typing, and only occasionally need to use the
mouse - such as launching another text program in a new desktop. If
you don't ever become annoyed at having to break your keyboard flow
just to reach for a special peripheral device that does only one
thing, you probably won't use this much. But power-users will see
their performance multiply! There is even a window-manager named
"rat-poison" whose whole selling point is that it abandons the mouse
(the "rat") entirely!

The summary: The keyboard as we know it is a continuously evolving
system, changing with the demands of users and the current
technology. Manufacturers strive to give us everything that any of us
could want, and in the process have to include a lot of out-dated
functions just for backwards compatibility. The purpose of this little
tour is to acquaint the casual user with some of the extended usage
that they can get out of the computer's primary interface device!

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

suddenly the moon