Improvements to TwitToday

I’ve been doing too much Java at work recently, so in the interest of keeping my hand in with some low-level C++, I picked up the code for my mobile twitter client, TwitToday, again.

I originally wrote it at a hackday, but I’ve since come back to tweak it a couple of times to get it to spawn background worker threads, add SIP on-screen keyboard support, and improve support for sending special and accented characters.

After another evening of tweaking, I’ve added a few new minor features:

Transparent text box

When not in use, the text box is now transparent. When it has focus, it is coloured in white as usual.

A few people commented that a bright white text box could dominate a dark Today screen too much, so this is hopefully a nice aesthetic improvement.

I did this by creating a custom windows procedure for the text box.

The windows procedure needed to handle a couple of events:

Handling WM_PAINT by using SetBkMode to make the text box TRANSPARENT

Handling WM_ERASEBKGND by using TODAYM_DRAWWATERMARK to draw the background over the text control’s rectangle.

Keyboard navigation

You used to need to tap inside the text box to use it.

Now, you can use the phone’s D-Pad to scroll up or down to the TwitToday text box.

When the TwitToday line is selected, the focus is set to the text box so that it is ready for you to start typing.

I did this by altering the value of the Today Screen item’s Selectability registry key to ‘2’.

I then used a custom windows procedure for the Today Screen window to capture WM_TODAYCUSTOM_RECEIVEDSELECTION events. At which point, I use SetFocus to set the focus to the text box.

I added a separate custom windows procedure for the text control itself, and when selected, capturing WM_KEYDOWN events to look for VK_TUP and VK_TDOWN keys – at which point I deselect the Today screen item and allow the selection to pass to the Today Screen items above or below me.

‘Enter’ to send

You used to need to tap the ‘OK’ button on the screen to send a tweet.

Now, pressing ‘Enter’ moves the focus to the ‘OK’ button for you – from where pressing ‘Enter’ again will send the tweet.

I did this by using the custom windows procedure for the text control itself, capturing WM_KEYDOWN events to look for VK_TACTION at which point I use SetFocus to move the focus to the OK button.

.

And that’s it. Download it here. It makes the client a little less obtrusive, and saves you having to get out the stylus to use it. Minor tweaks, but they do improve the usability quite a bit.

Unfortunately, I never got around to doing anything clever around notifying users of updates, so most people who use my Twitter client will never know that I’ve made these changes. Whoops ๐Ÿ™‚

Tags: , , , ,

3 Responses to “Improvements to TwitToday”

  1. mwiththeat says:

    Aweseome work!

    Any chance of an Android desktop widget which does the samething? ๐Ÿ™‚

  2. MaPhi says:

    Great work, especially the matching update of the WikiToday plugin. I have to install that ASAP.

    For TwitToday, you could write a twit when you change something ๐Ÿ™‚

  3. Anders Holt says:

    Tried this on the new version of bladewiki todayplugin – and now… it works very much as desired – thannk you!!