Skip to content

b_why the shift key why the caps lock

Mohammed David edited this page Aug 13, 2025 · 7 revisions

Why the Shift Key? Why the Caps Lock?

Return to 'Introduction to the HW HTML Drafting Project'

Stars Extending to the Right and the Left, with trailing lines.

What's so special about the shift key?

In the HW HTML Drafting Program, the shift key is very important. As a general rule, it enables us to choose between applying a keyboard-accessible program function to only the selected item, or to the entire group associated with that selected item. This intriguing nuanced feature of the HW HTML Drafting Project is tied together with our core philosophy: This program has exactly three groups, and every item is a member of one and only one of those groups. This fundamental strategy of the project is to allow both pin-point precision and variable-breadth application of the program functions. This is what is called the 'Tripartite Selection System', or more simply: 'The Three Colour System'.

The Three Colour System is deeply ingrained into the foundation of this project, and permeates through all program functionalities. This has the effect of a cohesion, tying the program together tightly with this strong and weighty regiment. To read more about the Three Colour System employed by the HW HTML Drafting Program, follow the link:

Yes, the shift key enables a keyboard or mouse function to be applied to an entire group. This simple and general rule allows us to describe the user experience of the program in fewer words, and it clearer terms, hence reducing the learning curve to a more casual and shallow meander. There are some things to learn but, it's not as overwhelming as with other programs.

Thin Decorative Stars and Lines, a Motif

There is some joy in a minimal and focused program.

By comparison with other drafting style programs, this one, being as it is only two dimensional, is much easier to learn. The problem that is found with more complex programs is exactly that, they are complex. Learning can be viewed as a venture, having a longer term paying dividends and having shorter-term start-up costs. It's all part of the package. So, in this light, we can see the issue of having a steep learning curve up-front resulting in an initial struggle to even a basic level of proficiency. That is, if the curve is not so incredibly prohibitive that only some people even attempt the venture.

In stark contrast, the HW HTML Drafting Program show that fewer keybindings, fewer program functions, and overall fewer things to remember. The 'venture' is seen in a completely different light when our 'start-up' costs are virtually nil. This project is Open-Source after all but, and in no way contrarily, of the highest quality, and resting on the soundest of foundations.

Whatever is this Business With the Caps Lock?

Yes, the rumors are true, and caps lock, little did we all know, had and always has had every quality of enabling a mode. The mode setting nature of changing the caps lock state pervades across all programs being used seamlessly and simultaneously.

While the caps lock is ordinarily used for entering seemingly ornery text and email messages, it's real strength is found in the knowledge that it effects a mode known only to and controlled completely by the Operating System. The keyboard that we are typing with, even when we press that caps lock key, is only a passive device, waiting for the operating system to return a signal that turns on the keyboard's LED indicator. That's how we know that our pressing the caps lock key has succeeded.

Each program in our repertoire relies completely on our computer's operating system for determining the status of the caps lock key. So, to tie this all back together with a snazzy little bow, I can tell you that without this obscure, though completely logical, interpretation of the caps lock key, the HW HTML Drafting Project simply would not have been possible.

Circling back to the earlier, somewhat boastful remarks regarding minimalism, wherein a view was taken towards a rather common 'turn-of-phrase' description: 'Less Is More'. No need to redact the sentiment, though it will now be expressed that 'Too Few Is Inadequate': There does need to be a base-minimum number of key-bindings to construct a viable project.

The caps lock key as a 'higher-order-mode' enabler is so crucial because it expands our available keybindings, effectively doubling the number of available keys.

Why not over-ride the ctrl and alt key-bindings?

That is a fair question, whose conclusions can be draw out by other questions.

Our program is operating completely inside of the web browser. Web browsers are typically gigantic programs. They are typically hundreds of times the size of the HW Program Files. The browser is actually the second most important program on your computer, the first being the operation system itself.

The browser is also the most highly used and the most efficiently and broadly developed. This is because every computer uses a browser. Across all types of computing devices there are almost always web browsers. The programming and work and research that goes into the development and maintenance of those web browsers is absolutely a pinnacle.

The initial impression was that, without question, the keybindings that are attached to the browser should be completely maintained. After all, I had no idea about how to over-ride them anyhow.

The Browser Functionality Is Maintained.

The interesting thing here is that there is a clean separation between what key-bindings the browser treats as special, and 'ear-marks' for itself, and the ones that it doesn't touch. This is a very hard edged line which is essentially consistent across most, if not all, web browsers. The browser almost never assigns any special purpose to key-bindings of the form shift + letter key. In addition to those key-bindings, the top number row, in combination with the shift key was also clearly available. There were other keys too, and all together, they are described in that colourful drawing, which has now been demystified.

Here is that same drawing, from the introduction, shown again:

A Keymap Showing the Keys Used By The HW HTML Drafting Program

Just to build a little bit of mystery back into this tale: How does the program tell whether the caps lock is on or off?

That is a very important point made with this question. The answer is that, our HW program actually, sometimes, doesn't know what the status of the caps lock key is. Whether it is on or off is sometimes unclear. These cases are mostly stemming from when we click into a different window, and the web browser does not have the 'focus' of the operating system anymore.

So, how can we do it?

Well, it's simpler than you might think. We just check whether the shift key is being held down, and what letter is being pressed. So, if we haven't pressed a letter yet, we actually don't quite know.

Then the key-press comes, and we check whether we have an uppercase letter or a lowercase letter. Then we also check whether we have been holding down the shift key. If we have a lowercase letter and we are not holding down the shift key, then we know for certain that the caps lock is off. If we have and uppercase letter and we have no shift key, then we know that the caps lock is on. There are two other cases that are essentially the reverse of the two which are given. The case is made entirely clear, and we can only have one of two results, we have shown that either the caps lock key is on or off.

Yep, there is 'no two ways about it'. The caps lock is on or it is off. We can know it, and for the purpose of this program we desperately needed it. The project just wouldn't be the same without it.

Clone this wiki locally