Include button/id in mouse/touch events

This commit is contained in:
Joshua Granick
2014-06-17 18:30:42 -07:00
parent 806720647e
commit 0d0a9ea3b1
10 changed files with 51 additions and 32 deletions

View File

@@ -225,7 +225,7 @@ namespace lime {
}
mouseEvent.id = event->button.button - 1;
mouseEvent.button = event->button.button - 1;
mouseEvent.x = event->button.x;
mouseEvent.y = event->button.y;

View File

@@ -8,7 +8,7 @@ namespace lime {
AutoGCRoot* MouseEvent::callback = 0;
AutoGCRoot* MouseEvent::eventObject = 0;
static int id_id;
static int id_button;
static int id_type;
static int id_x;
static int id_y;
@@ -17,7 +17,7 @@ namespace lime {
MouseEvent::MouseEvent () {
id = 0;
button = MOUSE_BUTTON_LEFT;
type = MOUSE_DOWN;
x = 0.0;
y = 0.0;
@@ -31,7 +31,7 @@ namespace lime {
if (!init) {
id_id = val_id ("id");
id_button = val_id ("button");
id_type = val_id ("type");
id_x = val_id ("x");
id_y = val_id ("y");
@@ -41,7 +41,7 @@ namespace lime {
value object = (MouseEvent::eventObject ? MouseEvent::eventObject->get () : alloc_empty_object ());
alloc_field (object, id_id, alloc_int (event->id));
alloc_field (object, id_button, alloc_int (event->button));
alloc_field (object, id_type, alloc_int (event->type));
alloc_field (object, id_x, alloc_float (event->x));
alloc_field (object, id_y, alloc_float (event->y));