Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Unified Diff: runtime/embedders/openglui/common/input_handler.cc

Issue 12390045: Added a rudimentary DOM, to assist with event dispatch. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/embedders/openglui/common/input_handler.cc
===================================================================
--- runtime/embedders/openglui/common/input_handler.cc (revision 19252)
+++ runtime/embedders/openglui/common/input_handler.cc (working copy)
@@ -14,39 +14,42 @@
float x,
float y) {
const char *function = NULL;
+ // For now we just keep this simple. There are
+ // no click events or mouseover events.
switch (event) {
case kMotionDown:
- function = "onMotionDown";
+ function = "onMouseDown";
break;
case kMotionUp:
- function = "onMotionUp";
+ function = "onMouseUp";
break;
case kMotionMove:
- function = "onMotionMove";
+ function = "onMouseMove";
break;
case kMotionCancel:
- function = "onMotionCancel";
break;
case kMotionOutside:
- function = "onMotionOutside";
break;
case kMotionPointerDown:
- function = "onMotionPointerDown";
break;
case kMotionPointerUp:
- function = "onMotionPointerUp";
break;
default:
return -1;
}
- return vm_glue_->OnMotionEvent(function, when, x, y);
+ if (function == NULL) {
+ return 0;
+ } else {
+ return vm_glue_->OnMotionEvent(function, when, x, y);
+ }
}
int InputHandler::OnKeyEvent(KeyEvent event,
int64_t when,
- int32_t flags,
int32_t key_code,
- int32_t meta_state,
+ bool isAltKeyDown,
+ bool isCtrlKeyDown,
+ bool isShiftKeyDown,
int32_t repeat) {
const char *function = NULL;
switch (event) {
@@ -62,7 +65,8 @@
default:
return -1;
}
- return vm_glue_->OnKeyEvent(function, when, flags, key_code,
- meta_state, repeat);
+ return vm_glue_->OnKeyEvent(function, when, key_code,
+ isAltKeyDown, isCtrlKeyDown, isShiftKeyDown,
+ repeat);
}

Powered by Google App Engine
This is Rietveld 408576698