I want to modify a code so I can add a “virtual guitar notes” whenever user presses a keyboard key. The problem is I don’t understand the following code:
(b = c) ? b = "number"
== typeof b.which ? 3 : "number"
== typeof b.keyCode ? 2 : "number"
== typeof b.charCode ? 4 : 0
: (b = window.event, b = "number" == typeof b.keyCode ? 1 : 0);
and
0 != b ?
("number" == typeof c.modifiers ? a += "var c=f.modifiers;"
: "boolean" == typeof c.shiftKey ? a += "var c=f.shiftKey*4+f.ctrlKey*2+f.altKey;"
: Stop(), c.srcElement ? a += "var d=f.srcElement;"
: c.target ? a += "var d=f.target;"
: St())
: St();
and
DFunct || (d=10, f=11);
I understand that the last line translates to this:
if(!DFunct){
d=10;
f=11;
}
I need to make this using simple if else statements so I can make a note playing based on values pressed.
First:
Second: