*** xc/programs/Xserver/mi/mieq.c Sun Sep 27 10:03:51 1998 --- xc-mostly402/programs/Xserver/mi/mieq.c Tue May 22 09:11:35 2001 *************** *** 165,170 **** --- 165,173 ---- } else { + static int emulate=0; + static int emulated=0; + unsigned short buff; xe = e->event; if (miEventQueue.head == QUEUE_SIZE - 1) miEventQueue.head = 0; *************** *** 172,179 **** --- 175,222 ---- ++miEventQueue.head; switch (xe.u.u.type) { + case ButtonPress: + xe.u.u.detail = emulated = 1 + emulate; + // fprintf (stderr,"Button event %i\n",xe.u.u.detail); + (*miEventQueue.pPtr->processInputProc) + (&xe, (DeviceIntPtr)miEventQueue.pPtr, 1); + break; + case ButtonRelease: + xe.u.u.detail = emulated; + emulated=0; + // fprintf (stderr,"Button event %i\n",xe.u.u.detail); + (*miEventQueue.pPtr->processInputProc) + (&xe, (DeviceIntPtr)miEventQueue.pPtr, 1); + break; case KeyPress: + // fprintf (stderr,"KeyPress %i\n",xe.u.u.detail); + if (xe.u.u.detail == 8) { // left shift + if (emulate == 2) + emulate = 0; + else + emulate = 1; + } else if (xe.u.u.detail == 24) { // right shift + if (emulate == 1) + emulate = 0; + else + emulate = 2; + } + (*miEventQueue.pKbd->processInputProc) + (&xe, (DeviceIntPtr)miEventQueue.pKbd, 1); + break; case KeyRelease: + // fprintf (stderr,"KeyRelease %i\n",xe.u.u.detail); + if (xe.u.u.detail == 8) { + if (emulate == 0) + emulate = 2; + else + emulate = 0; + } else if (xe.u.u.detail == 24) { + if (emulate == 0) + emulate = 1; + else + emulate = 0; + } (*miEventQueue.pKbd->processInputProc) (&xe, (DeviceIntPtr)miEventQueue.pKbd, 1); break;