Saturday, November 25, 2006

KeyFix4000: Improve your MS Natural Keyboard 4000

I'm loving the MS Natural Keyboard 4000, but it does have some issues.

First, it is conspicuously missing a Windows key on the right side. Second, there is no way to remap the back and forward buttons to act as mouse buttons. After googling in futility for a solution, I decided to whip one up myself. (After all, this was nothing a little keyboard hooking couldn't solve.)

The result? KeyFix4000.

The mouse button mapping is pretty straight-forward - it just translates a click on the back/forward button to a click on the left/right mouse button.

The Windows key issue was a little tricky - how do you fix a key that doesn't exist? Well, the Apps key is pretty much where the Windows key should be, and I realized I could overload it. Now, when pressed by itself, it functions as the Apps key, and when pressed in combination with another key, it works as the Windows key. This dual usage works surprisingly well.

Download executable
C++ source code at GitHub

Sunday, November 12, 2006

Sick bugs, part 1

I'd really rather not reminisce on the sick and twisted path that led me to this one, so I'll just present it as is:

void bar() {}

namespace foo
using ::bar;

using namespace foo;
// namespace {}

int main(int argc, char * argv[])
return 0;

In VC6, the preceding block of code produces
error C2668: 'bar' : ambiguous call to overloaded function
and the error goes away when you uncomment "namespace {}". Yikes.

Sunday, August 27, 2006

Fixing Google

A couple weeks ago, Google decided to yank the Groups link from its search pages and hide it under a new "more »" link. This pissed off a few people (including me), but given that this was a change to core search UI of Google, I'm surprised the reaction wasn't stronger. Maybe the extra mouse click just isn't a big deal for most people.

For the rest of us, however, this was begging for a fix. My searching revealed a Chickenfoot script here that looked promising. Unfortunately, I found that Chickenfoot isn't quite ready for primetime. When I set the script to run on **, then went to, Chickenfoot caused Firefox to freeze and consume 99% CPU.

At that point I knew I knew it was time to break out good ol' Greasemonkey. A couple hours of hacking, and the problem was solved. The script is easily customizable, and by default also restores the Froogle and Books links. Let me know if you have any suggestions or feedback.

Update: Google changed a few things that broke the script. I should have an update this weekend that fixes it and makes it more resistant to being broken by minor changes.

Update 2.0: Made a few tweaks and got everything working again. As per David's request, the script also has two new functions. hideGoogleSearchLink moves a link off the main page and into the 'more »' popup. removeGoogleSearchLink gets rid of a link altogether. Enjoy...