blob: 27f53ff1e4a7421b34468b910b383b032faffe3a [file] [log] [blame]
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FUCHSIA_SDK_EXAMPLES_CC_INPUT_SAMPLE_H_
#define FUCHSIA_SDK_EXAMPLES_CC_INPUT_SAMPLE_H_
#include <lib/driver2/driver2_cpp.h>
#include "input_server.h"
namespace input_sample {
// Sample driver for a virtual input device that generates input reports.
class InputSampleDriver : public driver::DriverBase {
public:
InputSampleDriver(driver::DriverStartArgs start_args, fdf::UnownedDispatcher driver_dispatcher)
: driver::DriverBase("input-sample", std::move(start_args), std::move(driver_dispatcher)) {}
virtual ~InputSampleDriver() = default;
zx::result<> Start() override;
private:
void SendFakeReport();
std::shared_ptr<input_report_reader::InputReportReaderManager<SampleInputReport>>
input_report_readers_;
SampleInputReport report_;
};
} // namespace input_sample
#endif // FUCHSIA_SDK_EXAMPLES_CC_INPUT_SAMPLE_H_