• You are not logged in.
  • Index
  • General
  • Keyboard Optimizer Genetic Algorithm

Keyboard Optimizer Genetic Algorithm

  • Started by SpeedMorph
  • 97 Replies:
  • Reputation: 0
  • Registered: 17-Dec-2008
  • Posts: 59
SpeedMorph said:

Unfortunately, yes. I kind of just want a UI because that makes it more fun.

I just wish more people would publish their damn stuff. I've found at least three people with genetic algorithms that I didn't know about, because they never published anything. I thought there were just a few of us, but apparently there's a lot more.

My first idea was to use genetic algorithms, but I couldn't come up with a way in which crossover made any sense with keyboard layouts.  So, I started out with an algorithm called Iterative Repair (famous for solving immense versions of the n-queens problem) and tweaked it as needed.  What I ended up with turned out to be a kind of self-adjusting cousin to Simulated Annealing.  It works quite well and is very easy to understand.  Is it worthy of putting on SourceForge, though?  I haven't decided.  SourceForge has a bad reputation as being a dumping ground for people's quasi-finished (or less) projects, and I don't really want to be part of the problem.

Designing UIs is definitely fun, it just has the tendency to consume vast amounts of time.  Take it as a fair warning.  :)

Offline
  • 0
  • Reputation: 1
  • Registered: 22-Aug-2008
  • Posts: 36
Phynnboi said:

I'd be happy if MSKLC would allow changing virtual keys.  Having to do part of the process in a text editor is pretty annoying.

You can change the scan codes from Advanced View. Then you need to save the layout and reload it.

Offline
  • 0
  • Reputation: 183
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,236
Phynnboi said:
DreymaR said:

...break apart the Windows keyboard manager instead so we could get that portable 'MSKLC' working...

Portable?  You mean to other operating systems?  That's a pretty tall order, since as I understand it, they all have quite different mechanisms for remapping the keyboard.  Heck, I'd be happy if MSKLC would allow changing virtual keys.  Having to do part of the process in a text editor is pretty annoying.

Nope, I mean portable as in possible to run from a removable drive in 'stealth mode' (i.e., without any interference with the registry or local disks), like Maté Farkas' PKL app but at a lower level if possible. This involves intercepting the system's own keyboard handling (somewhere near GetKeyboardStateEx() ?), running your own version of MapVirtualKeyEx() and then inserting the result (by SendInput() ?) I guess; but my understanding of all that is still very fuzzy. But let's move that to another topic now if it is to be discussed further; it warrants that by now.

(On a side note: As you know, you are free to remap virtual keys with the MSKLC app - just not using its' primitive GUI. You can go even further if you compile manually. I happen to like text editing myself after I discovered Vim... lucky me.)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Online
  • 0
  • Reputation: 0
  • Registered: 17-Dec-2008
  • Posts: 59

vVv:
Scan codes, yes, but not virtual keys.  Modifying scan codes worries me a bit.

DreymaR:
Unfortunately, that's quite a ways outside my expertise.  I suppose AutoHotkey would be the closest thing, but when I tried that with Colemak, it would fail to translate some 1 in 10 keypresses for some reason.  This happened with two very different computers, so it's not just me.  I asked about it on the AutoHotkey forums, but last I checked, no one had answered, not even to say "it works for me" or "yeah, it does that to me, too."  Kinda weird.

I've been using gVim for several years, but am on the brink of switching to something else because 1) it's a pain to deal with with non-QWERTY layouts, and 2) I occasionally forget I'm in "normal mode" and plow over my document by typing a burst of characters as if in "insert mode."  I use gVim pretty much every day, so it's not lack of experience.  Either this is a universal experience, or my way of thinking and gVim's are just incompatible.  Either way, I don't like it.  :/

Offline
  • 0
  • Reputation: 21
  • From: Belgium
  • Registered: 26-Feb-2008
  • Posts: 475
Phynnboi said:

I suppose AutoHotkey would be the closest thing, but when I tried that with Colemak, it would fail to translate some 1 in 10 keypresses for some reason.  This happened with two very different computers, so it's not just me.

I had the same problem with AutoHotkey.  When typing too fast, it often missed some characters that were not translated like you say, ie. I got their Qwerty equivalent.  This annoyed me so much that I switched to PKL, and I haven't had any problems ever since.

