| Index: samples/openglui/src/openglui_canvas_tests.dart
|
| ===================================================================
|
| --- samples/openglui/src/openglui_canvas_tests.dart (revision 19252)
|
| +++ samples/openglui/src/openglui_canvas_tests.dart (working copy)
|
| @@ -25,15 +25,19 @@
|
| if (canvasp == null) {
|
| log("Allocating canvas");
|
| canvas = new CanvasElement(width: w, height: h);
|
| + document.body.nodes.add(canvas);
|
| } else {
|
| log("Using parent canvas");
|
| canvas = canvasp;
|
| - // called from gl_driver.dart.
|
| - // This is a kludge; we need a clean way of handling events.
|
| - canvas.on.mouseDown.add((e) {
|
| - ++testnum;
|
| - });
|
| }
|
| + canvas.onMouseDown.listen((e) {
|
| + ++testnum;
|
| + isDirty = true;
|
| + });
|
| + canvas.onKeyDown.listen((e) {
|
| + ++testnum;
|
| + isDirty = true;
|
| + });
|
| ctx = canvas.getContext("2d");
|
| if (ctx == null) {
|
| throw "Failed to get 2D context";
|
| @@ -736,39 +740,3 @@
|
| isDirty = false;
|
| }
|
|
|
| -/*
|
| -TODO(gram): below are the current entry points for input events for the
|
| -native code version. We need to integrate these somehow with the WebGL
|
| -version:
|
| -*/
|
| -onMotionDown(num when, num x, num y) {
|
| - ++testnum;
|
| - isDirty = true;
|
| - log("Marking dirty");
|
| -}
|
| -onMotionUp(num when, num x, num y) {}
|
| -onMotionMove(num when, num x, num y) {}
|
| -onMotionCancel(num when, num x, num y) {}
|
| -onMotionOutside(num when, num x, num y) {}
|
| -onMotionPointerDown(num when, num x, num y) {
|
| - ++testnum;
|
| - isDirty = true;
|
| - log("Marking dirty");
|
| -}
|
| -
|
| -onMotionPointerUp(num when, num x, num y) {}
|
| -
|
| -onKeyDown(num when, int flags, int keycode, int metastate, int repeat) {
|
| - if (keycode == 32) {
|
| - ++testnum;
|
| - isDirty = true;
|
| - log("Marking dirty");
|
| - }
|
| -}
|
| -
|
| -onKeyUp(num when, int flags, int keycode, int metastate, int repeat) {}
|
| -
|
| -onKeyMultiple(num when, int flags, int keycode, int metastate, int repeat) {
|
| -}
|
| -
|
| -
|
|
|