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 button’s 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 don’t 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 I’m the person who just know this “SPACE” Key ruleJ