(I'm using Windows only on two PC's at work, at home it's all NetBSD/X11 which has native support for Colemak.)

Phynnboi said:

I've been using gVim for several years, but am on the brink of switching to something else because 1) it's a pain to deal with with non-QWERTY layouts,

I'm using vi every day with its original keybindings.  I can't afford to change them because for my job I (co-)administer >300 Linux & Solaris servers and I really don't want to install alternative configurations on each of them (and many have nvi, not vim).  But the original keybindings work just fine for me (apart from navigation, which I use the arrow keys for).

Offline
  • 0
  • Reputation: 0
  • Registered: 14-Mar-2012
  • Posts: 7

Hello, I was wondering if there are any programs or if a kind fellow from this forum could either point me to a download or source code tarball I could compile which I can then use to rate my keyboard I've been trying to suit me best.
I have compiled a version of Keyboard Layout Optimizer from http://mtgap.wordpress.com but It's taking a while to understand for immediate usage.

So until I can find out how to operate and configure it correctly, I'd like to ask what people think of the keyboard layout optimizer's available.

Last edited by HeavensRevenge (16-Mar-2012 20:28:50)
Offline
  • 0
  • Reputation: 1
  • From: Sofia, Bulgaria
  • Registered: 05-Mar-2011
  • Posts: 387

I haven't looked at it very deep or made any analysis but the period on that position? And the J on its "original" position? The comma and period are fairly often used. I wouldn't keep them there. The J is and G are on far easier to press positions.

But hey, it's all about what your typing style is and how do you feel with it.

Offline
  • 0
  • Reputation: 0
  • From: Switzerland
  • Registered: 21-Aug-2007
  • Posts: 176

I haven't tried MTGandP's optimizer (from the mathematicalmulticore.wordpress.com blog) yet, but I probably will soon.

So far I used carPalx to analyze layouts. Once it's installed and the tutorials done you should be able to use it too.

Then there's also this online layout tester. I dunno how well it compares to the other too, but it's comparably easy to use (check out the examples after pressing "Add Your Own Layout").

Last edited by boli (17-Mar-2012 09:56:47)
Offline
  • 0
  • Reputation: 0
  • Registered: 14-Mar-2012
  • Posts: 7

Ive just finished making my own layout named Eaton V2:

qwym / ; pdhf-=\
raei u l tons'
zxcv j k bg,.

Does it whoop most corpi' when you also included backspace correction as it does for my own tests on http://www.andong.co.uk/dvorak/ Or by using your own home-brew layout rating program?

Last edited by HeavensRevenge (19-Mar-2012 17:06:51)
Offline
  • 0
  • Reputation: -5
  • From: Banned
  • Registered: 02-May-2015
  • Posts: 116
SpeedMorph said:
ghen said:
SpeedMorph said:

Also I find it a bit surprising that Arensito and Capewell do worse than Dvorak.

Patorjk loves Arensito, your algorithm hates Arensito. That's because Arensito is optimized for distance very much, at expense of using weak fingers and off-home row more than QWERTY. CarpalX thoughts where base is distance and penalty is using weaks/off-homes and lower is better:
plot-bp.png
Hallingstad is Arensito.
Note that these are clearly negative correlated (optimizing one is at cost of increasing other). Six layouts came at simple curve.
See this link for more detailed:
http://mkweb.bcgsc.ca/carpalx/?popular_alternatives

Last edited by PiotrGrochowski (12-Jun-2015 07:31:03)

Banned from Colemak

Offline
  • 0
  • Reputation: 183
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,236

The position of Colemak on that curve is quite promising: Looking at it, you might think that the optimal layout is a bit down on the curve but that's rather heavily dependent on your choice of "penalty" vs "base" weightings; what's clear though is that Colemak seems both well optimized and well balanced!

Not sure why Dvorak doesn't do better, though. It's a decent layout (but moves way too many keys!).

Also, from that curve it would seem that CarpalX's layout sacrifices base cost completely to achieve lower penalty? Which is odd, as this is his own assessments.

Which online analyzers are good? I only know of Patorjk's and Stevep99's that are easily available and decent. And as you hint to, Patorjk's analyzer is quite biased towards some goals that I don't quite subscribe to.

Last edited by DreymaR (12-Jun-2015 07:28:02)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Online
  • 0
  • Reputation: -5
  • From: Banned
  • Registered: 02-May-2015
  • Posts: 116
DreymaR said:

Also, from that curve it would seem that CarpalX's layout sacrifices base cost completely to achieve lower penalty? Which is odd, as this is his own assessments.

If base is optimized, increased penalty is much higher than optimizing penalty at cost of base. See curve and numbers at sides for scale.

Banned from Colemak

Offline
  • 0
  • Reputation: 183
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,236

Sure. But it still depends heavily on a mostly subjective weighting of base vs various penalties! So the exact numbers don't hold too much significance really.

Some algorithms like Fitt's estimate the actual time cost of actions. They give more objective results, but probably can't quite tell you which keyboard layout is the best for you nevertheless.

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Online
  • 0
  • Reputation: -5
  • From: Banned
  • Registered: 02-May-2015
  • Posts: 116
DreymaR said:

Sure. But it still depends heavily on a mostly subjective weighting of base vs various penalties! So the exact numbers don't hold too much significance really.

Some algorithms like Fitt's estimate the actual time cost of actions. They give more objective results, but probably can't quite tell you which keyboard layout is the best for you nevertheless.

1. base is negative correlated with penalty (optimizing one results in other one worse)
2. penalty is correlated with stroke (optimizing one results in other one also lowered)
3. stroke is negative correlated with base (optimizing one results in other one worse)

So it's possible to improve both penalty and stroke, at cost of higher base (2 at cost of 1). So does QGMLWB.
plot-bp.png negative correlated
plot-ps.png correlated
plot-bs.png negative correlated

Last edited by PiotrGrochowski (13-Jun-2015 07:42:43)

Banned from Colemak

Offline
  • 0
  • Reputation: -5
  • From: Banned
  • Registered: 02-May-2015
  • Posts: 116
DreymaR said:

Not sure why Dvorak doesn't do better, though. It's a decent layout (but moves way too many keys!).

The only thing in which Dvorak is better than Colemak is hand alternation. Base and penalty have nothing to to with hand alternation.

Banned from Colemak

Offline
  • 0
  • Reputation: 183
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,236

I didn't mean better than Colemak, but better than its poor position in that diagram. The other diagrams illustrate it though: Dvorak is a bit high on base, in the middle of the heat on penalty and okay on stroke. So on the base-penalty diagram, it doesn't shine.

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Online
  • 0
  • Reputation: -5
  • From: Banned
  • Registered: 02-May-2015
  • Posts: 116
DreymaR said:

I didn't mean better than Colemak, but better than its poor position in that diagram. The other diagrams illustrate it though: Dvorak is a bit high on base, in the middle of the heat on penalty and okay on stroke. So on the base-penalty diagram, it doesn't shine.

I thought you asked why dvorak didn't enter the curve, not better than colemak.

Banned from Colemak

Offline
  • 0
  • Reputation: 183
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,236

Stroke-effort, hmmm... :-p

Okay, now stroke-penalty looks weird too! :-D

Last edited by DreymaR (13-Jun-2015 11:41:03)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Online
  • 0
  • Reputation: 183
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,236

One thing we can agree on, is that our dawg CarpalX knows how to drop the base.

Last edited by DreymaR (13-Jun-2015 13:12:23)

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Online
  • 0
  • Reputation: -5
  • From: Banned
  • Registered: 02-May-2015
  • Posts: 116
DreymaR said:

One thing we can agree on, is that our dawg CarpalX knows how to drop the base.

What does dris means?

Banned from Colemak

Offline
  • 0
  • Reputation: 183
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,236

Oo, it's a complex bit of humor Piotr. Not sure I can explain it to you easily, really, but here goes:
• "Drop the bass" is an expression from pop music, look it up
• It's often used in word jokes such as "Why can't dubsteppers work in chemistry labs? Because they keep dropping the base!"
• In this case, CarpalX choses to focus on "penalty" over "base" which sets his layouts apart from other optimized layouts; Colemak seems similarly optimized but with lower "base" and higher "penalty"
• Thus, one may say that CarpalX drops the base, and make a silly joke about it!

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Online
  • 0
  • Reputation: -5
  • From: Banned
  • Registered: 02-May-2015
  • Posts: 116
DreymaR said:

Oo, it's a complex bit of humor Piotr. Not sure I can explain it to you easily, really, but here goes:
• "Drop the bass" is an expression from pop music, look it up
• It's often used in word jokes such as "Why can't dubsteppers work in chemistry labs? Because they keep dropping the base!"
• In this case, CarpalX choses to focus on "penalty" over "base" which sets his layouts apart from other optimized layouts; Colemak seems similarly optimized but with lower "base" and higher "penalty"
• Thus, one may say that CarpalX drops the base, and make a silly joke about it!

The reason for CarpalX focusing on penalty over base is that stroke can also be optimized.

Banned from Colemak

Offline
  • 0
  • Reputation: 183
  • From: Viken, Norway
  • Registered: 13-Dec-2006
  • Posts: 5,236

Yes, I think I get that. It's still pretty much up to subjective assessments though. There's no real proof for what factors are more or less important and by how much, unfortunately.

*** Learn Colemak in 2–5 steps with Tarmak! ***
*** Check out my Big Bag of Keyboard Tricks for Win/Linux/TMK... ***

Online
  • 0
  • Index
  • General
  • Keyboard Optimizer Genetic Algorithm