Consistent Keyboard Configuration
Now start X as root. Change the directory to /etc/X11 and look at the file Xmodmap. Most likely, this file is empty, except for some comments. If not, rename it to Xmodmap.old, exit the window manager and restart X.
Starting with an empty Xmodmap is important, because when X comes up, it creates its keyboard modifier map and keymap table based on the kernel's current keyboard translation tables, which were just reconfigured. X then reads the Xmodmap file, which overrides the kernel. This could destroy some of the benefits of the work just completed on the kernel.
Since the kernel has already been reconfigured, the work of configuring X will be reduced by the work already done in creating custom.map. Specifically, DELETE and BACKSPACE will still transmit DELETE and BACKSPACE, because X got that information from the kernel.
Now enter the following command to replace Xmodmap with the current keymap table:
# xmodmap -pke > /etc/X11/Xmodmap
Edit Xmodmap. It appears similar to the file custom.map, but do not be misled. The keycodes are different. To find the keycode number for a given key, run xev from an xterm, put the mouse cursor inside the xev window, and press the key. Look for the key's “keycode” in the output. For more information, see xev(1) and xmodmap(1).
Finally, to switch the Caps Lock and the left CTRL key, add these lines to the end of the file:
! Recreate the Lock and Control modifier maps. clear Lock clear Control add Lock = Caps_Lock add Control = Control_L Control_R
To be able to configure keys on the numeric keypad, they must be given an appropriate keysym following the equals sign. Therefore, change the following lines as shown:
keycode 63 = KP_Multiply keycode 77 = KP_F1 keycode 79 = KP_7 keycode 80 = KP_8 keycode 81 = KP_9 keycode 82 = KP_Subtract keycode 83 = KP_4 keycode 84 = KP_5 keycode 85 = KP_6 keycode 86 = KP_Add keycode 87 = KP_1 keycode 88 = KP_2 keycode 89 = KP_3 keycode 90 = KP_0 keycode 91 = KP_Decimal keycode 108 = KP_Enter keycode 112 = KP_DivideKeycodes 99 and 105 are assigned to the keysyms Prior and Next, respectively. Just as was done in custom.map, change them to the following keysyms, which are functionally equivalent, but match the keycaps:
keycode 99 = Page_Up keycode 105 = Page_DownNow save the file, then type:
# xmodmap /etc/X11/Xmodmapto activate the new definitions. If your keyboard will not work at all, use CTRL-ALT-BACKSPACE to exit X. Then use a virtual console to fix the problem.
The xterm program receives keysyms from X and converts them into characters and into escape sequences. Since xterm emulates a VT102 terminal, it requires little configuration work.
Edit the /etc/X11/Xresources file, and add the following line:
XTerm*ttyModes: erase ^H
This automatically makes BACKSPACE (CTRL-H) delete characters to the left of the cursor. It is the same as if the user typed:
$ stty erase ^Hevery time an xterm was started. Also add this line:
XTerm*appkeypadDefault: trueThis will cause the keys of the numeric keypad to transmit their escape sequences instead of numbers, operators, etc. It is the same as if the user pressed CTRL--MiddleButton and selected “Enable Application Keypad” in every xterm window.
Unfortunately, Emacs normally resets the numeric keypad when it exits, so the keys no longer transmit escape sequences. To correct this behavior, the “rmkx” capability must be removed from the terminfo(5) database:
# cd /etc/terminfo/x # infocmp xterm > xterm.txt # emacs xterm.txt
Remove the “rmkx” entry, save the file, and exit. Then:
# tic xterm.txt # rm xterm.txtIt is also necessary to tell xterm what the ALT-Arrow keys transmit, and what the HOME and END editing keys transmit. (The default escape sequences that xterm uses for HOME and END are unconventional.) Type the first seven lines below. Then cut and paste the remaining lines from the xterm(1) man page, underneath the heading, “The default bindings in the VT102 window are.”
XTerm*VT100*translations:\\
Alt <KeyPress> Up:string(0x1b) string(0x1b) string("OA")
Alt <KeyPress> Down:string(0x1b) string(0x1b) string("OB") \\n\\
Alt <KeyPress> Right:string(0x1b) string(0x1b) string("OC") \\n\\
Alt <KeyPress> Left:string(0x1b) string(0x1b) string("OD") \\n\\
<KeyPress> Home:string(0x1b) string("[1~") \\n\\
<KeyPress> End:string(0x1b) string("[4~") \\n\\
Shift <KeyPress> \
Prior:scroll-back(1,halfpage) \\n\\
Shift <KeyPress> \
Next:scroll-forw(1,halfpage) \\n\\
Shift <KeyPress> \
Select:select-cursor-start() \\n\\
Shift <KeyPress> select-cursor-end(PRIMARY, \
CUT_BUFFER0) \\n\\
Shift <KeyPress> Insert:insert-selection(PRIMARY,\
CUT_BUFFER0) \\n\\
~Meta<KeyPress>:insert-seven-bit() \\n\\
Meta<KeyPress>:insert-eight-bit() \\n\\
!Ctrl <Btn1Down>:popup-menu(mainMenu) \\n\\
!Lock Ctrl <Btn1Down>:popup-menu(mainMenu) \\n\\
!Mod2 Ctrl <Btn1Down>:popup-menu(mainMenu) \\n\\
!Mod2 Lock Ctrl \
<Btn1Down>:popup-menu(mainMenu) \\n\\
~Meta <Btn1Down>:select-start() \\n\\
~Meta <Btn1Motion>:select-extend() \\n\\
!Ctrl <Btn2Down>:popup-menu(vtMenu) \\n\\
!Lock Ctrl <Btn2Down>:popup-menu(vtMenu) \\n\\
!Mod2 Ctrl <Btn2Down>:popup-menu(vtMenu) \\n\\
!Mod2 Lock Ctrl \
<Btn2Down>:popup-menu(vtMenu) \\n\\
~Ctrl ~Meta <Btn2Down>:ignore() \\n\\
~Ctrl ~Meta <Btn2Up>:insert-selection(PRIMARY, CUT_BUFFER0) \\n\\
!Ctrl <Btn3Down>:popup-menu(fontMenu) \\n\\
!Lock Ctrl <Btn3Down>:popup-menu(fontMenu) \\n\\
!Mod2 Ctrl <Btn3Down>:popup-menu(fontMenu) \\n\\
!Mod2 Lock Ctrl \
<Btn3Down>:popup-menu(fontMenu) \\n\\
~Ctrl ~Meta <Btn3Down>:start-extend() \\n\\
~Meta <Btn3Motion>:select-extend() \\n\\
<BtnUp>>>>>>>>:select-end(PRIMARY, CUT_BUFFER0) \\n\\
<BtnDown>:bell(0)
Make sure each line ends exactly as shown, and there is not even a
blank space after the last backslash on each line. Then change
“Prior” to “Page_Up,” change “Next” to “Page_Down,” and
change “Select” to “End” to match the keycaps.
ALT-Arrow transmits an ESCAPE (0x1b in hexadecimal) followed by the escape sequence for the arrow key, but ALT-<Keypress> sets the eighth bit of that key (examine the line that begins with “Meta<KeyPress>”). Also, the escape sequences for the ALT-arrow keys are not the same as were used in custom.map. For a full explanation of this file's format, see the RESOURCES heading under X(1). Save the file. Type:
# xrdb /etc/X11/Xresources
to activate the definitions. The BACKSPACE key should now work properly the next time an xterm is started.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.
Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.
Sponsored by ActiveState
| Non-Linux FOSS: libnotify, OS X Style | Jun 18, 2013 |
| Containers—Not Virtual Machines—Are the Future Cloud | Jun 17, 2013 |
| Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer | Jun 12, 2013 |
| Weechat, Irssi's Little Brother | Jun 11, 2013 |
| One Tail Just Isn't Enough | Jun 07, 2013 |
| Introduction to MapReduce with Hadoop on Linux | Jun 05, 2013 |
- Containers—Not Virtual Machines—Are the Future Cloud
- Non-Linux FOSS: libnotify, OS X Style
- Linux Systems Administrator
- Validate an E-Mail Address with PHP, the Right Way
- Lock-Free Multi-Producer Multi-Consumer Queue on Ring Buffer
- Senior Perl Developer
- RSS Feeds
- Technical Support Rep
- Introduction to MapReduce with Hadoop on Linux
- Weechat, Irssi's Little Brother
- What the author describes
1 hour 8 min ago - Reply to comment | Linux Journal
5 hours 18 min ago - Reply to comment | Linux Journal
6 hours 3 min ago - Didn't read
6 hours 14 min ago - Reply to comment | Linux Journal
6 hours 19 min ago - Poul-Henning Kamp: welcome to
8 hours 29 min ago - This has already been done
8 hours 30 min ago - Reply to comment | Linux Journal
9 hours 15 min ago - Welcome to 1998
10 hours 3 min ago - notifier shortcomings
10 hours 27 min ago
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?




Comments
Ctrl-m in emacs
How can I bind Ctrl-m to some command, in emacs, without binding return to that command. So how can I separate Ctrl-m from return ? And not using X. Cause I use emacs over ssh.
Thanks
Re: Consistent Keyboard Configuration
Nice.
However, what do you do if the loadkeys command isn't present?
Ditto for the find command.