diff options
author | Matthew Allum <breakfast@10.am> | 2005-06-30 13:39:00 +0000 |
---|---|---|
committer | Matthew Allum <breakfast@10.am> | 2005-06-30 13:39:00 +0000 |
commit | 0929f79c1baa5b65808ab034591510906623e841 (patch) | |
tree | 999bbcf8e735285c0097ae56f9818e04345381f5 | |
parent | b6c7afe0b9faed7025c70334d464fd75ce5c84c4 (diff) |
Another Xephyr focus/modifier fix
-rw-r--r-- | hw/kdrive/ephyr/ephyr.c | 12 | ||||
-rw-r--r-- | hw/kdrive/ephyr/hostx.c | 8 | ||||
-rw-r--r-- | hw/kdrive/ephyr/hostx.h | 3 |
3 files changed, 13 insertions, 10 deletions
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index ad8dab1a9..f2ac2d955 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -579,13 +579,15 @@ ephyrUpdateModifierState(unsigned int state) int i; CARD8 mask; - pkeydev = LookupKeyboardDevice(); + pkeydev = (DeviceIntPtr)LookupKeyboardDevice(); if (!pkeydev) return; keyc = pkeydev->key; + state = state & 0xff; + if (keyc->state == state) return; @@ -642,24 +644,24 @@ ephyrPoll(void) break; case EPHYR_EV_MOUSE_PRESS: - + ephyrUpdateModifierState(ev.key_state); mouseState |= ev.data.mouse_down.button_num; KdEnqueueMouseEvent(kdMouseInfo, mouseState|KD_MOUSE_DELTA, 0, 0); break; case EPHYR_EV_MOUSE_RELEASE: - + ephyrUpdateModifierState(ev.key_state); mouseState &= ~ev.data.mouse_up.button_num; KdEnqueueMouseEvent(kdMouseInfo, mouseState|KD_MOUSE_DELTA, 0, 0); break; case EPHYR_EV_KEY_PRESS: - ephyrUpdateModifierState(ev.data.key_down.state); + ephyrUpdateModifierState(ev.key_state); KdEnqueueKeyboardEvent (ev.data.key_down.scancode, FALSE); break; case EPHYR_EV_KEY_RELEASE: - ephyrUpdateModifierState(ev.data.key_up.state); + ephyrUpdateModifierState(ev.key_state); KdEnqueueKeyboardEvent (ev.data.key_up.scancode, TRUE); break; diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index 3454f2785..3f38b4512 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -719,6 +719,7 @@ hostx_get_event(EphyrHostXEvent *ev) case ButtonPress: ev->type = EPHYR_EV_MOUSE_PRESS; + ev->key_state = xev.xkey.state; /* * This is a bit hacky. will break for button 5 ( defined as 0x10 ) * Check KD_BUTTON defines in kdrive.h @@ -728,13 +729,14 @@ hostx_get_event(EphyrHostXEvent *ev) case ButtonRelease: ev->type = EPHYR_EV_MOUSE_RELEASE; + ev->key_state = xev.xkey.state; ev->data.mouse_up.button_num = 1<<(xev.xbutton.button-1); return 1; case KeyPress: { - ev->type = EPHYR_EV_KEY_PRESS; - ev->data.key_down.state = xev.xkey.state; + ev->type = EPHYR_EV_KEY_PRESS; + ev->key_state = xev.xkey.state; ev->data.key_down.scancode = xev.xkey.keycode; return 1; } @@ -780,7 +782,7 @@ hostx_get_event(EphyrHostXEvent *ev) * kdrive all togeather. */ ev->type = EPHYR_EV_KEY_RELEASE; - ev->data.key_up.state = xev.xkey.state; + ev->key_state = xev.xkey.state; ev->data.key_up.scancode = xev.xkey.keycode; return 1; diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h index 08ed036d4..9a4a8959d 100644 --- a/hw/kdrive/ephyr/hostx.h +++ b/hw/kdrive/ephyr/hostx.h @@ -69,16 +69,15 @@ struct EphyrHostXEvent struct key_up { int scancode; - int state; } key_up; struct key_down { int scancode; - int state; } key_down; } data; + int key_state; }; int |