views:

233

answers:

4

Very simple dilemma. A user needs to be able to do a search-and-replace in a large piece of text. Code to do this is a piece of cake. No problems there. Works like a charm! Don't break your head over that. That's solved! It's a non-issue...

No, problem is defining a good shortcut for this function. While I would prefer to use CTRL+R as shortcut for this functionality (and CTRL-F for finding text) I noticed that Microsoft is using CTRL-H as shortcut! (And F3 to find text, although CTRL+F mostly works too.)

So, what should be the preferred shortcut for this simple function? CTRL-R or CTRL-H

And second Q for additional points: Where does CTRL-H come from? What does the H mean? At least, the R stands for Replace but the H???

This relates to the GUI design of a Windows application. While it's a trivial matter, it's just good to be consistent with the generally accepted norm! While GUI's aren't always popular amongst programmers, keeping your GUI consistent with the norm is definitely programming-related!

+5  A: 

While I also think that Ctrl+R is the more "obvious" and "natural" choice for replace, I'd go for Ctrl+H because of consistency reasons. If users are used to replace text by using Ctrl+H (e.g. because they use MS Word) then they'll be happy if it works in your app as well... however, if it won't work it will be a little pain because they have to change their habits.

For searching I always use Ctrl+F. And if you don't need F3 for any other purpose, just use that for searching as well. You're covered for both cases then :)

Also see this blog post by Joel: http://joelonsoftware.com/uibook/chapters/fog0000000061.html

Christian
It seems like Ctrl+H is used for many Microsoft apps, not only Word. I tested in Notepad and VisualStudio.
awe
+4  A: 

CTRL-R is part of the formatting shortcut keys in office, it right justifies the selected text or current paragraph. As this function is probably used more than search and replace it makes sense to give it CTRL-R

The MS UX guidelines (not that they stick to it themselves) has a keyboard section where they indicate that you should use the Windows OS shortcut keys to map to similar functions - so CTRL-H it is.

blowdart
+2  A: 

I think Ctrl+H came from WordPerfect. Or, maybe H for repHace :O) (I am serious.)

Stick with Ctrl+H. Most applications use Ctrl+H. Don't confuse your users. Don't force your users to remember one-off shortcut keys. Don't annoy your users. They will not remember or bother to remember or think it is a bug.

AMissico
A: 

We not simply map the action to both shortcuts so that both Ctrl+R and Ctrl+H will do the same?

Alternatively, you could make it a configurable option so that the user can decide which one they want to use.

Mark Seemann
"Ctrl+R and Ctrl+H" Really confuse the user. Keep simple, no "options".
AMissico
I agree with AMissico here. Two options for the same function would be too confusing...
Workshop Alex