Skip to content

Latest commit

 

History

History
381 lines (301 loc) · 20.8 KB

README.md

File metadata and controls

381 lines (301 loc) · 20.8 KB

Dvorak Viz

A visual exploration of the differences in efficiency between the QWERTY and Dvorak keyboard layouts.

Website

This project is meant to be viewed (and interacted with!) primarily at its webpage: https://parkeraddison.com/dvorak-viz.

FAQ / Technical Notes

What should I type?

The efficiency comparison is most useful for normal sentences, and the visualization is most effective for text that is up to a few sentences in length.

Here are a few examples that you can type in (or use for inspiration):

You know what, yesterday I was just minding my own business, walking down the street, when an incredible humming bird whizzed past my shoulder. Viridian wings a blur, with an unbelievably vibrant blue underbelly -- it made me appreciate the moment.

Okay here is a sentence that I can type because, well, I'm curious to see the difference between these two keyboard layouts! Aren't you?

The comparison tool supports longer passages, though the visualization of the keyboards typing may seem a bit rushed! If you want, you could paste in the first chapter of "The Enchanted Typewriter" by John Kendrick Bangs.

The Enchanted Typewriter - I. The Discovery - Project Gutenberg

It is a strange fact, for which I do not expect ever satisfactorily to account, and which will receive little credence even among those who know that I am not given to romancing--it is a strange fact, I say, that the substance of the following pages has evolved itself during a period of six months, more or less, between the hours of midnight and four o'clock in the morning, proceeding directly from a type-writing machine standing in the corner of my library, manipulated by unseen hands. The machine is not of recent make. It is, in fact, a relic of the early seventies, which I discovered one morning when, suffering from a slight attack of the grip, I had remained at home and devoted my time to pottering about in the attic, unearthing old books, bringing to the light long-forgotten correspondences, my boyhood collections of “stuff,” and other memory-inducing things. Whence the machine came originally I do not recall. My impression is that it belonged to a stenographer once in the employ of my father, who used frequently to come to our house to take down dictations. However this may be, the machine had lain hidden by dust and the flotsam and jetsam of the house for twenty years, when, as I have said, I came upon it unexpectedly. Old man as I am--I shall soon be thirty--the fascination of a machine has lost none of its potency. I am as pleased to-day watching the wheels of my watch “go round” as ever I was, and to “monkey” with a type-writing apparatus has always brought great joy into my heart--though for composing give me the pen. Perhaps I should apologize for the use here of the verb monkey, which savors of what a friend of mine calls the “English slanguage,” to differentiate it from what he also calls the “Andrew Language.” But I shall not do so, because, to whatever branch of our tongue the word may belong, it is exactly descriptive, and descriptive as no other word can be, of what a boy does with things that click and “go,” and is therefore not at all out of place in a tale which I trust will be regarded as a polite one.

The discovery of the machine put an end to my attic potterings. I cared little for finding old bill-files and collections of Atlantic cable-ends when, with a whole morning, a type-writing machine, and a screw-driver before me I could penetrate the mysteries of that useful mechanism. I shall not endeavor to describe the delightful sensations of that hour of screwing and unscrewing; they surpass the powers of my pen. Suffice it to say that I took the whole apparatus apart, cleaned it well, oiled every joint, and then put it together again. I do not suppose a seven-year-old boy could have derived more satisfaction from taking a piano to pieces. It was exhilarating, and I resolved that as a reward for the pleasure it had given me the machine should have a brand-new ribbon and as much ink as it could consume. And that, in brief, is how it came to be that this machine of antiquated pattern was added to the library bric-a-brac. To say the truth, it was of no more practical use than Barye's dancing bear, a plaster cast of which adorns my mantel-shelf, so that when I classify it with the bric-a-brac I do so advisedly. I frequently tried to write a jest or two upon it, but the results were extraordinarily like Sir Arthur Sullivan's experience with the organ into whose depths the lost chord sank, never to return. I dashed off the jests well enough, but somewhere between the keys and the types they were lost, and the results, when I came to scan the paper, were depressing. And once I tried a sonnet on the keys. Exactly how to classify the jumble that came out of it I do not know, but it was curious enough to have appealed strongly to D'Israeli or any other collector of the literary oddity. More singular than the sonnet, though, was the fact that when I tried to write my name upon this strange machine, instead of finding it in all its glorious length written upon the paper, I did find “William Shakespeare” printed there in its stead. Of course you will say that in putting the machine together I mixed up the keys and the letters. I have no doubt that I did, but when I tell you that there have been times when, looking at myself in the glass, I have fancied that I saw in my mirrored face the lineaments of the great bard; that the contour of my head is precisely the same as was his; that when visiting Stratford for the first time every foot of it was pregnant with clearly defined recollections to me, you will perhaps more easily picture to yourself my sensations at the moment.

