Blame docs/doc/kbd.FAQ-9.html

Packit Service 50ad14
Packit Service 50ad14
<HTML>
Packit Service 50ad14
<HEAD>
Packit Service 50ad14
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
Packit Service 50ad14
 <TITLE>The Linux keyboard and console HOWTO: How to get out of raw mode</TITLE>
Packit Service 50ad14
 <LINK HREF="kbd.FAQ-10.html" REL=next>
Packit Service 50ad14
 <LINK HREF="kbd.FAQ-8.html" REL=previous>
Packit Service 50ad14
 <LINK HREF="kbd.FAQ.html#toc9" REL=contents>
Packit Service 50ad14
</HEAD>
Packit Service 50ad14
<BODY>
Packit Service 50ad14
Next
Packit Service 50ad14
Previous
Packit Service 50ad14
Contents
Packit Service 50ad14

Packit Service 50ad14

9. How to get out of raw mode

Packit Service 50ad14
Packit Service 50ad14

Packit Service 50ad14
Packit Service 50ad14
raw mode, exiting
Packit Service 50ad14
-->
Packit Service 50ad14

If some program using K_RAW keyboard mode exits without restoring the keyboard

Packit Service 50ad14
mode to K_XLATE, then it is difficult to do anything - not even Ctrl-Alt-Del
Packit Service 50ad14
works. However, it is sometimes possible to avoid hitting the reset button.
Packit Service 50ad14
(And desirable as well: your users may get angry if you kill their Hack game
Packit Service 50ad14
by rebooting; you might also damage your file system.)
Packit Service 50ad14
Easy solutions involve logging in from another terminal or another machine
Packit Service 50ad14
and doing kbd_mode -a.
Packit Service 50ad14
The procedure below assumes that no X is running, that the display is in
Packit Service 50ad14
text mode, and that you are at your bash prompt, that you are using a US
Packit Service 50ad14
keyboard layout, and that your interrupt character is Ctrl-C.
Packit Service 50ad14

Step 1. Start X.

Packit Service 50ad14
As follows: press 2 (and don't release), press F12 (and don't release)
Packit Service 50ad14
and immediately afterwards press = . This starts X.
Packit Service 50ad14
(Explanation: if a key press produces keycode K, then the key release
Packit Service 50ad14
produces keycode K+128. Probably your shell does not like these high
Packit Service 50ad14
characters, so we avoid generating them by not releasing any key.
Packit Service 50ad14
However, we have to be quick, otherwise key repeat starts. The digit 2
Packit Service 50ad14
produces a Ctrl-C that discards previous junk, the F12 produces an X
Packit Service 50ad14
and the = a Return.)
Packit Service 50ad14
Probably your screen will be grey now, since no .xinitrc was specified.
Packit Service 50ad14
However, Ctrl-Alt-Fn will work and you can go to another VT.
Packit Service 50ad14
(Ctrl-Alt-Backspace also works, but that exits X, and gets you back into
Packit Service 50ad14
the previous state, which is not what you want.)
Packit Service 50ad14

Step 2. Setup to change the keyboard mode.

Packit Service 50ad14
(For example, by sleep 5; kbd_mode -a.)
Packit Service 50ad14

Step 3. Leave X again.

Packit Service 50ad14
Alt-Fx (often Alt-F7) brings you back to X, and then Ctrl-Alt-Backspace
Packit Service 50ad14
exits X. Within 5 seconds your keyboard will be usable again.
Packit Service 50ad14

If you want to prepare for the occasion, then make

Packit Service 50ad14
\215A\301 (3 symbols) an alias for kbd_mode -a.
Packit Service 50ad14
Now just hitting = F7 = (3 symbols) will return you to sanity.
Packit Service 50ad14

Packit Service 50ad14

Packit Service 50ad14
Next
Packit Service 50ad14
Previous
Packit Service 50ad14
Contents
Packit Service 50ad14
</BODY>
Packit Service 50ad14
</HTML>