2 * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "inputdevicesimulator.h"
18 #include "ui_inputdevicesimulator.h"
22 InputDeviceSimulator::InputDeviceSimulator(QWidget *parent) :
24 mp_ui(new Ui::InputDeviceSimulator),
29 // connect to the dBus interface provided by the input device distributor
30 mp_dBusInputevent = new org::agl::inputevent("org.agl.main",
31 "/InputEventDistributor",
32 QDBusConnection::sessionBus(),
36 this->restoreGeometry(settings.value("inputdevicesimulator/geometry").toByteArray());
39 InputDeviceSimulator::~InputDeviceSimulator()
42 settings.setValue("inputdevicesimulator/geometry", saveGeometry());
44 if (0 == mp_dBusInputevent)
46 delete mp_dBusInputevent;
52 void InputDeviceSimulator::on_pushButtonRight_clicked()
55 mp_dBusInputevent->keyEvent(SystemInputEvent::INPUTEVENTTYPE_KEY_PRESSED, SystemInputEvent::INPUTEVENTZONE_1, Qt::Key_Right);