Commit dff485f1 authored by Rodney Dawes's avatar Rodney Dawes
Browse files

TextInputV2: Add API to set modifiers map on clients

parent b58cc08a
......@@ -301,6 +301,17 @@ void TextInputV2InterfacePrivate::sendLanguage()
}
}
void TextInputV2InterfacePrivate::sendModifiersMap()
{
if (!surface) {
return;
}
const QList<Resource *> textInputs = textInputsForClient(surface->client());
for (auto resource : textInputs) {
send_modifiers_map(resource->handle, modifiersMap);
}
}
TextInputV2InterfacePrivate::TextInputV2InterfacePrivate(SeatInterface *seat, TextInputV2Interface *_q)
: seat(seat)
, q(_q)
......@@ -489,6 +500,16 @@ void TextInputV2Interface::setLanguage(const QString &languageTag)
d->sendLanguage();
}
void TextInputV2Interface::setModifiersMap(const QByteArray &modifiersMap)
{
if (d->modifiersMap == modifiersMap) {
// not changed
return;
}
d->modifiersMap = modifiersMap;
d->sendModifiersMap();
}
QPointer<SurfaceInterface> TextInputV2Interface::surface() const
{
return d->surface;
......
......@@ -211,6 +211,11 @@ public:
*/
void setLanguage(const QString &languageTag);
/**
* Sets the modifiers map to use when modifiers are included in a key event.
*/
void setModifiersMap(const QByteArray &modifiersMap);
Q_SIGNALS:
/**
* Requests input panels (virtual keyboard) to show.
......
......@@ -46,6 +46,7 @@ public:
void keysymReleased(quint32 keysym, quint32 modifiers);
void sendInputPanelState();
void sendLanguage();
void sendModifiersMap();
QList<Resource *> textInputsForClient(ClientConnection *client) const;
static TextInputV2InterfacePrivate *get(TextInputV2Interface *inputInterface)
......@@ -65,6 +66,7 @@ public:
bool inputPanelVisible = false;
QRect overlappedSurfaceArea;
QString language;
QByteArray modifiersMap;
TextInputV2Interface *q;
QSet<SurfaceInterface *> m_enabledSurfaces;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment