MCPcopy Index your code
hub / github.com/hoothin/UserScripts / geneShortcutData

Function geneShortcutData

DownloadAllContent/DownloadAllContent.user.js:2175–2198  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

2173 return result.join(" + ");
2174 }
2175 function geneShortcutData(str) {
2176 if (!str) return "";
2177 let result = {ctrlKey: false, shiftKey: false, altKey: false, metaKey: false, key: ''};
2178 str.split(" + ").forEach(item => {
2179 switch(item) {
2180 case "Ctrl":
2181 result.ctrlKey = true;
2182 break;
2183 case "Shift":
2184 result.shiftKey = true;
2185 break;
2186 case "Alt":
2187 result.altKey = true;
2188 break;
2189 case "Meta":
2190 result.metaKey = true;
2191 break;
2192 default:
2193 result.key = item;
2194 break;
2195 }
2196 });
2197 return result;
2198 }
2199 let showFilterList = createOption(i18n.showFilterList, !!GM_getValue("showFilterList"), "checkbox");
2200 let downloadShortcutInput = createOption(i18n.downloadShortcut, formatShortcut(downloadShortcut) || "");
2201 let downloadSingleShortcutInput = createOption(i18n.downloadSingleShortcut, formatShortcut(downloadSingleShortcut) || "");

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected