summaryrefslogtreecommitdiff
path: root/xserver/xkb/xkbAccessX.c
diff options
context:
space:
mode:
Diffstat (limited to 'xserver/xkb/xkbAccessX.c')
-rw-r--r--xserver/xkb/xkbAccessX.c70
1 files changed, 44 insertions, 26 deletions
diff --git a/xserver/xkb/xkbAccessX.c b/xserver/xkb/xkbAccessX.c
index 7b57611e2..89be839d0 100644
--- a/xserver/xkb/xkbAccessX.c
+++ b/xserver/xkb/xkbAccessX.c
@@ -38,7 +38,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <X11/Xproto.h>
#include <X11/keysym.h>
#include "inputstr.h"
-#include <X11/extensions/XKBsrv.h>
+#include <xkbsrv.h>
#if !defined(WIN32) && !defined(Lynx)
#include <sys/time.h>
#endif
@@ -52,9 +52,9 @@ pointer XkbLastRepeatEvent= NULL;
unsigned short XkbDfltAccessXTimeout= 120;
unsigned int XkbDfltAccessXTimeoutMask= DFLT_TIMEOUT_CTRLS;
-unsigned int XkbDfltAccessXTimeoutValues= 0;
-unsigned int XkbDfltAccessXTimeoutOptionsMask= DFLT_TIMEOUT_OPTS;
-unsigned int XkbDfltAccessXTimeoutOptionsValues= 0;
+static unsigned int XkbDfltAccessXTimeoutValues= 0;
+static unsigned int XkbDfltAccessXTimeoutOptionsMask= DFLT_TIMEOUT_OPTS;
+static unsigned int XkbDfltAccessXTimeoutOptionsValues= 0;
unsigned int XkbDfltAccessXFeedback= XkbAccessXFeedbackMask;
unsigned short XkbDfltAccessXOptions= XkbAX_AllOptionsMask & ~(XkbAX_IndicatorFBMask|XkbAX_SKReleaseFBMask|XkbAX_SKRejectFBMask);
@@ -130,11 +130,9 @@ xEvent xE;
xE.u.u.type = type;
xE.u.u.detail = keyCode;
xE.u.keyButtonPointer.time = GetTimeInMillis();
-#ifdef DEBUG
if (xkbDebugFlags&0x8) {
- ErrorF("AXKE: Key %d %s\n",keyCode,(xE.u.u.type==KeyPress?"down":"up"));
+ DebugF("AXKE: Key %d %s\n",keyCode,(xE.u.u.type==KeyPress?"down":"up"));
}
-#endif
if (_XkbIsPressEvent(type))
XkbDDXKeyClick(keybd,keyCode,TRUE);
@@ -308,14 +306,19 @@ xkbControlsNotify cn;
static CARD32
AccessXRepeatKeyExpire(OsTimerPtr timer,CARD32 now,pointer arg)
{
-XkbSrvInfoPtr xkbi= ((DeviceIntPtr)arg)->key->xkbInfo;
+DeviceIntPtr dev = (DeviceIntPtr) arg;
+XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
KeyCode key;
+BOOL is_core;
- if (xkbi->repeatKey==0)
+ if (xkbi->repeatKey == 0)
return 0;
- key= xkbi->repeatKey;
- AccessXKeyboardEvent((DeviceIntPtr)arg,KeyRelease,key,True);
- AccessXKeyboardEvent((DeviceIntPtr)arg,KeyPress,key,True);
+
+ is_core = (dev == inputInfo.keyboard);
+ key = xkbi->repeatKey;
+ AccessXKeyboardEvent(dev, is_core ? KeyRelease : DeviceKeyRelease, key,
+ True);
+ AccessXKeyboardEvent(dev, is_core ? KeyPress : DeviceKeyPress, key, True);
return xkbi->desc->ctrls->repeat_interval;
}
@@ -349,7 +352,9 @@ XkbControlsPtr ctrls;
XkbSendAccessXNotify(keybd,&ev);
if (XkbAX_NeedFeedback(ctrls,XkbAX_SKAcceptFBMask))
XkbDDXAccessXBeep(keybd,_BEEP_SLOW_ACCEPT,XkbSlowKeysMask);
- AccessXKeyboardEvent(keybd,KeyPress,xkbi->slowKey,False);
+ AccessXKeyboardEvent(keybd,
+ (keybd == inputInfo.keyboard) ? KeyPress : DeviceKeyPress,
+ xkbi->slowKey,False);
/* check for magic sequences */
if ((ctrls->enabled_ctrls&XkbAccessXKeysMask) &&
((sym[0]==XK_Shift_R)||(sym[0]==XK_Shift_L)))
@@ -361,10 +366,7 @@ XkbControlsPtr ctrls;
if (keybd->kbdfeed->ctrl.autoRepeat &&
((xkbi->slowKey != xkbi->mouseKey) || (!xkbi->mouseKeysAccel)) &&
(ctrls->enabled_ctrls&XkbRepeatKeysMask)) {
-#ifndef AIXV3
- if (BitIsOn(keybd->kbdfeed->ctrl.autoRepeats,xkbi->slowKey))
-#endif
- {
+ if (BitIsOn(keybd->kbdfeed->ctrl.autoRepeats,xkbi->slowKey)) {
xkbi->repeatKey = xkbi->slowKey;
xkbi->repeatKeyTimer= TimerSet(xkbi->repeatKeyTimer,
0, ctrls->repeat_delay,
@@ -530,14 +532,9 @@ KeySym * sym = XkbKeySymsPtr(xkbi->desc,key);
if ((keybd->kbdfeed->ctrl.autoRepeat) &&
((ctrls->enabled_ctrls&(XkbSlowKeysMask|XkbRepeatKeysMask))==
XkbRepeatKeysMask)) {
-#ifndef AIXV3
- if (BitIsOn(keybd->kbdfeed->ctrl.autoRepeats,key))
-#endif
- {
-#ifdef DEBUG
+ if (BitIsOn(keybd->kbdfeed->ctrl.autoRepeats,key)) {
if (xkbDebugFlags&0x10)
- ErrorF("Starting software autorepeat...\n");
-#endif
+ DebugF("Starting software autorepeat...\n");
xkbi->repeatKey = key;
xkbi->repeatKeyTimer= TimerSet(xkbi->repeatKeyTimer,
0, ctrls->repeat_delay,
@@ -695,9 +692,11 @@ ProcessPointerEvent( register xEvent * xE,
register DeviceIntPtr mouse,
int count)
{
-DeviceIntPtr dev = (DeviceIntPtr)LookupKeyboardDevice();
+DeviceIntPtr dev = inputInfo.keyboard;
XkbSrvInfoPtr xkbi = dev->key->xkbInfo;
unsigned changed = 0;
+ProcessInputProc backupproc;
+xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(mouse);
xkbi->shiftKeyCount = 0;
xkbi->lastPtrEventTime= xE->u.keyButtonPointer.time;
@@ -709,7 +708,26 @@ unsigned changed = 0;
xkbi->lockedPtrButtons&= ~(1<<(xE->u.u.detail&0x7));
changed |= XkbPointerButtonMask;
}
- CoreProcessPointerEvent(xE,mouse,count);
+
+ /* Guesswork. mostly.
+ * xkb actuall goes through some effort to transparently wrap the
+ * processInputProcs (see XkbSetExtension). But we all love fun, so the
+ * previous XKB implementation just hardcoded the CPPE call here instead
+ * of unwrapping like anybody with any sense of decency would do.
+ * I got no clue what the correct thing to do is, but my guess is that
+ * it's not hardcoding. I may be wrong. whatever it is, don't come whining
+ * to me. I just work here.
+ *
+ * Anyway. here's the old call, if you don't like the wrapping, revert it.
+ *
+ * CoreProcessPointerEvent(xE,mouse,count);
+ *
+ * see. it's still steaming. told you. (whot)
+ */
+ UNWRAP_PROCESS_INPUT_PROC(mouse, xkbPrivPtr, backupproc);
+ mouse->public.processInputProc(xE, mouse, count);
+ COND_WRAP_PROCESS_INPUT_PROC(mouse, xkbPrivPtr,
+ backupproc, xkbUnwrapProc);
xkbi->state.ptr_buttons = mouse->button->state;