Author Topic: How intercept the release key event for the "Recognition Global Hotkey"  (Read 2587 times)

Serge

  • Newbie
  • *
  • Posts: 12
Hi again,

So i have set a key in the "Recognition Global Key" with the "VoiceAttack Listens while keys are down" option.
This is to be in "push to talk" mode.

Is there a way for me to know when the key is released ?

Indeed, since it is the responsibility of the plugin to aggregate the audio files generated during the pressing of this key, I need to know when to stop the aggregation.

I could do this with a timeout after which, if I have not received any audio, I stop aggregating. But this is a solution that has significant disadvantages. If the timeout is too long, it will be a waste of time at the end of each sentence. If it is too short, the user will still be cut off in their sentence.

Thank you in advance for any responses.


« Last Edit: March 23, 2024, 10:37:55 AM by Serge »

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
There are a number of ways to accomplish that, E.G. polling the listening state or the state of the key (both of which can be done within the plugin, and thus wouldn't require any commands), or assigning a command (or two) to the same key and having it call your plugin.

Serge

  • Newbie
  • *
  • Posts: 12
Hello,

Yes thanks you very much.

I'v just find another solution by setting an action with the same key but with the option "Shortcut is invoked only when all keys are released".

Do you think it's ok to do that ? i mean, the "all keys are released" condition apply only for the involved key, as the tooltips says ?

Thanks.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
That's exactly what I was referring to by "assigning a command (or two) to the same key and having it call your plugin"

"Shortcut is invoked only when all keys are released" refers to all keys in the combination for that specific command.