diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/xNestedMouse.c | 10 | ||||
-rw-r--r-- | src/xNestedMouse.h | 1 | ||||
-rw-r--r-- | src/xlibclient.c | 2 |
3 files changed, 13 insertions, 0 deletions
diff --git a/src/xNestedMouse.c b/src/xNestedMouse.c index 3c0adb8..05b4e27 100644 --- a/src/xNestedMouse.c +++ b/src/xNestedMouse.c @@ -150,6 +150,12 @@ InputInfoPtr pInfo = device->public.devicePrivate; ret = BadAlloc; } + + if (!InitKeyboardDeviceStruct(device, NULL, NULL, NULL)) { + xf86Msg(X_ERROR, "%s: Failed to register keyboard.\n", pInfo->name); + ret = BadAlloc; + } + xfree(map); return ret; return -1; @@ -260,3 +266,7 @@ void NestedPostMouseMotion(void* dev, int x, int y) { void NestedPostMouseButton(void* dev, int button, int isDown) { xf86PostButtonEvent(dev, 0, button, isDown, 0, 0); } + +void NestedPostKey(void* dev, unsigned int keycode, int isDown) { + xf86PostKeyboardEvent(dev, keycode, isDown); +} diff --git a/src/xNestedMouse.h b/src/xNestedMouse.h index 9cb48e1..13ffdae 100644 --- a/src/xNestedMouse.h +++ b/src/xNestedMouse.h @@ -7,3 +7,4 @@ void NestedMouseUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags); void NestedPostMouseMotion(void* dev, int x, int y); void NestedPostMouseButton(void* dev, int button, int isDown); +void NestedPostKey(void* dev, unsigned int keycode, int isDown); diff --git a/src/xlibclient.c b/src/xlibclient.c index ee4b330..ebddc38 100644 --- a/src/xlibclient.c +++ b/src/xlibclient.c @@ -328,10 +328,12 @@ NestedClientTimerCallback(NestedClientPrivatePtr pPriv) { if (ev.type == KeyPress) { xf86DrvMsg(pPriv->scrnIndex, X_INFO, "Key Pressed!--%d\n",ev.xkey.keycode); + NestedPostKey(pPriv->dev, ev.xkey.keycode, TRUE); } if (ev.type == KeyRelease) { xf86DrvMsg(pPriv->scrnIndex, X_INFO, "Key Released!--%d\n",ev.xkey.keycode); + NestedPostKey(pPriv->dev, ev.xkey.keycode, FALSE); } } } |