Why did you write Keyferret?

I work in a company with lots of people from lots of places and I wanted to be able to spell their names properly, without having to temporarily select a different language to do so. And my wife is a lecturer in Medieval studies and I wanted her to be able to enter her thorns(þ), eths(ð) and yoghs(ȝ) more easily. It just seemed like there should be a better way...

It started with me writing a regular keyboard driver for UK keyboards with dead keys, and I even got it to work with "chained dead keys" (e.g. RAlt+&, RAlt+a, e → æ) but after having written it I realised that even I had to keep looking back at a chart to work out what keys did what, and that dead keys are really counter-intuitive.

And once you know a better way, you just have to follow through…

Why “Keyferret”?

“Because there's always a key for it” ™ (really poor pun)

And because you can use the help to ferret around for the character you're after.

How does it work?

It sets up a hook into Windows to intercept your keystrokes (don't worry, it doesn't save them anywhere!). It remembers the last few you typed (so it knows what characters are to the left of the cursor), and directly handles keystrokes that it's programmed to, which do different things depending on those last few characters.

It prints characters by injecting them into the foreground application. It's actually injecting Unicode characters by their code (see unicode-table.com for a good list of them), so they need to be in a font to work. Later versions of Windows have support for more characters.

No language uses ȩ̂ – how come Keyferret can type it?

Unicode provides all the accents and diacritics effectively as separate characters (“combining characters”) that overlay the previous one, as well as having a lot of “precomposed” characters for the letter+diacritic combinations that turn up most commonly. When you add a diacritic to a character, Keyferret looks to see if a precomposed character exists for the combination and if so, replaces it with that instead. Otherwise it enters the combining character and leaves it to the program you're working with to try its best to display it.

Some environments (such as code editors) often don't support combining characters, and even for those that do, if you try to add an accent to a character that doesn't make much sense, it's likely not to look pretty, because the font designer probably hasn't spent a lot of time trying to make it look better. So if for example you try to add a cedilla to the letter p (p̧), don't expect great things. And stacking lots of accents might be fun (ạ̧̱̈̂̊) but might not be very portable.

Why does my font keep changing?

Fonts can't support every character in Unicode — there are far too many of them for that.

If you type a character not in the current font, Windows generally looks to see if it's in another font, and if it can find it, it displays it. If you're using something like Microsoft Word, it tends to stay in that font afterwards too, which can be somewhat inconvenient.

To minimise the effect of this, Keyferret plays some tricks with the keystrokes it uses to enter characters so that if you keep typing, you won't notice the font having changed. (The trick involves adding an extra space which it deletes again later). If you go back to the character you entered though, you'll switch to the substitute font. There really is nothing I can do about that ☹

Why don't you support symbol <x>?

Probably because it's not well supported in fonts, or it wasn't obvious to me that it was an important one. My aim is to comprehensively cover the supported scripts (Latin, Cyrillic, Greek and Hebrew), as well as common mathematical and other symbols. The range has grown over time but the full range of potential symbols is extremely large and I can't include them all. To enter emoji, you're better off typing Win+. and using Windows' built-in emoji support.

Which isn't to say that there aren't ways that it should be extended. You can always add your own characters or layout into Documents\keyferret\user.kflf. And if there's demand then I might be minded to add stuff.

Isn't it faster to type in the right layout for the language?

Quite probably. Keyferret isn't trying to be the fastest way to type in any language, instead it makes it possible to type characters in any language without having to install lots of keyboard layouts, switch between them, or even know which language a character comes from. And it supports many characters that aren't supported in any mainstream keyboard layouts. That said, it is designed to be relatively efficient for the most common languages that use the Latin alphabet.

Why do you keep saying “RAlt” instead of “AltGr”, which is what it says on my key?

Because not all keyboards have AltGr (most notably US keyboards) whereas all have a right-hand Alt key.

Why doesn't Keyferret work in applications with elevated security?

Because it works by tracking and injecting keystrokes, and runs as a normal user process. Windows, quite reasonably, won't let a user process do that sort of thing to a program running with administrator privileges!

Why isn't Keyferret available in the Windows Store?

Because programs downloaded from the Windows Store run in a sandbox, which would prevent Keyferret from working – it needs low-level access to keyboard events and needs to be able to inject keystrokes into any application in order to work.