Community
Participate
Working Groups
Build 20020404 - new text file - type Alt+A - 'A' gets inserted into the text Alt combinations should not get inserted. They are used for menu mnemonics and accelerators, and should have no effect if there is no corresponding mnemonic or accelerator. (Actually, it's not recommended to use Alt combinations as accelerators, but it's possible).
This are two issues: a) Handling of Alt-key combinations for looking up menu entries. (Should always be consumed, no action or beep if no associated menu/menu entry could be found.) b) Handling of Alt-key combinations received by the StyledText. (Should allow to enter characters by entering their ascii code while pressing the Alt-key.) Moving to SWT.
I do not agree at all that ALT key sequences should always be consumed by SWT, in the general case. Whether or not this would make sense is purely an application level decision. Any application (for example, a game) which wants to deal directly with all keys would be broken if we were to do this. However, StyledText should probably detect the ALT key case and explicitely ignore it, since inserting a "non-ALT-A" into the text would be unexpected behavior. Note: If a key *is* consumed (for example, by a menu accelerator) then this is because of a direct side-effect of an o/s mechanism which would be expected platform behavior. As to the second issue, I just tried this on WinXP (i.e. "ALT-numpad 0-numpad 6-numpad 5" == "A") and it worked. This (o/s provided) mechanism is the only thing which SWT would be expected to support. Anything more than this would, again, be an application specific decision. That is, it may make sense for Eclipse's use of StyledText to provide this, but it probably should not be a generic feature of StyledText.
Will ignore Alt key combinations as text input in StyledText.
Just noticed the following in 20020416: - Alt+E (open Edit menu) - Z (no item with this mnemonic - it beeps) - Esc to dismiss menu - Esc to dismiss focus on Edit - 'e' gets inserted into editor
Fixed the case where Alt+<key> inserts <key> into the text. Opened SWT bug 14942 for the menu problem.