diff options
author | tim <tim@capstone09.cs.pdx.edu> | 2011-02-08 18:46:27 -0800 |
---|---|---|
committer | tim <tim@capstone09.cs.pdx.edu> | 2011-02-08 18:46:27 -0800 |
commit | 598794c4de2c00e952a44f840976d61e41f5e46b (patch) | |
tree | a051119454df444a248606706a28659aa1073fbe | |
parent | 7347714cee7b9259312af993e68cd6d4347532ce (diff) | |
parent | b093ac73332a1bb926994c8fea217f410f59183c (diff) |
Merge branch 'master' of github.com:colinhect/xf86-video-nested
-rw-r--r-- | src/xNestedMouse.c | 9 | ||||
-rw-r--r-- | src/xNestedMouse.h | 25 | ||||
-rw-r--r-- | src/xlibclient.c | 14 |
3 files changed, 48 insertions, 0 deletions
diff --git a/src/xNestedMouse.c b/src/xNestedMouse.c index daf4956..8970d27 100644 --- a/src/xNestedMouse.c +++ b/src/xNestedMouse.c @@ -192,3 +192,12 @@ void Load_Nested_Mouse(pointer module) { xf86Msg(X_INFO, "NESTED MOUSE LOADING\n"); xf86AddInputDriver(&NESTEDMOUSE, module, 0); } + +void NestedPostInputEvent(NestedInputEvent event) { + + if (event.type == NestedMouseMotion) { + xf86Msg(X_ERROR, "Received nested mouse motion event: %i %i\n", event.data.mouseMotion.x, event.data.mouseMotion.y); + } else { + xf86Msg(X_ERROR, "Received unknown nested event: %i\n", event.type); + } +} diff --git a/src/xNestedMouse.h b/src/xNestedMouse.h index 53d4ad5..4b7a07d 100644 --- a/src/xNestedMouse.h +++ b/src/xNestedMouse.h @@ -1 +1,26 @@ + +#define NestedMouseMotion 1 +#define NestedKeyPress 2 + +typedef struct { + int x; + int y; +} NestedMouseMotionData; + +typedef struct { + char key; +} NestedKeyPressData; + +typedef union { + NestedMouseMotionData mouseMotion; + NestedKeyPressData keyPress; +} NestedInputData; + +typedef struct { + int type; + NestedInputData data; +} NestedInputEvent; + void Load_Nested_Mouse(pointer module); + +void NestedPostInputEvent(NestedInputEvent event); diff --git a/src/xlibclient.c b/src/xlibclient.c index ddb57f5..9a15a6b 100644 --- a/src/xlibclient.c +++ b/src/xlibclient.c @@ -34,6 +34,8 @@ #include "client.h" +#include "xNestedMouse.h" + struct NestedClientPrivate { Display *display; int screenNumber; @@ -266,6 +268,17 @@ NestedClientTimerCallback(NestedClientPrivatePtr pPriv) { } if (ev.type == MotionNotify) { + + // Create a nested input event and send it to the input driver. + NestedInputEvent nev; + nev.type = NestedMouseMotion; + + nev.data.mouseMotion.x = ((XMotionEvent*)&ev)->x; + nev.data.mouseMotion.y = ((XMotionEvent*)&ev)->y; + + NestedPostInputEvent(nev); + + /* XDrawString(pPriv->display, pPriv->window, DefaultGC(pPriv->display, pPriv->screenNumber), ((XMotionEvent*)&ev)->x, ((XMotionEvent*)&ev)->y, @@ -274,6 +287,7 @@ NestedClientTimerCallback(NestedClientPrivatePtr pPriv) { DefaultGC(pPriv->display, pPriv->screenNumber), ((XMotionEvent*)&ev)->x_root, ((XMotionEvent*)&ev)->y_root, msg2, strlen(msg2)); + */ } if (ev.type == EnterNotify) { |