MCPcopy Create free account
hub / github.com/BloombergGraphics/whatiscode / typeKey

Function typeKey

modules/keyboard/keyboard.js:186–198  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

184 }
185
186 function typeKey(e) {
187 // Get the key code
188 var key = d3.event.keyCode || d3.event.which;
189
190 //Overriding Firefox key codes and setting them to those of other browsers.
191 if (key === 59) key = 186;
192 else if (key === 61) key = 187;
193 else if (key === 173) key = 189;
194
195 var keySel = module.sel.selectAll(".key").filter(function(d) { return d.keycode === key });
196 var scanType = d3.event.type == "keydown" ? "make" : "break";
197 drawKey(keySel, scanType);
198 }
199
200 function clickKey(e) {
201 var scanType = (d3.event.type == "mousedown" ? "make" : "break");

Callers

nothing calls this directly

Calls 1

drawKeyFunction · 0.85

Tested by

no test coverage detected