Permalink
Browse files

[BUG #4983] Moved key code to identifier mapping to a static utility …

…class to make it usable for low-level libraries
  • Loading branch information...
1 parent f666b87 commit 7a12138c5aecc748a7c3694433cba70280f7b106 @danielwagner danielwagner committed Mar 27, 2012
@@ -363,10 +363,10 @@ qx.Class.define("qx.bom.Shortcut",
*/
__normalizeKeyIdentifier : function(keyName)
{
- var KeyHandler = qx.event.handler.Keyboard;
+ var kbUtil = qx.event.util.Keyboard;
var keyIdentifier = "Unidentified";
- if (KeyHandler.isValidKeyIdentifier(keyName)) {
+ if (kbUtil.isValidKeyIdentifier(keyName)) {
return keyName;
}
@@ -377,7 +377,7 @@ qx.Class.define("qx.bom.Shortcut",
keyName = keyName.toLowerCase();
var keyIdentifier = this.__oldKeyNameToKeyIdentifierMap[keyName] || qx.lang.String.firstUp(keyName);
- if (KeyHandler.isValidKeyIdentifier(keyIdentifier)) {
+ if (kbUtil.isValidKeyIdentifier(keyIdentifier)) {
return keyIdentifier;
} else {
return "Unidentified";
@@ -87,40 +87,6 @@ qx.Class.define("qx.bom.htmlarea.HtmlArea",
}
/*
- * "Fix" Keycode to identifier mapping in opera to suit the needs
- * of the editor component
- */
- if ((qx.core.Environment.get("engine.name") == "opera"))
- {
- /*
- * To correct the broken key handling in Opera "fix" the meanings of
- * the several keyCodes manually to the desired Identifiers
- *
- * However for these keys it is bit more complicated:
- *
- * KEY RESULT POSSIBLE SOLUTION
- * ************************************
- * $ "Home" SHIFT + "Home" -> $
- * ( "Down" SHIFT + "Down" -> (
- * ' "Right" SHIFT + "Right" -> '
- *
- */
- var contentWindow = qx.dom.Node.getWindow(element);
- var keyEventHandler = qx.event.Registration.getManager(contentWindow).getHandler(qx.event.handler.Keyboard);
-
- /*
- * fix mapping for the keys "#", "-", "P", "S", "X"
- * for other keys there maybe also a problem with the wrong identifier,
- * but here are only these keys fixed which are needed for the smiley handling
- */
- keyEventHandler._keyCodeToIdentifierMap[35] = "#";
- keyEventHandler._keyCodeToIdentifierMap[45] = "-";
- keyEventHandler._keyCodeToIdentifierMap[112] = "P";
- keyEventHandler._keyCodeToIdentifierMap[115] = "S";
- keyEventHandler._keyCodeToIdentifierMap[120] = "X";
- }
-
- /*
* Build up this commandManager object to stack all commands
* which are arriving before the "real" commandManager is initialised.
* Once initialised the stacked commands will be executed.
Oops, something went wrong.

0 comments on commit 7a12138

Please sign in to comment.