Skip to content

Commit 232c780

Browse files
committed
Custom error messages for use of Mouse and Keyboard on non-Leonardo boards.
1 parent 8e176b0 commit 232c780

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/src/processing/app/debug/Compiler.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,16 @@ public void message(String s) {
503503
"to Wire.read() for consistency with other libraries.\n\n");
504504
}
505505

506+
if (pieces[3].trim().equals("'Mouse' was not declared in this scope")) {
507+
error = _("'Mouse' only supported on the Arduino Leonardo");
508+
//msg = _("\nThe 'Mouse' class is only supported on the Arduino Leonardo.\n\n");
509+
}
510+
511+
if (pieces[3].trim().equals("'Keyboard' was not declared in this scope")) {
512+
error = _("'Keyboard' only supported on the Arduino Leonardo");
513+
//msg = _("\nThe 'Keyboard' class is only supported on the Arduino Leonardo.\n\n");
514+
}
515+
506516
RunnerException e = sketch.placeException(error, pieces[1], PApplet.parseInt(pieces[2]) - 1);
507517

508518
// replace full file path with the name of the sketch tab (unless we're

0 commit comments

Comments
 (0)