refs #453 Refactor CInputManger and low level input handlers

This commit is contained in:
Roland Winklmeier
2015-08-14 20:21:27 +02:00
committed by Mathew Sutcliffe
parent 63c7c6be0d
commit 199a1e5fcb
31 changed files with 609 additions and 1086 deletions

View File

@@ -0,0 +1,46 @@
/* Copyright (C) 2015
* swift project Community / Contributors
*
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
* including this file, may be copied, modified, propagated, or distributed except according to the terms
* contained in the LICENSE file.
*/
//! \file
#ifndef BLACKCORE_SETTINGS_APPLICATION_H
#define BLACKCORE_SETTINGS_APPLICATION_H
#include "blackcore/settingscache.h"
#include "blackmisc/input/actionhotkeylist.h"
namespace BlackCore
{
namespace Settings
{
namespace Application
{
//! User configured hotkeys
struct ActionHotkeys : public CSettingTrait<BlackMisc::Input::CActionHotkeyList>
{
//! \copydoc BlackCore::CSetting::key
static const char *key() { return "application/actionhotkeys"; }
//! \copydoc BlackCore::CSetting::isValid
static bool isValid(const BlackMisc::Input::CActionHotkeyList &value)
{
for (const auto &actionHotkey : value)
{
if (actionHotkey.getApplicableMachine().getMachineName().isEmpty() ||
actionHotkey.getAction().isEmpty() ||
actionHotkey.getCombination().isEmpty()) { return false; }
}
return true;
}
};
}
}
}
#endif