However, enough of describing the machine in its relation to myself. I have said sufficient, I think, to convince you that whatever its make, its age, and its limitations, it was an extraordinary affair; and, once convinced of that, you may the more readily believe me when I tell you that it has gone into business apparently for itself--and incidentally for me.

It was on the morning of the 26th of March last that I discovered the curious condition of affairs concerning which I have essayed to write. My family do not agree with me as to the date. They say that it was on the evening of the 25th of March that the episode had its beginning; but they are not aware, for I have not told them, that it was not evening, but morning, when I reached home after the dinner at the Aldus Club. It was at a quarter of three A.M. precisely that I entered my house and proceeded to remove my hat and coat, in which operation I was interrupted, and in a startling manner, by a click from the dark recesses of the library. A man does not like to hear a click which he cannot comprehend, even before he has dined. After he has dined, however, and feels a satisfaction with life which cannot come to him before dinner, to hear a mysterious click, and from a dark corner, at an hour when the world is at rest, is not pleasing. To say that my heart jumped into my mouth is mild. I believe it jumped out of my mouth and rebounded against the wall opposite back though my system into my boots. All the sins of my past life, and they are many--I once stepped upon a caterpillar, and I have coveted my neighbor both his man-servant and his maid-servant, though not his wife nor his ass, because I don't like his wife and he keeps no live-stock--all my sins, I say, rose up before me, for I expected every moment that a bullet would penetrate my brain, or my heart if perchance the burglar whom I suspected of levelling a clicking revolver at me aimed at my feet.

“Who is there?” I cried, making a vocal display of bravery I did not feel, hiding behind our hair sofa.

The only answer was another click.

“This is serious,” I whispered softly to myself. “There are two of 'em; I am in the light, unarmed. They are concealed by the darkness and have revolvers. There is only one way out of this, and that is by strategy. I'll pretend I think I've made a mistake.” So I addressed myself aloud.

“What an idiot you are,” I said, so that my words could be heard by the burglars. “If this is the effect of Aldus Club dinners you'd better give them up. That click wasn't a click at all, but the ticking of our new eight-day clock.”

I paused, and from the corner there came a dozen more clicks in quick succession, like the cocking of as many revolvers.

“Great Heavens!” I murmured, under my breath. “It must be Ali Baba with his forty thieves.”

As I spoke, the mystery cleared itself, for following close upon a thirteenth click came the gentle ringing of a bell, and I knew then that the type-writing machine was in action; but this was by no means a reassuring discovery. Who or what could it be that was engaged upon the type-writer at that unholy hour, 3 A.M.? If a mortal being, why was my coming no interruption? If a supernatural being, what infernal complication might not the immediate future have in store for me?

My first impulse was to flee the house, to go out into the night and pace the fields--possibly to rush out to the golf links and play a few holes in the dark in order to cool my brow, which was rapidly becoming fevered. Fortunately, however, I am not a man of impulse. I never yield to a mere nerve suggestion, and so, instead of going out into the storm and certainly contracting pneumonia, I walked boldly into the library to investigate the causes of the very extraordinary incident. You may rest well assured, however, that I took care to go armed, fortifying myself with a stout stick, with a long, ugly steel blade concealed within it--a cowardly weapon, by-the-way, which I permit to rest in my house merely because it forms a part of a collection of weapons acquired through the failure of a comic paper to which I had contributed several articles. The editor, when the crash came, sent me the collection as part payment of what was owed me, which I think was very good of him, because a great many people said that it was my stuff that killed the paper. But to return to the story. Fortifying myself with the sword-cane, I walked boldly into the library, and, touching the electric button, soon had every gas-jet in the room giving forth a brilliant flame; but these, brilliant as they were, disclosed nothing in the chair before the machine.

