Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Re: [Bug 19568] {} on a german keyboard [swt-carbon]

Hi Bob,


But Control->SWT.ALT will be confusing and un-Mac-like.

IMHO all your mappings (A->B) seem backwards:
I'm proposing to map the SWT 'Control' modifier to the Mac 'Command' modifier and the SWT 'Alt' modifier to the Mac 'Control' modifier. And this mapping is only performed for menu shortcuts. So if a shortcut in a property file is specified as Alt-A, the code in MenuItem.setAccelerator would replace this with Control-A.

So if your SWT application needs the SWT.Control modifier you will still get it when pressing the control modifier because no mapping takes place for normal events.

All Apple keyboards use the option key for extended characters. Go to your
keyboard and type option-5. ;-}

On the Mac, shortcuts are always modified with the command key. Other
modifiers do not invoke shortcuts unless the command key is also down.

Yes, I said that in my original posting.
(BTW: I'm using Macs since 1984... :-)


The option key should be used as a shortcut modifier when the command
modifier is also present, and as a shift-out for extended characters when it
is not used with command.

This seems to be a good idea. However, this precludes all combinations of
extended characters with the Alt-modifier.
(The real problem is that on a German keyboard 'extended' characters are even
simple things like '{', '[', and '@')

The control key should be used as a shortcut
modifier with command and just passed on to the program without command.

Yes. And both cases would just report SWT.CONTROL.


It would be pretty surprising on the Mac if Control all by itself invoked a
shortcut, but that seems to be what you propose.

No, I'm not proposing this. See above.

Control is expected to be
available to programs.

Yes, most of the time. However if combined with a left-click it triggers the context menu (or emulates the 'secondary' mouse button). In this case I'm not sure whether the Control modifier should be reported to SWT.

Just like it will be surprising that Option isn't
available to programs. If you had to sacrifice Mac-specific features for
portability, that would be one thing. But you don't.

Here is an alternative proposal that preserves the Mac keycodes for
people who want to write Mac-specific programs with SWT and works with
existing portable programs in a Mac-like way.

Macintosh keys down -> SWT codes

Sure.

Command key by itself -> SWT.CTRL (portability)

No need for this (and I don't seem to get any Carbon Event Manager events if only a modifier key is pressed).

Command key + option key -> SWT.ALT (portability)

I've implemented this in today's drop
(available in the repository now and as a binary plugin soon).

Option key without command key -> SWT.OPTION (mac-specific)

No need for this (yet).

Control key -> SWT.MCONTROL (mac-specific)

No need for this (yet). I'm just reporting SWT.CONTROL.


Thanks a lot for your help!

--andre


Back to the top