Hacking on USB

I like all-in-one chips. The BCM2040 is an all-in-one bluetooth keyboard/mouse solution. Connect it to a plain ‘ol keyboard matrix and hey-presto you have a bluetooth keyboard. I’m thinking about attempting to mod my twiddler chord keyboard into a bluetooth device using one of these, if I can get my hands on them.

Whilst on the subject of hardware, I notice that the Microchip PIC range now includes a couple of devices with USB support. This is cool because it means that it’ll be relatively easy to make my soon-to-be-built keyboard foot pedals into a USB device.

Refactoring Keyboards

After Thomas cunningly found a cheap way to get a smaller keyboard, I’ve been thinking about keyboards. I try to make myself conscious of how I do things and think about whether there’s a better way. I might not spend a lot of time thinking about keyboards, but I spend thousands of hours each year using one, and several of my friends have had crippling injuries related to keyboard use, so really it does merits some thought.

There’s at least two things to think about. Firstly, what physical input device is most useful for you. I spend a lot of time writing code and navigating code. I’m certainly not typing english text all day long. So it is likely that a keyboard design invented for people typing out memos is optimal for me? Unlikely, I think.

That’s a common problem with design of popular objects – economics causes a worse-is-better situation. Regardless of whether or not qwerty is Best, it’s unlikely to go away quickly because People have learned to use them and have little interest in learning something different. So, they’ll buy qwerty keyboards. And economies of scale makes qwerty keyboards cheap. People don’t choose a keyboard because it is Better, they choose it because it is cheap and familiar and requires no new learning. So that means that if you want to set away from the mainstream you’re going to have to spend more money because economies of scale are no longer shining their light in your direction. (Unless you are cunning like Thomas was)

Secondly, there’s the question of how you set up your software to make the most of your input hardware. I’m a big (x)emacs fan, mainly because it is easily mouldable into a tool which is useful for the work that I do. It becomes a tool for me, customized to allow me to easily do the things which I do every day. I watched myself for a week, noticing which tasks I did most often. Then I automated these tasks, and set up key bindings so that my common tasks were easily reachable with single keystrokes. Now when I want to push source code from my windows machine to the linux box on my desk and compile it, a single keypress launches unison to sync the files, then runs make/scons over ssh. That’s a task which I was doing several times a day. Now it’s a single keypress. I like “do what I mean” keypresses too. For example, I have a key-press that gets me to a shell prompt. I don’t care whether or not I was already running a shell – the computer will start one if needed, or switch to an existing one if possible. I don’t want to be hitting alt-tab, looking at the screen and figuring out how many times I need to keep hitting alt-tab to get to the right application or thinking about where the start menu icon for that program is. Do what I want, computer. But software is malleable and exists in a virtual world. We are physical beings and we communicate with the computer by hitting buttons and sliding around lumps of plastic.

So, back to the physical design question, unfortunately you have to weigh up the fact that you want a device which allows you to efficiently control your computer, but also one which won’t cause you discomfort and injury. Computers can be nasty things because they occupy your brain with interesting things, and you end up ignoring your physical body. In the past, I’ve been so involved in coding that my body has got really really cold. I only noticed when my fingers started getting less responsive from the cold and I started making typing mistakes! I’m really bad at noticing this gradual decrease in body temperature – I ended up putting a digital thermometer next to the computer. Anyway, here’s a quick experiment to get you thinking about physical design – try switching off your monitor and sit in your “at the computer” pose for five minutes. Without the internet to distract your mind, you’ll notice that sitting with your arms out on front of your isn’t a terribly natural or comfortable pose for humans. Now think about how many hours of your life you spend on front of a computer.

I’ve tried a few alternatives to the usual keyboard. I find the Microsoft “ergonomic” split keyboard to be pretty good, and I use one at work. I also have a twiddler chord keyboard, which I can use well enough to type english text at an acceptable rate, but it’d take a reasonable amount of customization to make it useful for programming. Tonight I found the Keybowl which is a kind of gesture keyboard. And there’s always the choice of where to put your keyboard – for example, on the arms of your chair. I also think that foot pedals could be interesting, not least because it’d be easy for me to knock some up and see how useful they are. If you could do shift/ctrl/meta/hyper keys on footswitches, then your fingers could get back to only ever hitting one key at a time. I find that scrollbars are one of the most annoying bits of gui which I have to deal with several times an hour. You have to zero in on a tiny bit of screenspace and carefully drag this wee thing around. A tilting footswitch would be ideal for this. I’d love to play with an eye-tracking system – I wonder if you can build one yourself without accidently burning your retina with a laser .. maybe you’d have to be careful to avoid repetitive looking injuries though. 😉

They’re in the trees

Every so often, I learn a “life lesson”.

In the middle of May, I met up with the usual suspects to go camping. When I say camping, I really mean drinking beer and burning stuff. Lots of fun. Anyway, that was the middle of May. We’re now past the middle of June. This is a significant time delay.

At one point, whilst wood was being chopped I had the great idea of chopping off a chunk of tree and taking it home to make something on my woodlathe of sorts. I lopped off a nice 4″ long slice of birch wood, and figured I could dry it out and make a bowl out of it. It went into my rucksack before the ride home, and was then dumped in the corner of my living room. Eventually, I planned to spin it around at high speed and wave sharp tools at it, but I left it in the sun so it dried out too fast and cracked.

On Friday morning, just before I went to work, I noticed there was a funny cracking sound coming from the wood. After prodding it, it seemed like the bark was coming away from wood. No great surprise, I guess .. the wood was probably just drying out some more and shrinking away from the bark. I also noticed a single small perfectly circular hole in the wood, which I’d never seen before. I prodded a wire in the hole to see if there was anything in it, but nothing exciting happened so I left the wood in the corner of the room and went to work.

Then when I got home: Buzzing sound near the window. Biggest FOAD insect I’ve ever seen in Scotland clambering nervously over the blinds. We don’t get many big insects here – I guess it’s too cold – but this was a bug of significant proportions. Eep! I carefully removed the Bug to the garden. Then I come back inside and looked at the bit of wood.

There are now three holes in the wood.

Jeez, so let’s assume the original hole had been there for a while and Bug #1 was long gone. Bug number #2 had just been relocated to the garden. So that meant Bug #3 had moved out of it’s Birch home and was now living it up in my flat somewhere. And Susan really doesn’t like bugs. “Hi honey, remember that lovely bit of wood I brought back from camping?”. Cue a frantic bug-hunt.

I found it eventually, huddled in the corner. It was the same flavour as bug #2, but a bit more energetic. I guess nature didn’t prepare them for bursting out of a tree into a double-glazed flat.

That bit of wood had been sitting quietly in the corner of my living room for well over a month. All that time, it had been playing host to two little maggots which grew bigger and bigger, until one day the wood started making cracking sounds and two big bugs ate their way out. It’s like a plot for a horror movie.

Won’t be doing that again.


In the end, I took the plunge and moved my blog from MoveableType to WordPress. Links to existing blog entries should still work, due to the wonders of mod_rewrite, and the RSS feed has full content. First impressions are very positive – wordpress runs a lot faster and is a lot easier to tweak.