Add the ability to add InputDevices to InputRedirection

[2/6] Make autotests create fake input devices
remotes/origin/work/eric/contextual-gestures
Julius Zint 4 years ago committed by Vlad Zahorodnii
parent 3134198a30
commit 97f49edb1c
  1. 8
      src/input.cpp
  2. 6
      src/input.h

@ -2587,7 +2587,7 @@ void InputRedirection::updateLeds(LEDs leds)
}
}
void InputRedirection::handleInputDeviceAdded(InputDevice *device)
void InputRedirection::addInputDevice(InputDevice *device)
{
connect(device, &InputDevice::keyChanged, m_keyboard, &KeyboardInputRedirection::processKey);
@ -2657,7 +2657,7 @@ void InputRedirection::handleInputDeviceAdded(InputDevice *device)
updateAvailableInputDevices();
}
void InputRedirection::handleInputDeviceRemoved(InputDevice *device)
void InputRedirection::removeInputDevice(InputDevice *device)
{
m_inputDevices.removeOne(device);
Q_EMIT deviceRemoved(device);
@ -2753,8 +2753,8 @@ void InputRedirection::addInputBackend(InputBackend *inputBackend)
Q_ASSERT(!m_inputBackends.contains(inputBackend));
m_inputBackends.append(inputBackend);
connect(inputBackend, &InputBackend::deviceAdded, this, &InputRedirection::handleInputDeviceAdded);
connect(inputBackend, &InputBackend::deviceRemoved, this, &InputRedirection::handleInputDeviceRemoved);
connect(inputBackend, &InputBackend::deviceAdded, this, &InputRedirection::addInputDevice);
connect(inputBackend, &InputBackend::deviceRemoved, this, &InputRedirection::removeInputDevice);
inputBackend->setConfig(InputConfig::self()->inputConfig());
inputBackend->initialize();

@ -287,10 +287,12 @@ Q_SIGNALS:
void hasTouchChanged(bool set);
void hasTabletModeSwitchChanged(bool set);
public Q_SLOTS:
void addInputDevice(InputDevice *device);
void removeInputDevice(InputDevice *device);
private Q_SLOTS:
void handleInputConfigChanged(const KConfigGroup &group);
void handleInputDeviceAdded(InputDevice *device);
void handleInputDeviceRemoved(InputDevice *device);
private:
void setupInputBackends();

Loading…
Cancel
Save