mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-03-27 11:08:29 +00:00
Merge branch 'input-hotplug'
This commit is contained in:
@@ -214,6 +214,9 @@ EvdevProc(DeviceIntPtr device, int what)
|
||||
EvdevKeyOff (device);
|
||||
}
|
||||
|
||||
if (what == DEVICE_CLOSE)
|
||||
evdevRemoveDevice(pEvdev);
|
||||
|
||||
device->public.on = FALSE;
|
||||
break;
|
||||
}
|
||||
@@ -238,10 +241,12 @@ EvdevSwitchMode (ClientPtr client, DeviceIntPtr device, int mode)
|
||||
else
|
||||
return !Success;
|
||||
break;
|
||||
#if 0
|
||||
case SendCoreEvents:
|
||||
case DontSendCoreEvents:
|
||||
xf86XInputSetSendCoreEvents (pInfo, (mode == SendCoreEvents));
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
return !Success;
|
||||
}
|
||||
@@ -268,7 +273,9 @@ EvdevNew(evdevDriverPtr driver, evdevDevicePtr device)
|
||||
pInfo->device_control = EvdevProc;
|
||||
pInfo->read_input = EvdevReadInput;
|
||||
pInfo->switch_mode = EvdevSwitchMode;
|
||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
|
||||
pInfo->motion_history_proc = xf86GetMotionEvents;
|
||||
#endif
|
||||
pInfo->conf_idev = driver->dev;
|
||||
|
||||
pInfo->private = device;
|
||||
|
||||
@@ -252,6 +252,7 @@ int evdevGetFDForDevice (evdevDevicePtr driver);
|
||||
Bool evdevStart (InputDriverPtr drv);
|
||||
Bool evdevNewDriver (evdevDriverPtr driver);
|
||||
Bool evdevGetBits (int fd, evdevBitsPtr bits);
|
||||
void evdevRemoveDevice (evdevDevicePtr device);
|
||||
|
||||
int EvdevBtnInit (DeviceIntPtr device);
|
||||
int EvdevBtnOn (DeviceIntPtr device);
|
||||
|
||||
@@ -672,8 +672,14 @@ EvdevAxesInit (DeviceIntPtr device)
|
||||
return Success;
|
||||
|
||||
if (!InitValuatorClassDeviceStruct(device, axes,
|
||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 1
|
||||
GetMotionHistory,
|
||||
GetMotionHistorySize(),
|
||||
#else
|
||||
miPointerGetMotionEvents,
|
||||
miPointerGetMotionBufferSize(), 0))
|
||||
miPointerGetMotionBufferSize(),
|
||||
#endif
|
||||
0))
|
||||
return !Success;
|
||||
|
||||
for (i = 0; i < axes; i++) {
|
||||
@@ -684,7 +690,9 @@ EvdevAxesInit (DeviceIntPtr device)
|
||||
if (!InitPtrFeedbackClassDeviceStruct(device, EvdevPtrCtrlProc))
|
||||
return !Success;
|
||||
|
||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 0
|
||||
xf86MotionHistoryAllocate (pInfo);
|
||||
#endif
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
||||
@@ -462,6 +462,24 @@ evdevNewDriver (evdevDriverPtr driver)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
evdevRemoveDevice (evdevDevicePtr pEvdev)
|
||||
{
|
||||
evdevDriverPtr driver;
|
||||
evdevDevicePtr *device;
|
||||
|
||||
for (driver = evdev_drivers; driver; driver = driver->next) {
|
||||
for (device = &driver->devices; *device; device = &(*device)->next) {
|
||||
if (*device == pEvdev) {
|
||||
*device = pEvdev->next;
|
||||
xf86DeleteInput(pEvdev->pInfo, 0);
|
||||
pEvdev->next = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Bool
|
||||
evdevGetBits (int fd, evdevBitsPtr bits)
|
||||
{
|
||||
|
||||
@@ -238,10 +238,11 @@ static KeySym map[] = {
|
||||
* So use the system bell for now.
|
||||
*/
|
||||
static void
|
||||
EvdevKbdBell (int percent, DeviceIntPtr device, pointer ctrl, int unused)
|
||||
EvdevKbdBell (int percent, DeviceIntPtr device, pointer arg, int unused)
|
||||
{
|
||||
xf86SoundKbdBell(percent, ((KeybdCtrl*) ctrl)->bell_pitch,
|
||||
((KeybdCtrl*) ctrl)->bell_duration);
|
||||
KeybdCtrl *ctrl = arg;
|
||||
|
||||
xf86OSRingBell(percent, ctrl->bell_pitch, ctrl->bell_duration);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user