views:

310

answers:

3

Almost any mature program that involves text implements "double click to select the word" and, in some cases, "triple click to select additional stuff like an entire line" as a feature. I find these features useful but they are often inconsistent between programs.

Example - some programs' double clicks do not select the ending space after a word, but most do. Some recognize the - character as the end of a word, others do not. SO likes to select the entire paragraph as I write this post when I triple click it, VS web developer 2005 has no triple click support, and ultra-edit 32 will select one line upon triple clicking. We could come up with innumerable inconsistencies about how double and triple click pattern matching is implemented across programs.

I am concerned about how to implement this behavior in my program if nobody else has achieved a convention about how the pattern matching should work.

My question is, does a convention (conventions? maybe an MS or Linux convention?) exist that dictates how these features are supposed to behave to the end user? What, if any, are they?

+2  A: 

In Windows, Linux and OS X double-click selects the word under cursor triple-click selects the entire line of text (single line only, i.e., wrapped line)

rkulla
Chrome on Windows selects an entire paragraph for triple click.
rjh
+1 I like it when triple-click selects the sentence.
Blair McMillan
"single line only, i.e., wrapped line" == a paragraph? (in this case)
adamse
Yeah, it really depends on the application, see: http://en.wikipedia.org/wiki/Triple-click
rkulla
+1  A: 

In my perfect world I would have it work like this.

  • Double click on a word selects the word only (a word according to the grammar rules of the locale), no trailing space (this is for easier copying between programs so that I would not need to remove any spaces when pasting)
  • If I remove the selected word my text editor is aware of my content and removes any additional spaces left over
  • A triple click selects a line with no trailing newlines. (A paragraph is a long line that has been wrapped)
adamse
This is my favorite reply, though it seems we still haven't found an official standard. But have my thanks and an orange arrow for your time. :) I completely agree with all your points. Especially about no trailing spaces -- It's this particular inconsistency between programs that got me noticing how inconsistently programs implement these features in the first place. Thanks for pointing out that triple click on an SO "paragraph" is actually a single line of text. It never occurred to me, but it's just a line of text with word wrap, not newlines. :)
John Sullivan
+2  A: 

I don’t believe there is a standard to the level of specification you want, and there probably shouldn’t be. Apple Human Interface Guidelines are the most complete. With respect to selecting content (as opposed to controls or discrete data objects), they say:

Double-clicking is most commonly used as a shortcut for other actions, such as… to select a word. Triple-clicking selects the next logical unit, as defined by the application. In a word-processing document, triple-clicking in a word selects the paragraph containing the word…. Double-clicking within a word selects the word. The selection should provide “smart” behavior; if the user deletes the selected word, for example, the space after the word should also be deleted… In some contexts—in a programming language, for example—it may be appropriate to allow users to select both the left and right parentheses (or braces or brackets) in a pair, as well as all the characters between them, by double-clicking either one of them.” (p115-116)

Apple is quite specific about what characters are and aren’t included in a word.

Microsoft’s Windows User Interaction Experience Guidelines say:

For some types of selectable objects, each click expands the effect of the click. For example, single-clicking in a text box sets the input location, double-clicking selects a word, and triple-clicking selects a sentence or paragraph. (p430)

Java Swing Look and Feel Design Guidelines say:

Double-clicking (clicking a mouse button twice in rapid succession without moving the mouse) is used to select larger units (for example, to select a word in a text field)…. Triple-clicking (clicking a mouse button three times in rapid succession without moving the mouse) is used to select even larger units (for instance, to select an entire line in a text field)…. A triple click in a line of text deselects any existing selection and selects the line.

The Gnome Human Interface Guidelines don’t say much about what double- and triple-clicking should do.

This gives you the freedom to choose whatever is best for your users. Double and tripling clicking are expert shortcuts, so their behavior should aim to maximize efficiency. Consider why the user is selecting something and design to make that easiest and fastest.

For example, apparently the rationale behind including the trailing space when double-clicking a word is that users usually select a word in order to copy or paste it in another position in the text. This implies you automatically include the trailing space in order keep the user from having to manually delete a remaining extra space at the source and add a word-separating space at the destination.

Likewise if users are selecting a line of code or paragraph to copy or move it somewhere else, then you probably want to include the newline characters so the user isn’t left with an empty line at the source and force to manually add a newline at the destination (assuming they didn’t want to take the line/paragraph and combine it with another line/paragraph.

If selection is for something other than copying and moving text in sentences, then none of this may apply and you don’t necessarily want to include trailing spaces or newlines. That’s why there shouldn’t be a standard.

An alternative is to do what Apple calls Intelligent Cut and Paste (see the Human Interface Guidelines), or Microsoft Word’s Smart Cut and Paste, where spaces, newlines and other adjustment are algorithmically figured out when cutting, copying, pasting, and deleting, not when selecting.

Michael Zuschlag
What a fantastic, comprehensive answer! If I had a substantial quantity of rep to give and the means to do so I would hand you a bounty. Flagged with my personal thanks.
John Sullivan
I took the freedom to go on an upvote spree of Michael's always excellent answers in your stead. You should also have a look at his site, it's surely one of the best resources on GUI/usability.
mafutrct