双击或三次“单击以选择文本”的行为约定特征?
几乎所有涉及文本的成熟程序都实现“双击以选择单词”,并且在某些情况下,“三次单击以选择其他内容,例如整行”作为功能。我发现这些功能很有用,但它们在程序之间通常不一致。
示例 - 某些程序的双击不会选择单词后的结尾空格,但大多数程序都会这样做。有些人将 - 字符识别为单词的结尾,而其他人则不然。当我写这篇文章时,我喜欢在三次单击时选择整个段落,VS web Developer 2005 不支持三次单击,而 ultra-edit 32 将在三次单击时选择一行。关于跨程序如何实现双击和三次单击模式匹配,我们可能会发现无数不一致的地方。
如果没有其他人达成关于模式匹配应如何工作的约定,我担心如何在我的程序中实现此行为。
我的问题是,是否存在一个约定(约定?可能是 MS 或 Linux 约定?)来规定这些功能应该如何对最终用户表现?如果有的话,它们是什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我不认为存在您想要的规范级别的标准,而且可能也不应该存在。 Apple 人机界面指南是最重要的完全的。关于选择内容(而不是控件或离散数据对象),他们说:
Apple 对于单词中包含哪些字符以及不包含哪些字符非常明确。
Microsoft 的 Windows 用户交互体验指南 指出:
Java Swing 外观设计指南说:
Gnome 人机界面指南 没有过多说明双击和三击应该做什么。
这使您可以自由选择最适合您的用户的内容。双击和三次单击是专家的快捷方式,因此他们的行为应该旨在最大限度地提高效率。考虑用户选择某些内容的原因,并进行设计以使其最简单、最快。
例如,显然,双击单词时包含尾随空格的基本原理是,用户通常选择一个单词,以便将其复制或粘贴到文本中的另一个位置。这意味着您自动包含尾随空格,以便用户不必手动删除源中剩余的额外空格并在目标中添加单词分隔空格。
同样,如果用户选择一行代码或段落将其复制或移动到其他位置,那么您可能需要包含换行符,这样用户就不会在源代码处留下空行,并强制在以下位置手动添加换行符目的地(假设他们不想采用该行/段落并将其与另一行/段落组合。
如果选择的目的不是复制和移动句子中的文本,那么这些都可能不适用,并且您不一定想要包含尾随空格或换行符,这就是为什么不应该有一个标准。
另一种方法是执行 Apple 所谓的智能剪切和粘贴(请参阅人机界面指南)或 Microsoft Word 的智能剪切和粘贴,其中包含空格和换行符。和其他调整是在剪切、复制、粘贴和删除时通过算法计算出来的,而不是在选择时计算出来的。
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:
Apple is quite specific about what characters are and aren’t included in a word.
Microsoft’s Windows User Interaction Experience Guidelines say:
Java Swing Look and Feel Design Guidelines say:
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.
在我的完美世界中,我会让它像这样工作。
In my perfect world I would have it work like this.
在 Windows、Linux 和 OS X 中,双击选择光标下的单词,三次单击选择整行文本(仅限单行,即换行)
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)
寻找答案并提出替代解决方案:
我喜欢以文本形式编写代码或命令,然后将它们复制到 shell 提示符,而不以结尾 \n
1.使用记事本
2. 每行用 () 括起来
3.使用ctrl+双击。
美好的...
Finding answers and come up with a alternative solution:
I like to write code or command in text, and copy them to shell prompt without the ending \n
1. use notepad
2. surround each line with ()
3. use ctrl + double click.
Fine...