Individual Entry

SHIFTing out of CONTROL

We're creatures of habit. We are easily conditioned and do things without a second thought given to many of the things we do each day. It's almost a reflex. After working on OpenVMS for over a quarter of a century, and nearly all of those 25+ years on a DEC keyboard, I find that I have been conditioned and I've developed certain user habits that will not be quickly unlearned. In the last entry here, I spoke to the various options for DEC terminal and keyboard emulation. There is, of course, nothing that can directly replace a VT terminal and its associated keyboard; the best one can hope for is a reasonable facsimile thereof. Even so, one thing I've not been able to get used to on non-DEC keyboards is the location of the CONTROL key.

On DEC keyboards, the CONTROL key is directly to the left of the A key. This is not the case on most non-DEC keyboards. On these keyboards, the general case is that the CAPS LOCK key is next to the left of the A key. When using these keyboards, should I decide I need to abort some program quickly by entering a CONTROLY, I find, instead, that I've just typed an uppercase Y. Even worse, I've now locked caps on and subsequent typing yields all uppercase letters.

I never quite understood the purpose for or need for the CAPS LOCK key. Unless you are an annoying twit on one of the usenet newsgroups and you enjoy shouting at the people who frequent there, I see no real purpose for the CAPS LOCK key. Apparently, I'm not alone. Both Ubuntu Linux and Mac OS X have system configuration options which provide a way to redefine the CAPS LOCK key's normal function to be some other,more useful, function. It should come as no surprise too that one of the functions it can be assigned to is that of the CONTROL key.

Taking CONTROL under Ubuntu

There are a number of ways to modify the keyboard behavior under Linux (Ubuntu for this discussion). In the previous installment, I discussed the use of xmodmap and the .Xmodmap file. However, there are somethings which the developers must have found and deemed just as annoying as I and they have included ways to modify these things under the standard preferences panel. Since I've already explored the .Xmodmap route in the previous blog, let's take a look at the keyboard preferences route here.

The keyboard preference panel has a number of option tabs to setup personal preferences. The keyboard layout tab is where you will find the option setting to change such things as the function of the CAPS LOCK key. This keyboard preference panel, at the layout tab, is show below.
Ubuntu Keyboard Preferences Panel
This shows the general keyboard layout for my system, the Toshiba Satellite, as well as the country layout, USA, for the keyboard. Clicking on the Other Option... button will take us to the panel for establishing user preferences such as the much sought after replacement of the CAPS LOCK with the CONTROL key function. I have several other items set here as well to better mimic my favorite VT-terminal and LK-keyboard features; specifically, the COMPOSE CHARACTER key.
Ubuntu Keyboard Layout Options Panel
With little effort at all, the keyboard can be configured to more faithfully mimic my beloved LK-series keyboard features and layout.

Taking CONTROL under Mac OS X

Mac OS X, like Ubuntu Linux, has a keyboard preferences panel and subpanel for modifying the keyboard's key functions. Open the System Preferences and find the Keyboard & Mouse Preferences under the Hardware preferences. When you click on that item, you should see:
Mac OS X Keyboard Preferences Panel
Click on this panel's Modifier Keys... button to elicit the Keyboard & Mouse Preferences Modifier Keys subpanel shown here:
Mac OS X Modifer Keys Subpanel
To change the behavior of the CAPS LOCK key to perform as a CONTROL key, select the ^ Control option from the Caps Lock (⇪) Key: drop-down menu.

One Last Little Tweak


Since this blog and its previous entry was about mimicking the VT-series terminal and associated LK-series keyboards, I'd be amiss not to discuss one last tweak for those who are used to using the DECterm. I use or used the DECterm extensively for more than a decade and I developed certain habits due to features of the DECterm. One in particular that I found I needed to address was the double-click select using mouse button 1 and paste using mouse button 2. This became habitual as I could select a filename by double-clicking on it and then pasting it after an EDIT, or a TYPE, or any one of several dozen other OpenVMS DCL commands.

When using these terminal emulators on Ubuntu Linux or Max OS X, the functionality to double-click select is there; however, you need to tell the emulator which characters you wish to have included in the selection process. Since I use this primarily for selecting file names, the character set is relatively simple — numbers '0' through '9', characters 'A' through 'z', the period or dot, the dollar sign, the underscore and the dash. In recent years, I've been configuring OpenVMS with ODS-5 file systems. Because certain characters are escaped with the caret, I have also included this in the selection process. One character I did not include was the semi-colon which is used to differentiate a file's name from its version number. Using DECterm, I would find myself having to delete the version number most of the time and, without it, the default is to use the most recent version.

On Mac OS X, if using the iTerm application, this is easily configured using the Preferences panel of the iTerm application. Under this panel there are several subpanels which can be opened. The mouse subpanel has a text window titled: Characters considered part of a word:. Fill in this text window with the characters that are now alpha-numeric that you'd like to be part of the double-click selection process. This panel is shown below.
iTerm Preferences Mouse Subpanel
Under Ubuntu Linux and its gnome-terminal or its xterm, this isn't handled with a simple configuration panel. It's time to go back and visit the .Xresources file once again.

In this file, amongst the other resources discussed in the previous blog, can be a resource known as: XTerm.VT100.charClass. It is this resource that is used to define to the double-click select mechanism which characters should be included in its selection process. Upon an initial inspection, the format of the XTerm.VT100.charClass may seem a bit foreign; it is not. It's actually a very simple, comma separated, list. The format for the items in this list are character-code:value or character-range:value. The default for value is 48, the ASCII value of the '0' character which is a selectable alpha-numeric by default. To make any other character or range of characters selectable, they are associated with the alpha-numerics. So, for example, if I want the dollar sign to be included in the selection criteria, I would obtain its ASCII value — 36 decimal — and put it into the .Xresources file as:
XTerm.VT100.charClass: 36:48

Thus, to implement the same selection criteria as in the iTerm example on Max OS X with $.-_^, the .Xresources file would need to contain (examples in same respective order):
XTerm.VT100.charClass: 36:48,46:48,45:48,95:48,94:48

Of course, this can also be short-handed using the character-range notation to:
XTerm.VT100.charClass: 36:48,45-46:48,94-95:48

To reiterate what I said in the previous blog, none of the terminal emulators faithfully (ie. 100%) implement the VT-series terminals or the LK-series keyboards but you can, with little effort, get close to a level of stasis.


Comments?


To thwart automated comment SPAM, you must answer this question to post.

Comment moderation is enabled. Your comment(s) will not be visisble until approved.
Remember personal info?
Notify?
Hide email?
All html tags, with the exception of <b> and <i>, will be removed from your comment. You can make links by simply typing the url or email-address.

Calendar

« July 2018 »
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
 

Meta Information:

Title: SHIFTing out of CONTROL
Date: 18-Aug-2009 19:07
Filed:
Size: 1509 words
Next:   » Home Away Networking
Prev:   « Terminal-(L)ies.

Frontpage

Search

Archives

Powered by…