baskerville / sxhkd

Simple X hotkey daemon
BSD 2-Clause "Simplified" License
2.78k stars 139 forks source link

Pressing keys once or twice #235

Open cdnhaese opened 3 years ago

cdnhaese commented 3 years ago

Is it possible to use both a single key press and a double key press as hotkeys? As an example to show what I'm trying to achieve:

XF86AudioPlay:
    playerctl -a play-pause
XF86AudioPlay; XF86AudioPlay
    playerctl -a next

So what I would like to achieve is to have the play button double as a 'next' button in case it it pressed twice. From the manual, I thought that this could be achieved by setting the colon after the first play button:

The colon character can be used instead of the semicolon to indicate that the chord chain shall not be aborted when the chain tail is reached.

Currently only the play action works, if I press the play button twice it just goes from play->pause->play without skipping a track. Is this something which I could get working with sxhkd?

butter-radish commented 2 years ago

I believe that isn't possible with sxhkd, because there isn't a way for the program to disambiguate between the two key-presses you described.

If something like #147 gets implemented then you can differentiate between them with a timeout.