justinknguyen / BeatBind

A background Python Windows application for global hotkeys on Spotify.
MIT License
51 stars 7 forks source link

Incorrect handling of keybindings #8

Closed alexsanv closed 6 months ago

alexsanv commented 9 months ago

Describe the bug Keybindings still work even if some extra buttons are pressed.

To Reproduce Steps to reproduce the behavior:

  1. Set the Play\Stop binding as Ctrl+P
  2. Save
  3. Press Ctrl+Shift+P or Ctr+Alt+P or any other combination, but it must include keys which are specified in key binding
  4. Play\Stop actions work

Expected behavior Keybinding should work when and only when keys in the binding are pressed. So if Play\Stop is bent to Ctrl+P, it should not work when Ctrl+Shift+P or any other combination, only when exactly Ctrl+P is pressed.

Desktop (please complete the following information):

justinknguyen commented 9 months ago

Unfortunately that's the expected behaviour of the global hotkeys package I'm using right now. The others I tried using didn't work when you wake your pc from sleep. I don't have time right now to look into fixing the package, but I can whenever I'm free.

I'm planning to create a C# version of this, that will hopefully solve all of the problems I have with python.

alexsanv commented 9 months ago

Got it, thanks!

justinknguyen commented 9 months ago

Closing this as it's expected behaviour. This behaviour is the same as in the popular AutoHotkey app.

justinknguyen commented 7 months ago

@alexsanv I've updated the global_hotkeys module that this app uses, and as a side effect, it resolved your issue. Pressing extra modifier keys in addition to your hotkey, should not trigger the hotkey anymore.

Please download v1.5.2

alexsanv commented 7 months ago

@justinknguyen, It is fixed, but partially. Given original steps to reproduce, press Сtrl + D (or any other letter button here) + P -> spotify stops \ starts playing But I can confirm that the combination of Сtrl + Shift + P does nothing as expected.

Well, if you have time, you could probably look into that issue as well. But anyways, thanks for the efforts!

justinknguyen commented 7 months ago

@justinknguyen, It is fixed, but partially.

Given original steps to reproduce, press Сtrl + D (or any other letter button here) + P -> spotify stops \ starts playing

But I can confirm that the combination of Сtrl + Shift + P does nothing as expected.

Well, if you have time, you could probably look into that issue as well.

But anyways, thanks for the efforts!

This app uses the global_hotkeys module by btsdev: https://github.com/btsdev/global_hotkeys. I recommend creating this issue ticket there so they can solve your issue.

They recently added logic to prevent the hotkey from triggering if other modifier keys are pressed, but no logic for alphanumeric keys yet.

justinknguyen commented 7 months ago

give me a ping here to let me know once your issue is fixed, then I'll update the app. Thanks!

justinknguyen commented 6 months ago

closed due to inactivity