In Safari 3, the KeyboardDefaults control does not work. Here is what I have discovered so far:
- Safari 3 (and perhaps earlier versions) returns both keyCode and charCode, where keyCode matches the OpenLayers event values and charCode is some other number. For instance, the UP key returns a keyCode of 38 and charCode returns 63232. The handler in Keyboard.js prefers charCode over keyCode and so the right value is never passed to the defaultKeyPress function. Reversing the preference in Keyboard.js causes Safari to return the OpenLayers value. I'm not sure what the impact of this change is on other browsers.
- Safari 3 doesn't seem to support keypress, just keydown and keyup. There is code in Events.js observe() and stopObserving() that looks to see if the name of the event is 'keypress' and changes it to 'keydown' in the case that navigator.appVersion matches /Konqueror|Safari|KHTML/ or element.attachEvent is defined. If I change the KeyboardHandler code to use keydown then it works in Safari, so somehow it is not changing keypress to keydown.