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

Voice commands for list not updated if Context list is updated in a specific way #495

Closed
chaosparrot opened this issue Mar 5, 2022 · 3 comments

Comments

@chaosparrot
Copy link

Windows 10 - Talon Version: 0.2.0-357-g3b3e

This is something that came up during Talon HUD development, specifically for the following flow:

  • Bring up choice widget with 'toolkit options'
  • Close the choice widget by saying 'dismiss toolkit'
  • Reopen the choice window again by saying 'toolkit options'
  • Now the 'dismiss toolkit' voice command no longer seems to work.

What is happening in these steps is the following:

The list containing voice commands connected to choices is updated with the available choices so that they can be activated by voice. Once the choice widget is dismissed, this list is set to an empty object. When reopening again, the list is filled with all the available choices again, which are the exact same options as in the first step. I can confirm that the choices are set with a different object, but the contents are the same.

I have tested this with an empty list as well, as well as transforming the list connection in the .talon file to a capture instead. In all of these scenario's, the exact same result is achieved: The voice commands for those choices are no longer available.

I can avoid this by not setting the choices list as an empty object or list, but instead provide a single entry with a bogus voice command that does not activate anything. In this case the voice commands seem to properly activate if I repeat the steps shown above.

The HUD specifically keeps a few lists empty if there are no options available to be activated, as is the case if there is no right click menu open, or if there are no choice buttons available to activate.

@lunixbochs
Copy link

lunixbochs commented Mar 5, 2022 via email

@chaosparrot
Copy link
Author

from talon import Context, Module, actions

mod = Module()
mod.list("test_list", desc="Test list for testcase of empty - X - empty - X flow")

ctx = Context()
ctx.lists["user.test_list"] = {}

@mod.action_class
class Actions:

    def test_fill_list():
        """Fills a list for a voice command test case"""
        ctx.lists["user.test_list"] = ["voice command one", "voice command two"]
    
    def test_clear_list():
        """Clears a list for a voice command test case"""
        ctx.lists["user.test_list"] = {}

And the .talon file

-
{user.test_list}: print(test_list)
test fill list: user.test_fill_list()
test clear list: user.test_clear_list()

Voice commands to say in order to replicate:

  • test fill list
  • test clear list
  • test fill list

Expected result is that "voice command one" and "voice command two" are now active, Currently, they do not seem to be.

@lunixbochs
Copy link

fixed in 0.2.0-360, thanks!

nriley added a commit to phillco/talon-axkit that referenced this issue Mar 6, 2022
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

2 participants