robburke.NET
© 2010 Robert Burke
All Rights Reserved.

Application KeyMy Dell Studio 17 does not have an “Application Key” – the key that usually sits beside the Windows key and behaves like right-clicking the mouse on a UI element.  I have no idea why Dell chose to omit one of the most useful keys on the keyboard, especially for laptop users, who pay a larger productivity tax every time they switch between keyboard and mouse.

This great registry trick at US Netizen lets you re-map keys like Caps Lock.  So I used it to re-map the Caps Lock key, which I never use, to the Application Key.  I’ve since found this remapping so handy that I’ve re-mapped Caps Lock to the Application Key on all my other client machines.

Caps Lock is oversized, easily accessible with your left hand’s little finger, and completely useless.  On the other hand, the Application Key, even when not omitted from a keyboard design, can be awkward to reach.  Just so I don’t have to figure it out again, here’s a Registry Edit file (.reg) that performs this re-mapping:

Registry Edit file to re-map Caps Lock to the Application Key (zipped .reg).

Double-click the .reg file to re-map Caps Lock and then reboot for the change to take effect.

This has worked for me on XP, Vista, and Windows 7 [edit 19 Aug 2009: including RTM].  However, the above .reg file comes with no guarantees – I tweaked a .reg I lifted from the US Netizen site – so use at own risk.  I am putting it here because it’s so useful, I’m sure to be back for it again [edit 19 Aug 2009: and I have :) ].

Managing WPF keyboard focus can be a challenge, especially if you’re retrofitting an application that’s full of custom styles and templates, and lots of customized ItemControls, each of which was originally designed by your Designer principally for pointer-based input.

Tab-tab-tab between controls should “just work,” but it turns out, it’s a lot more complicated (with good reason) than just setting the tab order.

Mark Smith just posted a series of very practical series of three articles about this subject. However, he has no contact link or comments enabled in his blog (that I could find), so the best I can do is link to him here. Thank you Mark!

Part 1: It’s Basically Focus

Part 2: Changing WPF Focus in Code

Part 3: Shifting focus to the first available element in WPF

My biggest learning from this process? No matter what you’re buliding, don’t let keyboard focus in your application be an afterthought!