Client: Set key repeat rate and delay from the repeat_info event
[ChangeLog][QPA plugin] Clients now follow the keyboard key repeat delay and interval configured by the compositor. Change-Id: I8a88d341a2bb648d70f95494fe19e941273ae31b Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
This commit is contained in:
parent
833e1cef06
commit
3b4dd0f24b
@ -781,7 +781,7 @@ void QWaylandInputDevice::Keyboard::keyboard_key(uint32_t serial, uint32_t time,
|
||||
#if QT_CONFIG(xkbcommon_evdev)
|
||||
mRepeatSym = sym;
|
||||
#endif
|
||||
mRepeatTimer.setInterval(400);
|
||||
mRepeatTimer.setInterval(mRepeatDelay);
|
||||
mRepeatTimer.start();
|
||||
} else if (mRepeatCode == code) {
|
||||
mRepeatTimer.stop();
|
||||
@ -790,7 +790,7 @@ void QWaylandInputDevice::Keyboard::keyboard_key(uint32_t serial, uint32_t time,
|
||||
|
||||
void QWaylandInputDevice::Keyboard::repeatKey()
|
||||
{
|
||||
mRepeatTimer.setInterval(25);
|
||||
mRepeatTimer.setInterval(mRepeatRate);
|
||||
sendKey(mFocus->window(), mRepeatTime, QEvent::KeyRelease, mRepeatKey, modifiers(), mRepeatCode,
|
||||
#if QT_CONFIG(xkbcommon_evdev)
|
||||
mRepeatSym, mNativeModifiers,
|
||||
@ -830,6 +830,12 @@ void QWaylandInputDevice::Keyboard::keyboard_modifiers(uint32_t serial,
|
||||
#endif
|
||||
}
|
||||
|
||||
void QWaylandInputDevice::Keyboard::keyboard_repeat_info(int32_t rate, int32_t delay)
|
||||
{
|
||||
mRepeatRate = rate;
|
||||
mRepeatDelay = delay;
|
||||
}
|
||||
|
||||
void QWaylandInputDevice::Touch::touch_down(uint32_t serial,
|
||||
uint32_t time,
|
||||
struct wl_surface *surface,
|
||||
|
@ -204,6 +204,7 @@ public:
|
||||
uint32_t mods_latched,
|
||||
uint32_t mods_locked,
|
||||
uint32_t group) override;
|
||||
void keyboard_repeat_info(int32_t rate, int32_t delay) override;
|
||||
|
||||
QWaylandInputDevice *mParent = nullptr;
|
||||
QPointer<QWaylandWindow> mFocus;
|
||||
@ -219,6 +220,8 @@ public:
|
||||
int mRepeatKey;
|
||||
uint32_t mRepeatCode;
|
||||
uint32_t mRepeatTime;
|
||||
int mRepeatRate = 25;
|
||||
int mRepeatDelay = 400;
|
||||
QString mRepeatText;
|
||||
#if QT_CONFIG(xkbcommon_evdev)
|
||||
xkb_keysym_t mRepeatSym;
|
||||
|
Loading…
x
Reference in New Issue
Block a user