Sample Hotkey

Demonstrates the usage of IKeyboard

refs #83
This commit is contained in:
Roland Winklmeier
2014-03-05 15:55:30 +01:00
parent a7465fa6a3
commit f09c77ebd0
7 changed files with 345 additions and 1 deletions

66
samples/hotkey/hotkey.h Normal file
View File

@@ -0,0 +1,66 @@
/* Copyright (C) 2013 VATSIM Community / contributors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef BLACKSAMPLE_HOTKEY_H
#define BLACKSAMPLE_HOTKEY_H
#include "led.h"
#include "blackcore/keyboard.h"
#include "blackmisc/hwkeyboardkey.h"
#include <QDialog>
#include <QPushButton>
#include <QLabel>
#include <QScopedPointer>
class HotkeyDialog : public QDialog
{
Q_OBJECT
public:
/*!
* \brief Constructor
* \param parent
*/
explicit HotkeyDialog(QWidget *parent = 0);
//! Destructor
~HotkeyDialog();
public slots:
//! \brief Slot to select a new hot key
void selectHotKey();
private slots:
/*!
* \brief Slot when the selected key set has changed
* \param keySet
*/
void keySelectionChanged(BlackMisc::Hardware::CKeyboardKey key);
/*!
* \brief Slot when the key selection is finished
* \param keySet
*/
void keySelectionFinished(BlackMisc::Hardware::CKeyboardKey key);
private:
/*!
* \brief Set the key status
* \param isPressed
*/
void setPressed(bool isPressed);
private:
void setupUi();
void setupConnections();
BlackCore::IKeyboard *m_keyboard;
QPushButton *m_pbSelect;
QLabel *m_lblHotkey;
CLed *m_led;
};
#endif // BLACKSAMPLE_HOTKEY_H