Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Search and replace: What's the proper shortcut?

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!

like image 652
Wim ten Brink Avatar asked Sep 14 '09 08:09

Wim ten Brink


3 Answers

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.

like image 149
Christian Avatar answered Sep 24 '22 01:09

Christian


I don't know when or who used Ctrl+H first, but the reason is very simple: Ctrl+F find, Ctrl+G (the next key on QWERTY) for find next, and Ctrl+H (the next one) for replace.

The same happends with copy-paste, Ctrl+C has a logical meaning, but X for cut and V for paste are the adjacent keys.

I would rather use H than R for consistency. R is also used to run scripts in some programs. And I have notice that most of the people don't use these shortcuts and won't try, Ctrl+R but the ones who are used to them may use Ctrl+H or check it.

like image 28
SailorMD Avatar answered Sep 25 '22 01:09

SailorMD


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.

like image 34
blowdart Avatar answered Sep 25 '22 01:09

blowdart