@@ -463,7 +463,7 @@ Blockly.Blocks.heb_badge_was_shaken = {
463463 this . appendDummyInput ( )
464464 . appendField ( "Accelerometer was shaken?" ) ;
465465
466- this . setOutput ( true , 'Boolean ' ) ;
466+ this . setOutput ( true , 'Number ' ) ;
467467 this . setPreviousStatement ( false , null ) ;
468468 this . setNextStatement ( false , null ) ;
469469 }
@@ -482,11 +482,11 @@ Blockly.Blocks.heb_touchpad_status = {
482482 this . setColour ( colorPalette . getColor ( 'heb' ) ) ;
483483 this . appendDummyInput ( )
484484 . appendField ( "Touchpad is" )
485- . appendField ( new Blockly . FieldDropdown ( [ [ "0 - P27" , "0" ] , [ "1 - P26" , "1" ] , [ "2 - P25" , "2" ] , [ "3 - P15" , "3" ] , [ "4 - P16" , "4" ] , [ "5 - P17" , "5" ] , [ "6 - Center Button" , "6" ] ] ) , "TOUCHPAD" )
485+ . appendField ( new Blockly . FieldDropdown ( [ [ "0 - P27" , "0" ] , [ "1 - P26" , "1" ] , [ "2 - P25" , "2" ] , [ "3 - P15" , "3" ] , [ "4 - P16" , "4" ] , [ "5 - P17" , "5" ] , [ "6 - Center Button" , "6" ] , [ "Any button" , "-1" ] ] ) , "TOUCHPAD" )
486486 . appendField ( "pressed?" ) ;
487487 this . setPreviousStatement ( false , null ) ;
488488 this . setNextStatement ( false , null ) ;
489- this . setOutput ( true , 'Boolean ' ) ;
489+ this . setOutput ( true , 'Number ' ) ;
490490 }
491491} ;
492492
@@ -496,6 +496,11 @@ Blockly.propc.heb_touchpad_status = function () {
496496 Blockly . propc . definitions_ [ "badgetools" ] = '#include "badgetools.h"' ;
497497 Blockly . propc . setups_ [ "badgetools" ] = 'badge_setup();' ;
498498
499- var code = 'button(' + touchpad + ')' ;
499+ var code = '' ;
500+ if ( touchpad === "-1" ) {
501+ code += 'buttons()' ;
502+ } else {
503+ code += 'button(' + touchpad + ')' ;
504+ }
500505 return [ code , Blockly . propc . ORDER_NONE ] ;
501506} ;
0 commit comments