keys.js is part of Aloha Editor project http://www.alohaeditor.org
Aloha Editor ● JavaScript Content Editing Library
Copyright (c) 2010-2015 Gentics Software GmbH, Vienna, Austria.
Contributors http://www.alohaeditor.org/docs/contributing.html
Aloha Editor ● JavaScript Content Editing Library
Copyright (c) 2010-2015 Gentics Software GmbH, Vienna, Austria.
Contributors http://www.alohaeditor.org/docs/contributing.html
Members
-
ARROWSObject.<number, string>
-
Arrow keys
-
CODESObject.<string, number>
-
A map of key names to their keycode.
Methods
-
Provides meta, keycode
Name Type Description event
AlohaEvent -
Parses keys for a browser event. Will return an object as follows:
{
meta : 'cmd+shift', // active meta keys
keycode : 32, // currently active keycode
key : 'space', // associated key
char : '' // corresponding lowercase character key
}Name Type Description event
Event -
Goes through the shortcutHandlers object to find a shortcutHandler that
matches the pressed meta keys along with the provided keycode. The
shortcutHandler array must be structured as follows:
// add a shortcut handler for meta+esc on keydown
shortcutHandlers = {
'meta+escape' : function () {},
'meta+shift+b' : function () {}
}
The order of meta keys in the shortcutHandlers array MUST be in
alphabetical order, as provided byName Type Description meta
string keycode
integer shortcutHandlers
Object - See:
-
- Keys.parseKeys
Returns:
if no handler could be found