var sbs = SpecialPowers.Cc['@mozilla.org/intl/stringbundle;1'].
getService(SpecialPowers.Ci.nsIStringBundleService); var bundle = sbs.createBundle("chrome://global-platform/locale/platformKeys.properties");
var shiftText = bundle.GetStringFromName("VK_SHIFT"); var altText = bundle.GetStringFromName("VK_ALT"); var controlText = bundle.GetStringFromName("VK_CONTROL"); var metaText = bundle.GetStringFromName("VK_COMMAND_OR_WIN"); var separatorText = bundle.GetStringFromName("MODIFIER_SEPARATOR");
var modifier = SpecialPowers.getIntPref("ui.key.contentAccess");
var isShift; var isAlt; var isControl; var isMeta;
// There are no consts for the mask of this prefs.
if (modifier & 8) {
isMeta = true;
}
if (modifier & 1) {
isShift = true;
}
if (modifier & 2) {
isControl = true;
}
if (modifier & 4) {
isAlt = true;
}
varlabel = "";
if (isControl) label += controlText + separatorText;
if (isMeta) label += metaText + separatorText;
if (isAlt) label += altText + separatorText;
if (isShift) label += shiftText + separatorText;
label += document.getElementById("e").accessKey;
is(label, document.getElementById("e").accessKeyLabel, "JS and C++ agree on accessKeyLabel");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.