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

Function formatShortcut

DownloadAllContent/DownloadAllContent.user.js:2158–2174  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

2156 return option;
2157 }
2158 function formatShortcut(e) {
2159 let result = [];
2160 if (e.ctrlKey) {
2161 result.push("Ctrl");
2162 }
2163 if (e.shiftKey) {
2164 result.push("Shift");
2165 }
2166 if (e.altKey) {
2167 result.push("Alt");
2168 }
2169 if (e.metaKey) {
2170 result.push("Meta");
2171 }
2172 result.push(e.key);
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: ''};

Callers 2

keydonwHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected