1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2026-01-16 22:41:00 +00:00
serenity/Kernel/FileSystem/SysFS/Subsystems/Kernel/Configuration/CapsLockRemap.h
Liav A 751aae77bc Kernel: Rename /sys/kernel/variables => /sys/kernel/conf
The name "variables" is a bit awkward and what the directory entries are
really about is kernel configuration so let's make it clear with the new
name.
2023-08-27 22:50:22 +02:00

31 lines
814 B
C++

/*
* Copyright (c) 2022-2023, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/RefPtr.h>
#include <AK/Types.h>
#include <Kernel/FileSystem/SysFS/Subsystems/Kernel/Configuration/BooleanVariable.h>
#include <Kernel/Library/UserOrKernelBuffer.h>
#include <Kernel/Locking/Spinlock.h>
namespace Kernel {
class SysFSCapsLockRemap final : public SysFSSystemBooleanVariable {
public:
virtual StringView name() const override { return "caps_lock_to_ctrl"sv; }
static NonnullRefPtr<SysFSCapsLockRemap> must_create(SysFSDirectory const&);
private:
virtual bool value() const override;
virtual void set_value(bool new_value) override;
explicit SysFSCapsLockRemap(SysFSDirectory const&);
mutable Spinlock<LockRank::None> m_lock {};
};
}