Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334624 - Macs and Display.post(...) problems on non-US keyboards
Summary: Macs and Display.post(...) problems on non-US keyboards
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6.1   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: 3.7 M5   Edit
Assignee: Scott Kovatch CLA
QA Contact: Silenio Quarti CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-18 06:16 EST by Tonny Madsen CLA
Modified: 2011-01-20 03:32 EST (History)
1 user (show)

See Also:


Attachments
Proposed patch (4.04 KB, patch)
2011-01-19 18:48 EST, Scott Kovatch CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tonny Madsen CLA 2011-01-18 06:16:46 EST
Display.post(...) with event.type == KeyDown/KeyUp does not work properly unless the keyboard input source is US.

To test, try out SWT Snippet 146 - http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet146.java?view=co

For a Danish keyboard, the window shows the text "Lve the methd." and not "Love the method."

The problem seems to be that OS.UCKeyTranslate does not return "o" for key code 31 as it should, but rather "ö".

Using "Full Key Codes" (http://softwares.bajram.com/utilities/#Full_Key_Codes), I can see that the key code for "ö" also seem to be 31.

-- Configuration Details --
Product: Eclipse 1.3.1.20100913-1228 (org.eclipse.epp.package.rcp.product)
Installed Features:
 org.eclipse.platform 3.6.1.r361_v20100909-9gF78GrkFqw7GrsZnvz0JWNTeb6fue6896L



-- Configuration Details --
Product: Eclipse 1.3.1.20100913-1228 (org.eclipse.epp.package.rcp.product)
Installed Features:
 org.eclipse.platform 3.6.1.r361_v20100909-9gF78GrkFqw7GrsZnvz0JWNTeb6fue6896L
Comment 1 Scott Kovatch CLA 2011-01-19 17:14:23 EST
Before I go too far here... what version of Mac OS X are you using? I see this on 10.6.6. 

I have this particular problem fixed on 10.6 but Display.post() is very picky on Mac OS X, so I want to be careful before I check anything in.
Comment 2 Scott Kovatch CLA 2011-01-19 18:48:56 EST
Created attachment 187160 [details]
Proposed patch
Comment 3 Scott Kovatch CLA 2011-01-19 19:10:05 EST
Patch works fine on my 10.5 and 10.6 systems, including JUnit tests, so I'm checking it in. Of course, I've said that before and got burnt.

Fixed > 20110119.
Comment 4 Tonny Madsen CLA 2011-01-20 03:30:36 EST
(In reply to comment #1)
> Before I go too far here... what version of Mac OS X are you using? I see this
> on 10.6.6.
> 
> I have this particular problem fixed on 10.6 but Display.post() is very picky on
> Mac OS X, so I want to be careful before I check anything in.

10.6.6

With your fix, can you post "M1+A" (select all) properly by post SHIFT-down A-down A-up SHIFT-up? For me that fails on A-down :-(
Comment 5 Tonny Madsen CLA 2011-01-20 03:32:34 EST
(In reply to comment #3)
> Patch works fine on my 10.5 and 10.6 systems, including JUnit tests, so I'm
> checking it in. Of course, I've said that before and got burnt.
> 
> Fixed > 20110119.

Is this backward compatible with 3.6? With other words, can I drop in this version in 3.6 - with possible changes to the version number to satisfy the dependencies on SWT?