Bug 12952 - Alt+{char} gets inserted as text
Summary: Alt+{char} gets inserted as text
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M6   Edit
Assignee: Knut Radloff CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-04-06 21:57 EST by Nick Edgar CLA
Modified: 2002-04-30 13:48 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Edgar CLA 2002-04-06 21:57:37 EST
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).
Comment 1 Kai-Uwe Maetzel CLA 2002-04-08 04:23:36 EDT
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.
Comment 2 Mike Wilson CLA 2002-04-08 11:54:47 EDT
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.
Comment 3 Knut Radloff CLA 2002-04-15 10:47:08 EDT
Will ignore Alt key combinations as text input in StyledText.
Comment 4 Nick Edgar CLA 2002-04-17 23:44:34 EDT
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
Comment 5 Knut Radloff CLA 2002-04-30 13:48:00 EDT
Fixed the case where Alt+<key> inserts <key> into the text.
Opened SWT bug 14942 for the menu problem.