31 lines
1.4 KiB
JSON
31 lines
1.4 KiB
JSON
{
|
|
"source": "JSON",
|
|
"data": "BLOCK",
|
|
"version": "0.0.1",
|
|
"type": "upkeyboard",
|
|
"language": "javascript",
|
|
"extension": "webaudio",
|
|
"help": "UpKeyboard",
|
|
"label": "UpKeyboard",
|
|
"color": "50:150:250:150",
|
|
"group": "Input Device",
|
|
"codes": {
|
|
"function": "\nvar keyboard_char_output = [];\nvar keyboard_float_output = [];\ndocument.onkeyup = function(evt){\n evt = evt || window.event;\n\n var value = evt.keyCode || evt.which;\n for (var i = 0; i < keyboard_float_output.length ; i++)\n for (var j = 0; j < keyboard_float_output[i].length ; j++)\n keyboard_float_output[i][j](value);\n\n value = String.fromCharCode(value);\n for (var i = 0; i < keyboard_char_output.length ; i++)\n for (var j = 0; j < keyboard_char_output[i].length ; j++)\n keyboard_char_output[i][j](value);\n};\n",
|
|
"declaration": "\n// block_$id$ = KeyBoard Input\nvar $port[char_output]$ = [];\nvar $port[float_output]$ = [];\nkeyboard_char_output.push($port[char_output]$);\nkeyboard_float_output.push($port[float_output]$);\n"
|
|
},
|
|
"properties": [],
|
|
"ports": [
|
|
{
|
|
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.float",
|
|
"label": "Float Output",
|
|
"conn_type": "Output",
|
|
"name": "float_output"
|
|
},
|
|
{
|
|
"type": "mosaicode_lib_javascript_webaudio.extensions.ports.char",
|
|
"label": "Char Output",
|
|
"conn_type": "Output",
|
|
"name": "char_output"
|
|
}
|
|
]
|
|
} |