Skip to content

Conversation

@littleblack111
Copy link
Contributor

@littleblack111 littleblack111 commented Oct 30, 2024

Describe your PR, what does it fix/add?

closes #8245, described there too

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

Is it ready for merging, or does it need work?

ready

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also needs a clang-format

@littleblack111
Copy link
Contributor Author

littleblack111 commented Nov 3, 2024

this is soo weird huh? yesterday i tested it it works.

now i re-clone my repo and checkout that commit and it doesnt work anymore...

seem like a issue with longPress var not being registered...

@github-actions github-actions bot added the debug label Nov 4, 2024
@littleblack111 littleblack111 changed the title bind: new long press option bind: new long press option, closes #8245 Nov 8, 2024
@littleblack111 littleblack111 changed the title bind: new long press option, closes #8245 bind: new long press option Nov 8, 2024
@vaxerski
Copy link
Member

vaxerski commented Nov 9, 2024

fixed and rebased, check now.

@littleblack111
Copy link
Contributor Author

lgtm, ready for merge

vaxerski
vaxerski previously approved these changes Nov 10, 2024
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs a wiki mr

@littleblack111
Copy link
Contributor Author

littleblack111 commented Nov 11, 2024

wait no, bindo should make the other bind = not work unless its released before the timer.

i.e. if i have a bind = playerctl position +5 and a bindo = playerctl next
in this example, it might be not obv since if u want to go next, u'd prob not care abt current progress.

solution i can think of rn: bind need to check if theres a bindo for the keybind and if so, only execute the action if on release the timer is not trigger yet, effectively making it bindr(i.e. make bind act like bindr if theres a bindo for it)'

but you can't just people to just use replace bind for bindr in these situations as if i have triggered the long press, the bindr shouldn't trigger.

@littleblack111
Copy link
Contributor Author

sorry, i don't know how should i make it still call the dispatcher after the continue;(on release)

@vaxerski
Copy link
Member

hm... at this point, you're better off just scripting it I believe. It's completely possible with transparent binds, no?

bindt = SUPER, O, exec, ~/myScript.sh DOWN
bindrt = SUPER, O, exec, ~/myScript.sh UP

Then your script on UP calculates the Δt and does a hyprctl dispatch with your command of choice

@littleblack111
Copy link
Contributor Author

littleblack111 commented Nov 12, 2024

alright then or perhaps bindor will be a good idea lol(another bindo will be needed so if k.longPress and k.release then execute the dispatcher on release if the timer is not up) or maybe this is it?

@vaxerski
Copy link
Member

idk tbh but I have a feeling this is unnecessary clutter for an already cluttered and messy system

@littleblack111
Copy link
Contributor Author

littleblack111 commented Nov 13, 2024

alright then. lets just finish it here, pls review the wiki pr and this(fixed a merge conflict)

@vaxerski
Copy link
Member

by that I kinda meant this entire PR.

@littleblack111
Copy link
Contributor Author

...idk, but I do feel like this is a quite basic functionality for binds

@vaxerski
Copy link
Member

idk, can you name a single other wayland environment that has this...?

@littleblack111
Copy link
Contributor Author

littleblack111 commented Nov 14, 2024

No.. but hyprland advertised

Not afraid to provide bleeding-edge features

Also, I'm pretty sure some people might want this

@vaxerski
Copy link
Member

fair

@vaxerski vaxerski merged commit 7affc34 into hyprwm:main Nov 15, 2024
12 checks passed
vaxerski pushed a commit to hyprwm/hyprland-wiki that referenced this pull request Nov 15, 2024
@littleblack111 littleblack111 deleted the bind-longPress branch November 16, 2024 01:35
@Havner
Copy link

Havner commented Dec 23, 2025

Just FYI, I've stumbled upon this PR when configuring long presses in Hyprland. I don't know if there is any well know solution for long press inhibiting the short one but I didn't find any.

hm... at this point, you're better off just scripting it I believe. It's completely possible with transparent binds, no?

bindt = SUPER, O, exec, ~/myScript.sh DOWN
bindrt = SUPER, O, exec, ~/myScript.sh UP

Then your script on UP calculates the Δt and does a hyprctl dispatch with your command of choice

I had a go at this idea: https://github.com/Havner/hyprlong/blob/orig/src/main.rs
And it worked, but unintuitevely. You had to release the press for long press to trigger which meant you actually didn't know if the long time has passed or not until you released.

The simpler idea actually utilizing this PR is this: https://github.com/Havner/hyprlong

Again, just FYI if someone stumbles upon this. Maybe there is something simpler I haven't found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Long press bind(not repeat)

3 participants