XKB: Cope with all events in XkbProcessKeyboardEvent
Cope with Xi and pointer events in the (now increasingly misnamed)
XkbProcessKeyboardEvent. If it's the wrong type, call through the wrapping
chain to get out; else, process it.
(cherry picked from commit e717cf08e9
)
This commit is contained in:
parent
37c690cfa4
commit
e26e93c54e
@ -36,11 +36,11 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
|
#include "exevents.h"
|
||||||
#include <xkbsrv.h>
|
#include <xkbsrv.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#define EXTENSION_EVENT_BASE 64
|
#define EXTENSION_EVENT_BASE 64
|
||||||
|
|
||||||
|
|
||||||
/***====================================================================***/
|
/***====================================================================***/
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -115,12 +115,12 @@ int xiEvent;
|
|||||||
break;
|
break;
|
||||||
case XkbKB_Lock:
|
case XkbKB_Lock:
|
||||||
if ( xE->u.u.type == KeyRelease ||
|
if ( xE->u.u.type == KeyRelease ||
|
||||||
xE->u.u.type == DeviceKeyRelease)
|
xE->u.u.type == DeviceKeyRelease) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
int bit= 1<<(key&7);
|
int bit= 1<<(key&7);
|
||||||
if ( keyc->down[key>>3]&bit )
|
if ( keyc->down[key>>3]&bit ) {
|
||||||
{
|
|
||||||
if (xiEvent)
|
if (xiEvent)
|
||||||
xE->u.u.type = DeviceKeyRelease;
|
xE->u.u.type = DeviceKeyRelease;
|
||||||
else
|
else
|
||||||
@ -193,23 +193,42 @@ int xiEvent;
|
|||||||
void
|
void
|
||||||
ProcessKeyboardEvent(xEvent *xE,DeviceIntPtr keybd,int count)
|
ProcessKeyboardEvent(xEvent *xE,DeviceIntPtr keybd,int count)
|
||||||
{
|
{
|
||||||
KeyClassPtr keyc = keybd->key;
|
|
||||||
XkbSrvInfoPtr xkbi;
|
|
||||||
|
|
||||||
xkbi= keyc->xkbInfo;
|
KeyClassPtr keyc = keybd->key;
|
||||||
|
XkbSrvInfoPtr xkbi = NULL;
|
||||||
|
ProcessInputProc backup_proc;
|
||||||
|
xkbDeviceInfoPtr xkb_priv = XKBDEVICEINFO(keybd);
|
||||||
|
int is_press = (xE->u.u.type == KeyPress || xE->u.u.type == DeviceKeyPress);
|
||||||
|
int is_release = (xE->u.u.type == KeyRelease ||
|
||||||
|
xE->u.u.type == DeviceKeyRelease);
|
||||||
|
|
||||||
#ifdef DEBUG
|
if (keyc)
|
||||||
if (xkbDebugFlags&0x8) {
|
xkbi = keyc->xkbInfo;
|
||||||
int key= xE->u.u.detail;
|
|
||||||
ErrorF("PKE: Key %d %s\n",key,(xE->u.u.type==KeyPress?"down":"up"));
|
/* We're only interested in key events. */
|
||||||
|
if (!is_press && !is_release) {
|
||||||
|
UNWRAP_PROCESS_INPUT_PROC(keybd, xkb_priv, backup_proc);
|
||||||
|
keybd->public.processInputProc(xE, keybd, count);
|
||||||
|
COND_WRAP_PROCESS_INPUT_PROC(keybd, xkb_priv, backup_proc,
|
||||||
|
xkbUnwrapProc);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if ((xkbi->desc->ctrls->enabled_ctrls&XkbAllFilteredEventsMask)==0)
|
/* If AccessX filters are active, then pass it through to
|
||||||
XkbProcessKeyboardEvent(xE,keybd,count);
|
* AccessXFilter{Press,Release}Event; else, punt to
|
||||||
else if (xE->u.u.type==KeyPress || xE->u.u.type==DeviceKeyPress)
|
* XkbProcessKeyboardEvent.
|
||||||
AccessXFilterPressEvent(xE,keybd,count);
|
*
|
||||||
else if (xE->u.u.type==KeyRelease || xE->u.u.type==DeviceKeyRelease)
|
* If AXF[PK]E don't intercept anything (which they probably won't),
|
||||||
AccessXFilterReleaseEvent(xE,keybd,count);
|
* they'll punt through XPKE anyway. */
|
||||||
|
if ((xkbi->desc->ctrls->enabled_ctrls & XkbAllFilteredEventsMask)) {
|
||||||
|
if (is_press)
|
||||||
|
AccessXFilterPressEvent(xE, keybd, count);
|
||||||
|
else if (is_release)
|
||||||
|
AccessXFilterReleaseEvent(xE, keybd, count);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
XkbProcessKeyboardEvent(xE, keybd, count);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user