<!ELEMENT (parameter*)>
<!ATTLIST key
sequence CDATA #REQUIRED
schemeId CDATA #REQUIRED
contextId CDATA "org.eclipse.ui.contexts.window"
commandId CDATA #IMPLIED
platform CDATA #IMPLIED
locale CDATA #IMPLIED>
A binding between some keyboard input and the triggering of a command.
- sequence -
The key sequence for this binding. This key sequence should consist of one or more key strokes. Key strokes are separated by spaces. Key strokes consist of one or more keys held down at the same time. This should be zero or more modifier keys, and one other key. The keys are separated by the
+character.The recognized modifiers keys are
M1,M2,M3,M4,ALT,COMMAND,CTRL, andSHIFT. The "M" modifier keys are a platform-independent way of representing keys, and these are generally preferred.M1is theCOMMANDkey on MacOS X, and theCTRLkey on most other platforms.M2is theSHIFTkey.M3is theOptionkey on MacOS X, and theALTkey on most other platforms.M4is theCTRLkey on MacOS X, and is undefined on other platforms.The actual key is generally specified simply as the ASCII character, in uppercase. So, for example
For,are examples of such keys. However, there are some special keys; keys that have no printable ASCII representation. The following is a list of the current special keys:ARROW_DOWN,ARROW_LEFT,ARROW_RIGHT,ARROW_UP,BREAK,BS,CAPS_LOCK,CR,DEL,END,ESC,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13,F14,F15,FF,HOME,INSERT,LF,NUL,NUM_LOCK,NUMPAD_0,NUMPAD_1,NUMPAD_2,NUMPAD_3,NUMPAD_4,NUMPAD_5,NUMPAD_6,NUMPAD_7,NUMPAD_8,NUMPAD_9,NUMPAD_ADD,NUMPAD_DECIMAL,NUMPAD_DIVIDE,NUMPAD_ENTER,NUMPAD_EQUAL,NUMPAD_MULTIPLY,NUMPAD_SUBTRACT,PAGE_UP,PAGE_DOWN,PAUSE,PRINT_SCREEN,SCROLL_LOCK,SPACE,TABandVT.We also understand some alternative names for some common special keys. For example, we accept both
ESCandESCAPE, andCR,ENTERandRETURNare all the same.It is also strongly recommended that you keep the key sequences short. One or two is the most you should need. Use contexts to give key sequences different meanings in different parts of your application. At the very most, you should not use any key sequence that contains more than four key strokes.
- schemeId - The identifier of the scheme in which this key binding is active.
- contextId - The identifier of the context in which this key binding is active. Please see the
org.eclipse.ui.contextsextension point. If this is not specified, then it defaults toorg.eclipse.ui.contexts.window. - commandId -
The identifier of the command which should be executed when this binding is triggered.
If no command identifier is specified, this is a deletion marker. This means that any binding in the same context with the same sequence, platform and locale will become inactive when this binding becomes active. If the platform or locale on a deletion is not specified, then it matches any platform or locale.
- platform - The platform on which this binding applies. The platform should be specified in the same way as the string from
SWT.getPlatform(). For example, the following strings are considered valid:win32,gtk,motif,carbonandphoton. - locale - The locale on which this bindings applies. This is useful for changing bindings that conflict with locale-specific input method editors (IMEs). The locale is specified in the same way as
Locale.toString(). For example,"en"or"en_CA"are both understood.
本文介绍了如何在Eclipse中配置键盘快捷方式,包括定义快捷键序列、指定激活上下文和命令等。提供了关于快捷键定义的最佳实践,例如推荐使用少量键组合并利用不同应用上下文来区分相似快捷键。
616

被折叠的 条评论
为什么被折叠?



