mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-08 03:35:35 +08:00
refs #453 Refactor CInputManger and low level input handlers
This commit is contained in:
committed by
Mathew Sutcliffe
parent
63c7c6be0d
commit
199a1e5fcb
46
src/blackcore/settings/application.h
Normal file
46
src/blackcore/settings/application.h
Normal 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
|
||||
Reference in New Issue
Block a user