mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
31 lines
829 B
C++
31 lines
829 B
C++
// SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
|
|
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
|
|
|
|
#ifndef SWIFT_INPUT_MACOSINPUTUTILS_H
|
|
#define SWIFT_INPUT_MACOSINPUTUTILS_H
|
|
|
|
//! \file
|
|
|
|
#include <CoreFoundation/CoreFoundation.h>
|
|
|
|
namespace swift::input
|
|
{
|
|
//! Common MacOS input utilities
|
|
class CMacOSInputUtils
|
|
{
|
|
public:
|
|
CMacOSInputUtils() = delete;
|
|
|
|
//! Check OS permission for input monitoring access
|
|
static bool hasAccess();
|
|
|
|
//! Request OS permission for input monitoring access
|
|
static bool requestAccess();
|
|
|
|
//! Creates a new device matching dict using usagePage and usage
|
|
static CFMutableDictionaryRef createDeviceMatchingDictionary(UInt32 usagePage, UInt32 usage);
|
|
};
|
|
}
|
|
|
|
#endif
|