diff --git a/sumorobot.js b/sumorobot.js index b03033c..bc883fc 100755 --- a/sumorobot.js +++ b/sumorobot.js @@ -511,6 +511,14 @@ window.onload = function() { workspace.highlightBlock(lastHighlighted, false); }); + /* enter listener on robot ID field */ + $("#robot-id").keypress(function(e) { + if (e.which == 13) { + /* simulate robot GO button click */ + $(".btn-robot-go").click(); + } + }); + /* robot number button listener */ $(".btn-robot-go").click(function() { /* extract and validate the selected robot ID */