欢迎光临 Enjoy IT (ITECN.NET) 登录 | 注册 | 帮助

UU'S T&T

TIPS AND TROUBLESHOOTS FOR WINDOWS

公告

  • 本Blog站点上的任何言论仅代表个人观点,与其所在的公司没有任何关系。本Blog站点的内容是按原样提供的,作者与其公司并不对其提供任何种类的担保。此外还否认所有暗示的保证,包括但不局限于在任何试销性或某一特定用途的适用性方面的暗示保证。由于本站内容的使用或性能表现带来的全部风险将由使用者自己承担。任何由于使用或无法使用本站内容而带来的损失(包括但不局限于商业利润、业务中断、业务信息或其他财产上的损失),即使在 本站作者曾经被提醒可能出现这些损失的情况下,本站 及其作者或涉及内容创建的任何其他人等对任何上述的损失概不负责。
    ·本BLOG的内容均属技术交流之用,本人对所发表的文章、图片、随笔保留一切权利。
    如文章、图片、随笔转载请注明:
    作者姓名:尤扬
    文章来源URL:
    http://blogs.itecn.net/blogs/youyang
    同时请通过EMAIL通知本人:
    youyang1983◎hotmail.com
    ·如果通过EMAIL与我联系,并最终解决的问题,我将发表于本BLOG进行技术分享,如果涉及隐私或有特殊要求请于EMAIL中说明!
    本人联系方式:
    MSN ID:youyang1983◎hotmail.com(常用)
    QQ ID:85836514
    EMAIL:v-yayou@microsoft.com
    ·技术就是无条件共享


    2005年7月 Microsoft MVP for Windows-Shell\User
    2006年7月 Microsoft MVP for Windows-Shell\User
    2007年7月 Microsoft MVP for Windows-Shell\User

Microsoft

朋友的网站

Windows讨厌的"SPACE" Key rule

问大家一个问题,(不要自己动手实验,用你的第一直觉回答),

如果让你完全用键盘去操作一个Windows的UI,

什么键是负责 UI上面元素(比如Button, CheckBox, RadioButton)的选择?

什么键是负责 这个选中的元素的 点击动作?

我的答案

TAB键, Enter键,

但是,这个答案却是错误的,

Windows里面有一个讨厌的“SPACE” key rule,

那就是,当你遇到CheckBox控件的时候,即使这个控件已经获得了焦点,你还得必须通过Space(空格键)才能选中它。

见我的一封Email:

...... 

IE:

Tools->Internet Options->Security,

OE:

Click Microsoft Communities->Click Yes on the pop up notification->Newsgroup Subscriptions

 

On these pages, the checkbox and buttons behavior are same as XXXXX.

 

And on this Web page:

http://msdn2.microsoft.com/en-us/library/ms670553.aspx

seems the SPACE key is the only key to fire action on the check box.

LVS_EX_CHECKBOXES 

Version 4.70. Enables check boxes for items in a list-view control. When set to this style, the control creates and sets a state image list with two images using DrawFrameControl. State image 1 is the unchecked box, and state image 2 is the checked box. Setting the state image to zero removes the check box.

Version 6.00 Check boxes are visible and functional with all list view modes except the tile view mode introduced in ComCtl32.dll version 6. Clicking a checkbox in tile view mode only selects the item; the state does not change.

You can obtain the state of the check box for a given item with ListView_GetCheckState. To set the check state, use ListView_SetCheckState. If this style is set, the list-view control automatically toggles the check state when the user clicks the check box or presses the space bar.

 

But XXXX, for me, I dont like this design, because the End User has to know, when you use keyboard to control UI, you must use SPACE key to select checkbox, even if the checkbox has the focus,

And Im the person who just know this SPACE Key ruleJ

 

Posted: 2007年6月29日 10:51 作者 youyang

评论

ghjconan 说:

呵呵,还可以啊,只要知道了,以后就不会忘了……

# 六月 29, 2007 12:50

Basara 说:

就我使用的体会来说Space在控件获得焦点的时候不是等同于单击么?这和Tab、Enter的功能完全不同,我觉得没什么奇怪,甚至很方便……

# 六月 29, 2007 13:46

est 说:

这样设计是很有道理的

1. 左手键盘右手鼠标效率很高。如果用enter势必右手要同时控制鼠标和enter,麻烦。

2. Space本来就表示 选中。例如在explorer里,按方向键可以虚线框在各个图标之间移动,space就可以高亮这个文件。enter就可以打开这个文件。

3. Enter在对话框里的作用是 触发 AccessKey。所以必须用space而不是enter

# 六月 29, 2007 14:26

youyang 说:

To Basara

嗯,自从我 I’m the person who just know this “SPACE” Key ruleJ之后,我也感觉挺方便,但是之前我是一头雾水。

# 六月 29, 2007 19:40
禁止匿名发表评论