The latter, apparently oblivious of my presence, went clicking merrily and as rapidly along as though some expert young woman were in charge. Imagine the situation if you can. A type-writing machine of ancient make, its letters clear, but out of accord with the keys, confronted by an empty chair, three hours after midnight, rattling off page after page of something which might or might not be readable, I could not at the moment determine. For two or three minutes I gazed in open-mouthed wonder. I was not frightened, but I did experience a sensation which comes from contact with the uncanny. As I gradually grasped the situation and became used, somewhat, to what was going on, I ventured a remark.

“This beats the deuce!” I observed.

The machine stopped for an instant. The sheet of paper upon which the impressions of letters were being made flew out from under the cylinder, a pure white sheet was as quickly substituted, and the keys clicked off the line:

“What does?”

I presumed the line was in response to my assertion, so I replied:

“You do. What uncanny freak has taken possession of you to-night that you start in to write on your own hook, having resolutely declined to do any writing for me ever since I rescued you from the dust and dirt and cobwebs of the attic?”

“You never rescued me from any attic,” the machine replied. “You'd better go to bed; you've dined too well, I imagine. When did you rescue me from the dust and dirt and the cobwebs of any attic?”

“What an ungrateful machine you are!” I cried. “If you have sense enough to go into writing on your own account, you ought to have mind enough to remember the years you spent up-stairs under the roof neglected, and covered with hammocks, awnings, family portraits, and receipted bills.”

“Really, my dear fellow,” the machine tapped back, “I must repeat it. Bed is the place for you. You're not coherent. I'm not a machine, and upon my honor, I've never seen your darned old attic.”

“Not a machine!” I cried. “Then what in Heaven's name are you?--a sofa-cushion?”

“Don't be sarcastic, my dear fellow,” replied the machine. “Of course I'm not a machine; I'm Jim--Jim Boswell.”

“What?” I roared. “You? A thing with keys and type and a bell--”

“I haven't got any keys or any type or a bell. What on earth are you talking about?” replied the machine. “What have you been eating?”

“What's that?” I asked, putting my hand on the keys.

“That's keys,” was the answer.

“And these, and that?” I added, indicating the type and the bell.

“Type and bell,” replied the machine.

“And yet you say you haven't got them,” I persisted.

“No, I haven't. The machine has got them, not I,” was the response. “I'm not the machine. I'm the man that's using it--Jim--Jim Boswell. What good would a bell do me? I'm not a cow or a bicycle. I'm the editor of the Stygian Gazette, and I've come here to copy off my notes of what I see and hear, and besides all this I do type-writing for various people in Hades, and as this machine of yours seemed to be of no use to you I thought I'd try it. But if you object, I'll go.”

As I read these lines upon the paper I stood amazed and delighted.

“Go!” I cried, as the full value of his patronage of my machine dawned upon me, for I could sell his copy and he would be none the worse off, for, as I understand the copyright laws, they are not designed to benefit authors, but for the protection of type-setters. “Why, my dear fellow, it would break my heart if, having found my machine to your taste, you should ever think of using another. I'll lend you my bicycle, too, if you'd like it--in fact, anything I have is at your command.”

“Thank you very much,” returned Boswell through the medium of the keys, as usual. “I shall not need your bicycle, but this machine is of great value to me. It has several very remarkable qualities which I have never found in any other machine. For instance, singular to relate, Mendelssohn and I were fooling about here the other night, and when he saw this machine he thought it was a spinet of some new pattern; so what does he do but sit down and play me one of his songs without words on it, and, by jove! when he got through, there was the theme of the whole thing printed on a sheet of paper before him.”

“You don't really mean to say--” I began.

