Category Archives: Random

Other stuff.

One year with the Truly Ergonomic keyboard

In late 2013 I started thinking about switching to an ergonomic keyboard. I did not have wrist pain or other health issues – although preventing them is a good reason as well, I mainly wanted to improve my productivity.

The key layouts on typical keyboards are vastly suboptimal: the alphanumeric keys are staggered (a carryover from mechanical typewriters), and important keys (modifiers, Backspace, Return, arrow keys) are too hard to reach. Although this is often worked around in software (e.g. hjkl movement keys in vi, Colemak remapping Caps Lock as Backspace), it is much more effective to fix the keyboard instead.

I was looking at three options:

I ruled out TypeMatrix due to keylock (I think lack of NKRO is not acceptable for a high-end keyboard), and the Kinesis struck me as overly bulky – I wanted something I could take with my laptop (the TECK’s hand rest is removable).

Truly Ergonomic’s customization choices basically boil down to whether you want one big button (Model 227) or two small ones (Model 229) on the bottom corners of the keyboard, whether you want blue, brown or clear Cherry MX switches, and whether you want blank or QWERTY keycaps. My selection was Model 229 with brown switches and blank keycaps (using Dvorak for a decade, and I planned to reprogram the keyboard anyway). I ordered it on 2014-02-02 from The Keyboard Company and received it on 2014-02-06.

Model 229 TECK with blank caps.

I’m writing this on 2015-05-25, so it’s been about 16 months. Here are my notes so far: Continue reading

Installing PHP and Apache module under /home

Let’s say you have your own Apache 2 setup in your home directory, and you want to build and install PHP as well, and set it up as an Apache module without root privileges (e.g. if you want to use a different PHP version than the one installed globally).

You may run into problems such as PHP’s configure script not detecting apxs2 (and thus not building an Apache module). Continue reading

Fixing DirectMusic on some 64-bit Windows versions

If you’re getting error messages such as “No sound device detected. Sounds might not play.” or “Failed to create Direct Music Performance.” when running Game Maker games, the following may help you. Here’s what I did to fix them on my system:

  1. Download the DirectX redistributable
  2. Unpack it
  3. Unpack dxnt.cab
  4. In dmusic.inf, search and replace “HKCR,” with “HKCR,Wow6432Node\
  5. Install the edited dmusic.inf (from the right-click menu)
  6. Copy missing DLLs (dm*.dll) to %WINDIR%/SysWOW64.

That’s it! The same method could work for other DirectX components as well.

Why is the amount of text I can type in my combo box limited by its width?

Once in a while you’ll stumble upon a combo box which doesn’t allow you to type past the right edge of the control. When normally typing more text would just scroll the contents, you’ll just get back an annoying beep. The amount of text you can enter is actually bound by the on-screen width of the text – thus, you may be able to enter 125 “i” characters, but only 25 “W” characters.

The cause of the problem is that the combo box was not created with the CBS_AUTOHSCROLL style:

CBS_AUTOHSCROLL
Automatically scrolls the text in the edit control to the right when the user types a character at the end of the line. If this style is not set, only text that fits within the rectangular boundary is allowed.

Visual Studio’s resource editor has a different name and description for this property:

Auto
Automatically scrolls text to the left when the user types a character at the end of the line.

WordPress “Pixel” theme – fixed background mod

I love fixed backgrounds. So, I made a version of Sam‘s Pixel theme with a fixed background (which you can see on the blog already). It even supports IE6 (well, almost) – thanks, ie7-js!

Note: I re-exported the background from the original PSD as a PNG, since it’s too beautiful to be degraded by JPEG compression artifacts. The PNG is about 350kb in size – so, if that bothers you, convert it to JPEG and edit style.css accordingly.

Download

Ctrl+Tab and Ctrl+Shift+Tab in Eclipse

The Eclipse IDE doesn’t use the overwhelmingly common Ctrl+Tab and Ctrl+Shift+Tab shortcuts to switch editor tabs. Not only that, it doesn’t even allow you to bind these keys to the classic Ctrl+Tab behavior (switch to the tab left/right of the current one). However, Ctrl+PageUp/Down seem to be hard-coded to switching tabs the good-old way, so it’s just a matter of remapping Ctrl+(Shift+)Tab to those keys.

Here’s my AutoHotKey solution:

#IfWinActive ahk_class SWT_Window0
^Tab::Send ^{PgDn}
#IfWinActive ahk_class SWT_Window0
^+Tab::Send ^{PgUp}