Tuesday, January 22, 2013

Keeping up with the keys.

While I've done next to nothing since my last blog entry, Slug over at Engine12 has been busy cranking out openwrt jffs release candidates at a furious pace.  And he seems to have a fairly clear vision of precisely how to properly utilize the zipit keyboard.  Since I'm far too lazy to clarify my own blurry vision, I've been attempting to guide him ever so slightly, so as not to completely destroy what little work I've done along with Dronz towards a unified zipit keymap incorporating the Latin 15 character set.

So far I've given up the volume keys on the side of the zipit for use as global controls for the headphone and speaker volume, as well as dimmers for the LCD and keyboard backlight.  I've always wanted direct access to those functions, and the volume keys are difficult to reach with your thumbs, so this plan seemed as good as anything I'd have come up with.  Probably better.  Now I just have to build a new ebindkeys executable for IZ2S to support this.

Meanwhile some of the other keys have changed their meanings slightly in order to homogenize the usage conventions in the various SDL apps currently popular in the openwrt distro.  Slug has some preliminary documentation in text form.  But I need pictures so I grabbed the latest zipit keymap pdf file, converted it to png and started editing so I could keep track of the changes and eventually incorporate them into the IZ2S keymap when it all starts to stabilize.  Here's what I have so far.
I've been using the Windows XP version of paint to update this.  So far I've added the scan codes using the Courier New Bold font, and updated some of the key definitions in various sizes of Ariel Bold.  I've also recolored some of the squares to make room for the new key settings.  It's now got the Latin characters and dead key accents from dronz's IZ2S keymap and the names of the scripts in /usr/local/sbin called by slug's ebindkeys setup.  There's currently a conflict between the F5 key and the tilde dead key accent on ctrl-shift-T, but I see there's an open spot on the N button for the tilde dead key.  According to wikipedia the tilde originally was the letter N, so maybe that's a reasonable match?

 Feel free to add any of the many of the bits I've left out so far.

As a small bonus, all of this keyboard work got me inspired to attempt a fix for the sticky alt key problem in SDL.  The one weird symptom of this problem was SDL reporting the alt key as a left alt key instead of altgr, or even right alt.  So I hacked SDL_keyboard.c and SDL_fbevents.c to force any alt key to be an altgr, despite whatever the console says it is.  It should be fine on the zipit because the one and only alt key must be an altgr if we want to use the red labels on the keyboard buttons.  Anyhow, the hack seems to make the SDL unicode translator pick the correct key mapping based on the altgr modifier.    I need to do some more work to make the sticky part work and then perhaps add compose key support, but at least now I shouldn't have to switch to a non-stick keymap just to run an SDL program.  So that's a small win.

Still needs lots of testing to make sure I didn't break something else.

libsdl-iz2s-altgr-fix.zip

The patch is here.

The original keymap diagram pdf is here.