On Sun, Jan 12, 2020 at 6:11 PM Aleix Pol <aleix...@kde.org> wrote:
>
> Hi,
> In a discussion some weeks ago, we came to the conclusion that it
> would make sense to support long press global shortcuts.
>
> The use-case we discussed back then was the power button on the Plasma
> phone. We need to have 2 actions upon press. Short press would lock
> and dim the screen, long press would show the shutdown button.
> Thinking about it further makes me think it's something we probably
> want for the desktop use-case as well.
>
> The problem is two-fold:
> - We need to support long-press on kglobal accel (or even QShortcut?)
> - When do we trigger the action? Because now it happens on pressed.
>
> The second part of this is why I'm sending this e-mail. We're
> responding to global shortcuts on press rather than on release, which
> makes it impossible to handle the long press. Would it make sense to
> change it to on release? Maybe only in the cases where there's a long
> press counterpart?
>
> Aleix

Hi,
So I've been looking into it further and it turns out that the power
button is special in libinput in that Press and Release are always
emitted together upon press on my laptops (kde slimbook 1, dell xps
13, ms surface go). Good news is that on my nexus 5x it does the right
thing. I wonder how reliable that is though.

I have no idea why that is, it could make sense to reach out to
libinput upstream and they know what's going on.
You can test it in your computer by using "sudo libinput debug-events".

https://phabricator.kde.org/D26899
Here's a patch that should work, consequently we should implement
Qt::Key_PowerDown on powerdevil and start removing the ad-hoc dpms
management we do at the moment on hwcomposer.

Alternatively, we could also consider implementing it for double-press.

Aleix

Reply via email to