XKB: Actions: Don't run certain actions on the core keyboard

Don't run VT switches, terminations, or anything, on the core keyboard: only
run actions which affect the keyboard state.  If we get an action such as VT
switch, just swallow the event.
This commit is contained in:
Daniel Stone 2007-12-05 19:37:48 +00:00
parent 85dd8efac1
commit 320abd7d1d
3 changed files with 23 additions and 4 deletions

View File

@ -48,6 +48,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
int
XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act)
{
xf86ProcessActionEvent(ACTION_TERMINATE, NULL);
if (dev != inputInfo.keyboard)
xf86ProcessActionEvent(ACTION_TERMINATE, NULL);
return 0;
}

View File

@ -41,6 +41,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE.
int
XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act)
{
GiveUp(1);
if (dev != inputInfo.keyboard)
GiveUp(1);
return 0;
}

View File

@ -561,6 +561,9 @@ _XkbFilterPointerMove( XkbSrvInfoPtr xkbi,
int x,y;
Bool accel;
if (xkbi->device == inputInfo.keyboard)
return 0;
if (filter->keycode==0) { /* initial press */
filter->keycode = keycode;
filter->active = 1;
@ -601,6 +604,9 @@ _XkbFilterPointerBtn( XkbSrvInfoPtr xkbi,
unsigned keycode,
XkbAction * pAction)
{
if (xkbi->device == inputInfo.keyboard)
return 0;
if (filter->keycode==0) { /* initial press */
int button= pAction->btn.button;
@ -980,8 +986,11 @@ _XkbFilterSwitchScreen( XkbSrvInfoPtr xkbi,
unsigned keycode,
XkbAction * pAction)
{
DeviceIntPtr dev = xkbi->device;
if (dev == inputInfo.keyboard)
return 0;
if (filter->keycode==0) { /* initial press */
DeviceIntPtr dev = xkbi->device;
filter->keycode = keycode;
filter->active = 1;
filter->filterOthers = 0;
@ -1003,8 +1012,11 @@ _XkbFilterXF86Private( XkbSrvInfoPtr xkbi,
unsigned keycode,
XkbAction * pAction)
{
DeviceIntPtr dev = xkbi->device;
if (dev == inputInfo.keyboard)
return 0;
if (filter->keycode==0) { /* initial press */
DeviceIntPtr dev = xkbi->device;
filter->keycode = keycode;
filter->active = 1;
filter->filterOthers = 0;
@ -1029,6 +1041,9 @@ _XkbFilterDeviceBtn( XkbSrvInfoPtr xkbi,
DeviceIntPtr dev;
int button;
if (dev == inputInfo.keyboard)
return 0;
if (filter->keycode==0) { /* initial press */
dev= _XkbLookupButtonDevice(pAction->devbtn.device,NULL);
if ((!dev)||(!dev->public.on)||(&dev->public==LookupPointerDevice()))