Move Keyboard events back to Window

This commit is contained in:
Joshua Granick
2015-08-19 16:30:36 -07:00
parent c666477b58
commit f7e53cdea8
12 changed files with 59 additions and 52 deletions

View File

@@ -3,6 +3,7 @@
#include <hx/CFFI.h>
#include <stdint.h>
namespace lime {
@@ -30,6 +31,7 @@ namespace lime {
double keyCode;
int modifier;
KeyEventType type;
uint32_t windowID;
};

View File

@@ -3,6 +3,7 @@
#include <hx/CFFI.h>
#include <stdint.h>
namespace lime {
@@ -28,10 +29,10 @@ namespace lime {
static void Dispatch (TouchEvent* event);
int device;
uint32_t device;
float dx;
float dy;
int id;
uint32_t id;
float pressure;
TouchEventType type;
float x;

View File

@@ -335,6 +335,7 @@ namespace lime {
keyEvent.keyCode = event->key.keysym.sym;
keyEvent.modifier = event->key.keysym.mod;
keyEvent.windowID = event->key.windowID;
KeyEvent::Dispatch (&keyEvent);

View File

@@ -11,6 +11,7 @@ namespace lime {
static double id_keyCode;
static int id_modifier;
static int id_type;
static int id_windowID;
static bool init = false;
@@ -19,6 +20,7 @@ namespace lime {
keyCode = 0;
modifier = 0;
type = KEY_DOWN;
windowID = 0;
}
@@ -32,6 +34,7 @@ namespace lime {
id_keyCode = val_id ("keyCode");
id_modifier = val_id ("modifier");
id_type = val_id ("type");
id_windowID = val_id ("windowID");
init = true;
}
@@ -41,6 +44,7 @@ namespace lime {
alloc_field (object, id_keyCode, alloc_float (event->keyCode));
alloc_field (object, id_modifier, alloc_int (event->modifier));
alloc_field (object, id_type, alloc_int (event->type));
alloc_field (object, id_windowID, alloc_int (event->windowID));
val_call0 (KeyEvent::callback->get ());