gpt4 book ai didi

user-interface - 双重或三重 "click to select text"功能的行为惯例?

转载 作者:行者123 更新时间:2023-12-04 10:12:50 25 4
gpt4 key购买 nike

几乎所有涉及文本的成熟程序都具有“双击选择单词”的功能,在某些情况下,还实现了“三次单击以选择其他内容,例如整行”的功能。我发现这些功能很有用,但是它们在程序之间常常是不一致的。

示例-某些程序双击不选择单词后的结尾空间,但大多数选择。有些人将-字符识别为单词的结尾,而另一些人则不知道。所以我喜欢选择整个段落,因为我在单击该帖子时将其单击了三下,VS Web Developer 2005不支持三键单击,而超编辑32将在单击三行时选择一行。关于跨程序实现双击模式和三次单击模式匹配的方式,我们可能会出现无数的不一致之处。

如果没有其他人对模式匹配的工作方式达成约定,我担心如何在程序的中实现此行为。

我的问题是,是否存在规定这些功能对最终用户的行为的约定(约定?可能是MS或Linux约定?)?它们是什么(如果有)?

最佳答案

我不相信您想要的标准级别的标准,也许应该没有。 Apple Human Interface Guidelines是最完整的。关于选择内容(与控件或离散数据对象相对),他们说:

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十分明确了单词中包含和不包含哪些字符。

微软的 Windows User Interaction Experience Guidelines说:

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说:

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.



Gnome Human Interface Guidelines并未详细说明双击和三次单击应该做什么。

这使您可以自由选择最适合您的用户的东西。双击和三次单击是专家的快捷方式,因此其行为应旨在最大程度地提高效率。考虑为什么用户选择某些东西并进行设计以使其变得最简单,最快。

例如,显然,双击一个单词时在其后加上空格的原因是,用户通常选择一个单词,以便将其复制或粘贴到文本中的其他位置。这意味着您将自动包含尾随空格,以使用户不必手动删除源中剩余的多余空间并在目标位置添加单词分隔的空间。

同样,如果用户选择一行代码或一段代码以将其复制或移动到其他位置,则您可能希望包含换行符,以便用户在源代码处不留空行,并强制在以下位置手动添加换行符目的地(假设他们不想采用该行/段落并将其与另一个行/段落合并。

如果选择的目的不是复制和移动句子中的文本,那么这可能都不适用,并且您不一定要包含尾随空格或换行符。这就是为什么不应该有一个标准的原因。

一种替代方法是执行Apple所谓的“智能剪切和粘贴”(请参阅​​人机界面指南)或Microsoft Word的“智能剪切和粘贴”,在剪切,复制,粘贴和删除时,通过算法计算出空格,换行符和其他调整,而不是选择时。

关于user-interface - 双重或三重 "click to select text"功能的行为惯例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2575758/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com