[prev in list] [next in list] [prev in thread] [next in thread]
List: kwin
Subject: Re: Review Request 124954: Add support for modifier only shortcuts on Wayland
From: Martin_Gräßlin <mgraesslin () kde ! org>
Date: 2015-09-09 8:07:14
Message-ID: 20150909080714.24667.16164 () mimi ! kde ! org
[Download RAW message or body]
--===============5938144229654766603==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
> On Sept. 7, 2015, 4:59 p.m., Thomas Lübking wrote:
> > Hold it.
> >
> > Implementationwise, this looks wonky - if it's possible to get unbalanced input \
> > events (ie. releases w/o ever a press or vv.) from the system since the counter \
> > will run out of sync.
> > => Are such unbalanced events prevented by libinput for sure or can one eg. \
> > create synthetic release events (w/o a synthetic press event)?
>
> Martin Gräßlin wrote:
> libinput does not (to my knowledge) allow synthetic release events. Though there \
> might be a danger with vt switching (that probably needs more testing)
> Thomas Lübking wrote:
> i'd also worry about event compression, eg. when releasing key & modifier \
> "simultanously" one might get only one release event?
> better safe than sorry and go for a midifier comparism and kill flag?
>
> Martin Gräßlin wrote:
> No libinput doesn't do that, but I agree on the better safe than sorry aspect. Will \
> update.
> Martin Gräßlin wrote:
> Actually it doesn't matter. If we get unbalanced input events we have a bigger \
> problem with xkb_state_update_key which is documented with a warning that missed \
> input events can result in stuck modifiers. As that call is just above, we either \
> have a huge issue anyway or it works.
> Martin Gräßlin wrote:
> Just did some testing with vt switching and it looks like this doesn't get xkb into \
> an inconsistent state -> all fine I assume
> Thomas Lübking wrote:
> I assume states are globally cleared on VT changes.
>
> Well, I'll remind you when we end up with stuck keys everywhere :-P
>
>
> Eventually, one might require an IPC access to clear states, ie. count called ups \
> and downs for every xkb_keycode_t and rewind them (to a certain level, ie. ensure \
> shift is considered pressed #1) - if we get trouble here, we can hardly suggest to \
> restart kwin to clear this. And at least on the hardware level, things can fail \
> easily (ie. a hanging key which generated no release event - you need to \
> press-release it to get rid of that, ie. have -likely- seen one press too much. \
> Thanks to wireless keyboards)
> Well, I'll remind you when we end up with stuck keys everywhere
Please do ;-)
- Martin
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124954/#review84959
-----------------------------------------------------------
On Aug. 27, 2015, 6:04 p.m., Martin Gräßlin wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124954/
> -----------------------------------------------------------
>
> (Updated Aug. 27, 2015, 6:04 p.m.)
>
>
> Review request for kwin, Plasma and Hans Chen.
>
>
> Repository: kwin
>
>
> Description
> -------
>
> On popular demand!
>
> This change tracks how modifiers are used and detects a modifier only
> key press/release. That is:
> * no other key is pressed when the modifier gets pressed
> * no other key gets pressed before the modifier gets released
>
> If such a press/release is detected, we call a configurable dbus call.
> The possible shortcuts can be configured in kwinrc, group
> "ModifierOnlyShortcuts". The following keys are supported:
> * Shift
> * Control
> * Alt
> * Meta
>
> As value it takes a QStringList (comma seperated string) with
> service,path,interface,method,additionalargs
>
> E.g. to invoke Desktop Grid effect on Meta key:
>
> [ModifierOnlyShortcuts]
> Meta=org.kde.kglobalaccel,/component/kwin/,org.kde.kglobalaccel.Component,invokeShortcut,ShowDesktopGrid
>
> I do not intend to add a config interface for it. Let's keep it a hidden
> way.
>
>
> Diffs
> -----
>
> input.h cfb693dc06a18ea9ca7cffb99b9a1318ee443e3a
> input.cpp 92724d7b7559dd460a8f5fbe17deb3c72024eed6
> options.h 07c5193e3bd205c5c8c22a305f4c1d87e16d175f
> options.cpp 64269d64bc49640bf2e4e925ce1969f2a5d6b96b
>
> Diff: https://git.reviewboard.kde.org/r/124954/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Martin Gräßlin
>
>
--===============5938144229654766603==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 8bit
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 \
solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;"> \
<tr> <td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/124954/">https://git.reviewboard.kde.org/r/124954/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <p style="margin-top: 0;">On September 7th, 2015, 4:59 p.m. CEST, <b>Thomas \
Lübking</b> wrote:</p> <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;"> <pre style="white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Hold it.</p> <p style="padding: 0;text-rendering: \
inherit;margin: 0;line-height: inherit;white-space: inherit;">Implementationwise, \
this looks wonky - if it's possible to get unbalanced input events (ie. releases w/o \
ever a press or vv.) from the system since the counter will run out of sync.</p> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">=> Are such unbalanced events prevented by libinput for sure or can one \
eg. create synthetic release events (w/o a synthetic press event)?</p></pre> \
</blockquote>
<p>On September 8th, 2015, 8:07 a.m. CEST, <b>Martin Gräßlin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">libinput does not (to my knowledge) allow synthetic release events. Though \
there might be a danger with vt switching (that probably needs more \
testing)</p></pre> </blockquote>
<p>On September 8th, 2015, 11:11 a.m. CEST, <b>Thomas Lübking</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">i'd \
also worry about event compression, eg. when releasing key & modifier \
"simultanously" one might get only one release event?</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">better safe than sorry and go for a midifier comparism and kill \
flag?</p></pre> </blockquote>
<p>On September 8th, 2015, 11:17 a.m. CEST, <b>Martin Gräßlin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">No \
libinput doesn't do that, but I agree on the better safe than sorry aspect. Will \
update.</p></pre> </blockquote>
<p>On September 9th, 2015, 9:07 a.m. CEST, <b>Martin Gräßlin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Actually it doesn't matter. If we get unbalanced input events we have a \
bigger problem with xkb_state_update_key which is documented with a warning that \
missed input events can result in stuck modifiers. As that call is just above, we \
either have a huge issue anyway or it works.</p></pre> </blockquote>
<p>On September 9th, 2015, 9:13 a.m. CEST, <b>Martin Gräßlin</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Just \
did some testing with vt switching and it looks like this doesn't get xkb into an \
inconsistent state -> all fine I assume</p></pre> </blockquote>
<p>On September 9th, 2015, 9:53 a.m. CEST, <b>Thomas Lübking</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I \
assume states are globally cleared on VT changes.</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Well, \
I'll remind you when we end up with stuck keys everywhere :-P</p> <p style="padding: \
0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Eventually, one might require an IPC access to clear states, ie. count \
called ups and downs for every xkb_keycode_t and rewind them (to a certain level, ie. \
ensure shift is considered pressed #1) - if we get trouble here, we can hardly \
suggest to restart kwin to clear this. And at least on the hardware level, things can \
fail easily (ie. a hanging key which generated no release event - you need to \
press-release it to get rid of that, ie. have -likely- seen one press too much. \
Thanks to wireless keyboards)</p></pre> </blockquote>
</blockquote>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><blockquote \
style="text-rendering: inherit;padding: 0 0 0 1em;border-left: 1px solid \
#bbb;white-space: normal;margin: 0 0 0 0.5em;line-height: inherit;"> <p \
style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: \
inherit;">Well, I'll remind you when we end up with stuck keys everywhere</p> \
</blockquote> <p style="padding: 0;text-rendering: inherit;margin: 0;line-height: \
inherit;white-space: inherit;">Please do ;-)</p></pre> <br />
<p>- Martin</p>
<br />
<p>On August 27th, 2015, 6:04 p.m. CEST, Martin Gräßlin wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: \
1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; \
-webkit-border-radius: 6px;"> <tr>
<td>
<div>Review request for kwin, Plasma and Hans Chen.</div>
<div>By Martin Gräßlin.</div>
<p style="color: grey;"><i>Updated Aug. 27, 2015, 6:04 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
kwin
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">On popular demand!
This change tracks how modifiers are used and detects a modifier only
key press/release. That is:
* no other key is pressed when the modifier gets pressed
* no other key gets pressed before the modifier gets released
If such a press/release is detected, we call a configurable dbus call.
The possible shortcuts can be configured in kwinrc, group
"ModifierOnlyShortcuts". The following keys are supported:
* Shift
* Control
* Alt
* Meta
As value it takes a QStringList (comma seperated string) with
service,path,interface,method,additionalargs
E.g. to invoke Desktop Grid effect on Meta key:
[ModifierOnlyShortcuts]
Meta=org.kde.kglobalaccel,/component/kwin/,org.kde.kglobalaccel.Component,invokeShortcut,ShowDesktopGrid
I do not intend to add a config interface for it. Let's keep it a hidden
way.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>input.h <span style="color: \
grey">(cfb693dc06a18ea9ca7cffb99b9a1318ee443e3a)</span></li>
<li>input.cpp <span style="color: \
grey">(92724d7b7559dd460a8f5fbe17deb3c72024eed6)</span></li>
<li>options.h <span style="color: \
grey">(07c5193e3bd205c5c8c22a305f4c1d87e16d175f)</span></li>
<li>options.cpp <span style="color: \
grey">(64269d64bc49640bf2e4e925ce1969f2a5d6b96b)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/124954/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
--===============5938144229654766603==--
[Attachment #3 (text/plain)]
_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic