Logo Search packages:      
Sourcecode: kcm-tablet version File versions  Download package

bool DeviceHandler::detectTablet (  )  [private]

Tablet Device detection Calls different subroutines to search all kinds of tablet devices until it finds what is actually connected

Returns:
true if detection worked false if a failure happened

Definition at line 81 of file devicehandler.cpp.

References findSerialDevice(), findUSBDevice(), findWacomDevList(), findXInputDevice(), and setDeviceInformation().

Referenced by reloadDeviceInformation().

{
    // start with xinput --list regardless of the device detection
    // xinput must list some input devices or the tablet is not installed correctly
    if (!findXInputDevice()) {
        if (!findWacomDevList()) {
            kDebug() << "no input devices (pad/stylus/eraser/cursor/touch) found via xinput --list and xsetwacom list dev";

            return false;
        }
    }

    // ok seems there is at least something connected, now try to get more information about the tablet device

    // first check lsusb
    if (!findUSBDevice()) {
        kDebug() << "no usb device found via lsusb :: check serial device";

        if (!findSerialDevice()) {
            kDebug() << "no serial device found";

            return false;
        }
    }

    Q_D(DeviceHandler);

    // ok up to this point we have a tablet found somehow lets set it up to work with it
    if (!setDeviceInformation(d->companyId, d->deviceId)) {
        kError() << "could not set up the tablet information";
        return false;
    }

    // \0/
    d->isDeviceAvailable = true;
    return true;
}


Generated by  Doxygen 1.6.0   Back to index