Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: "Key" commands end up with key being "held down" #323

Open
2 of 4 tasks
addrum opened this issue Jul 4, 2023 · 9 comments
Open
2 of 4 tasks

Bug: "Key" commands end up with key being "held down" #323

addrum opened this issue Jul 4, 2023 · 9 comments

Comments

@addrum
Copy link

addrum commented Jul 4, 2023

Describe the bug
I'm using the button entity created by a "key" command in HASS Agent on a Home Assistant dashboard. When I press said button it sends they key command correctly however it then appears to be continually sending it, almost like holding the key down on a real keyboard. Not 100% sure if this is a Home Assistant issue or not but I don't have issues with non HASS Agent Home Assistant buttons triggering more than once so I think it's something here.

To Reproduce
Steps to reproduce the behavior:

  1. Add a "key" command with the "button" entity type
  2. Add the button in Home Assistant to a dashboard
  3. Press the button on the dashboard

Expected behavior
A single key press to happen per press of the button on the dashboard.

Screenshots
If applicable, add screenshots to help explain your problem.

Misc info (please complete the following information):

  • Windows build (ideally screenshot/info of winver.exe output):
    image

  • Windows' UI language: English UK

  • HASS.Agent version: 2022.14.0

Please check what's applicable (multiple answers possible):

  • Installed via installer
  • Installed manually
  • Problem occurs in HASS.Agent
  • Problem occurs in Satellite Service

Additional context
Add any other context about the problem here.

Logs
If possible, please provide the logs of HASS.Agent and - if applicable - the Satellite Service. You can find HASS.Agent's logs by going to the main window, then Configuration -> Logging -> open logs folder. The Satellite Service's logs are in the same window, but the Satellite Service tab -> open service logs folder. If you want, you can mail them to lab02research@outlook.com

@addrum
Copy link
Author

addrum commented Jul 4, 2023

This is weirdly working in a notepad window but whenever I have steam big picture open and try to use it in a game it gets stuck 🤔

@addrum
Copy link
Author

addrum commented Jul 4, 2023

Some logs :)

[2023-07-04] HASS.Agent_20230704.log

@amadeo-alex
Copy link

I've been able to reproduce this on staging-main branch.
Executing the command on notepad++ works as expected but doing the same with Steam BigPicture results in behaviour described by you.
I wouldn't go (yet) so far as to say it's HASS.Agent's fault as it's using Windows API for key emulation but that's an improper behaviour nevertheless - I'll look into it.

@amadeo-alex
Copy link

amadeo-alex commented Jul 5, 2023

Yeah, looks like we're not doing it properly - missing "KEYEVENTF_KEYUP".
Now that I think about it...I had some strange behaviour when trying to wake PC with windows key, thinking about it I should have connected the dots that this was the issue...

@sfortis
Copy link

sfortis commented Jul 14, 2023

Same problem here with media keys.

I've an automation running what sends a media player command when the mic is open for a webcall and always my 'Alt" key is stuck after the agent sends the command! Its very annoying!

service: media_player.media_stop
data: {}
target:
entity_id: media_player.hassagent

Actually whatever media player command hass agent executes, alt key is always stuck and i need to press the alt 2-3 times to recover my keyboard.

@addrum
Copy link
Author

addrum commented Sep 12, 2023

When can we expect this in a new version?

@Dustinhoefer
Copy link

+1

@AJolly
Copy link

AJolly commented Feb 26, 2024

Silly q, but wahts the easiest way for me to run the beta hass-agent/HASS.Agent#1 since it says it fixes this problem?

@addrum
Copy link
Author

addrum commented Feb 26, 2024

Silly q, but wahts the easiest way for me to run the beta hass-agent/HASS.Agent#1 since it says it fixes this problem?

The issue you've linked is a different repo. If you to that repo and find the releases section you can grab the installer. I think there's some migration instructions in the readme to follow first though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants