On Jun 17, 2014, at 7:31 PM, Yoshifumi Inoue <yo...@chromium.org> wrote:
> For overriding keyboard shortcut, how about exposing browser's key binding > map as API rather than handling keyboard event? > Example: > window.keymap['Ctrl+B'] = function() { document.execCommand('back color'); } I don't think this is a much improvement from the status quo of handling keydown event manually. If anything, what we need to be solving here is the problem such as Ctrl+B behaving like Cmd+B on Mac and yet another platform may have another convention. We should design API such that authors don't have to manually hard code each and every platform's convention. > window.keymap also contains "accesskey". So, editor library can notify or > avoid overriding page defined shortcut > // This can be done by document.querySelectorAll(*[accesskey]) though I don't follow what you're trying to say here. Could you clarify what problem you're trying to solve? - R. Niwa