“I'm telling you precisely what happened,” said Boswell. “Mendelssohn was tickled to death with it, and he played every song without words that he ever wrote, and every one of 'em was fitted with words which he said absolutely conveyed the ideas he meant to bring out with the music. Then I tried the machine, and discovered another curious thing about it. It's intensely American. I had a story of Alexander Dumas' about his Musketeers that he wanted translated from French into American, which is the language we speak below, in preference to German, French, Volapuk, or English. I thought I'd copy off a few lines of the French original, and as true as I'm sitting here before your eyes, where you can't see me, the copy I got was a good, though rather free, translation. Think of it! That's an advanced machine for you!”

I looked at the machine wistfully. “I wish I could make it work,” I said; and I tried as before to tap off my name, and got instead only a confused jumble of letters. It wouldn't even pay me the compliment of transforming my name into that of Shakespeare, as it had previously done.

It was thus that the magic qualities of the machine were made known to me, and out of it the following papers have grown. I have set them down without much editing or alteration, and now submit them to your inspection, hoping that in perusing them you will derive as much satisfaction and delight as I have in being the possessor of so wonderful a machine, manipulated by so interesting a person as “Jim--Jim Boswell”--as he always calls himself--and others, who, as you will note, if perchance you have the patience to read further, have upon occasions honored my machine by using it.

I must add in behalf of my own reputation for honesty that Mr. Boswell has given me all right, title, and interest in these papers in this world as a return for my permission to him to use my machine.

“What if they make a hit and bring in barrels of gold in royalties,” he said. “I can't take it back with me where I live, so keep it yourself.”

Note that the true effect of the keyboard layout will be obscured by pangrams such as 'the quick brown fox jumps over the lazy dog', and will be wholly nullified by random strings... though I did define a randomString() function if you want to open up the console and use it.

How was typing speed calibrated?

Obviously a computer can simulate typing in the blink of an eye, so I had to measure time using a calculation. Currently, time is calculated as a function of finger travel distance (see how travel distance was calculated) with the following equation:

Time = (Distance * Row modifier + Fixed cost) * Timescale

Both keyboards obey the exact same timing calculations, so the only thing that can affect their time outputs is the distances they place between keys and which row they place keys on.

The timescale was calibrated so that the QWERTY keyboard will usually achieve ~70 WPM.

The row modifier is 1 for all rows besides the bottom row, which has a modifier of 1.2 to account for the awkward position. The fixed cost can be though of as the reaction time necessary to start moving towards the next letter and has a value of 18 (which just looked right).

How was travel distance computed?

Travel distance is quite literally computed as the distance it would take for each of your fingers to arrive at and press each character. All fingers are assumed to rest on the home row, and each letter is assumed to have one finger responsible for it. See Standard finger placement on a QWERTY keyboard.

When a letter is typed, the finger responsible for it moves from its previous position to the current position, then press down on the key.

Each letter key of the keyboard is assumed to be 15.5mm wide, 15mm tall, and have 3.3mm spacing between each key. Each row has a physical offset determined by the width of the tab key, capslock, and left shift, which are assumed to have widths of 1.5x, 1.75x, and 2.25x respectively. See Standard or Full-size Keyboard and Keycap Size Chart.

The keys are assumed to have a travel depth of 2mm, which is common for most laptops. See Scissor-switch keyboard.

The final distance calculation for a single finger traveling from its previous resting position to a new key and pressing the new key uses the Euclidean distance formula and adds the additional travel depth.

Key.x = offset + (15.5 + 3.3) * column index
Key.y = (15 + 3.3) * row index

Distance = sqrt( (Key1.x - Key2.x)^2 + (Key1.y - Key2.y)^2 ) + 2

Sources

The Dvorak Keyboard, QWERTY, and Typewriters

Keycap Dimensions

Proportion of Dvorak Users

Text Sample

Notes

TODO

  • Support heatmaps for text that's too long to play the typing animation
  • Modify distance calculation
    • After typing a key, the finger should return back to the home positions after a letter or two passes without being pressed
    • Worried about how to factor this in to the distance chart...