I've got an application with command keys that work ok in Windows, but don't
work in OS X.  I've dug into the issue a bit to consider what to do about
it.  Here are my findings.

In order not to piss off browsers on Windows, I tend to use shortcuts like
Control-Shift-X.  Alt keystrokes tend to hit menus, while many Control key
combinations tend to be editor functions.

On OS X, the Command key is the basic control key.  It sends '17' as does
the Control key on Windows.   Since the browsers look to this key for
application shortcuts, Command is out.

In FF3 on OS X, the Control key sends '17' when pressed, the Alt key sends
'18'.  In Safari, neither the Control key nor the Alt key send any key
stroke to Flash.

In both FF3 and Safari on OS X, a combination of Control or Alt and any
typical key (letters, numbers) send a single distinct keystroke.  In this
case, Control-X is '24', Alt-X is '188'.

I can certainly tell an OL app when it starts, what env it is running in.
This should allow me to switch the keys via a state or something.

The question is how do I handle this with the lz.KeysService?  I could write
a handler that tracks all onkeyup events and looks for specific key codes
such as '24' or '188', but there's already a handler that tracks all keys in
lz.KeysService for this purpose.   I propose that a callOnKeyCode()
and removeKeyCodeCall()
to allow a delegate to be bound to a specific key value.

I'd considered that you could check if a value sent to callOnKeyCombo() is a
strring or an integer, but that would seem buggy when using it from the
command tag.   A 'keycode' attribute could be added to the command tag that
overrides the 'key' array of strings.

Reply via email to