MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / filterKey

Method filterKey

tools/xsbug/behaviors.js:121–135  ·  view source on GitHub ↗
(code, key)

Source from the content-addressed store, hash-verified

119 this.onReveal(code);
120 }
121 filterKey(code, key) {
122 if (!key) return null;
123 var c = key.charCodeAt(0);
124 if (c > 0x000F0000)
125 return null;
126 if ((1 == c) || (4 == c) || (11 == c) || (12 == c) || (27 == c))
127 return null;
128 if (this.field && ((c == 3) || (c == 9) || (c == 13) || (c == 25)))
129 return null;
130 if (code.editable)
131 return c;
132 if (code.selectable && (((28 <= c) && (c <= 31))))
133 return c;
134 return null;
135 }
136 getScroller(code) {
137 return code.container;
138 }

Callers 2

onKeyDownMethod · 0.95
onKeyUpMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected