blob: ccb0cb0b0e7329f0642946f197cd859f958e1229 [file] [log] [blame]
// Copyright 2020 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <memory>
#include <rfb/rfb.h>
namespace screenshot {
// Convert keysym to scancode.
int KeySymToScancode(rfbKeySym key);
// Manager of uinput devices. Implementation hidden in UinputImpl to avoid
// dependencies in header.
class Uinput {
// Creates a new instance, sets up uinput devices, and routes input events
// from the server to the newly created devices.
// Only one instance can be alive at a time, since libvncserver only accepts
// plain function pointers for input event callbacks, meaning the callback is
// static and we cannot simply attach a particular Uinput instance to a server
// instance.
// If |rotate| is true, the instance will translate the pointer coordinates
// to handle rotation.
static std::unique_ptr<Uinput> Create(rfbScreenInfoPtr server, bool rotate);
Uinput(const Uinput&) = delete;
Uinput& operator=(const Uinput&) = delete;
// Existing uinput devices are destroyed upon destruction.
virtual ~Uinput() = default;
Uinput() = default;
} // namespace screenshot