Add simple keyboard handling for wayland.

This commit is contained in:
James Grogan 2022-11-10 16:29:59 +00:00
parent e2cc98e1fb
commit 918c1d3046
8 changed files with 175 additions and 28 deletions

View file

@ -18,8 +18,18 @@ void WaylandSeatInterface::onSeatCapabilitiesEvent(uint32_t capabilities)
}
else if (!have_pointer && mPointerInterface!= nullptr)
{
wl_pointer_release(mPointerInterface->getPointer());
mPointerInterface.release();
mPointerInterface.reset();
}
const bool have_keyboard = capabilities & WL_SEAT_CAPABILITY_KEYBOARD;
if (have_keyboard && mKeyboard == nullptr)
{
auto keyboard = wl_seat_get_keyboard(mSeat);
mKeyboard = std::make_unique<WaylandKeyboard>(keyboard);
}
else if (!have_keyboard && mKeyboard!= nullptr)
{
mKeyboard.reset();
}
}
@ -36,13 +46,3 @@ void WaylandSeatInterface::seatNameEvent(void *data, struct wl_seat *wl_seat, co
{
MLOG_INFO("seat name: " << name);
}
void WaylandSeatInterface::setKeyboard(wl_keyboard* keyboard)
{
}
void WaylandSeatInterface::setPointer(wl_pointer* pointer)
{
}