-
Notifications
You must be signed in to change notification settings - Fork 75
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
Double click not working (Kaldi, OSX) #368
Comments
Hello Denver, Thank you for reporting this problem. It is indeed a bug with the library. It looks like scrolling is broken on macOS too. I'll have both fixed in the next version. That may be some time off, however. In the meantime, the following code will allow you to double click: from dragonfly import MappingRule, CompoundRule, Function
# pynput is the input library Dragonfly uses on macOS and should
# be installed already.
from pynput.mouse import Controller, Button
controller = Controller()
def left_click(n):
controller.click(Button.left, n)
# Invoke the `left_click' function when "double click" is spoken.
# With a `MappingRule',
class DoubleClickRule1(MappingRule):
mapping = {
"double click": Function(lambda: left_click(2)),
}
# or `CompoundRule'.
class DoubleClickRule2(CompoundRule):
spec = "double click"
def _process_recognition(self, node, extras):
left_click(2) Triple click is broken too. Invoke the Hope this helps! |
Thanks @Danesprite 👍 |
No problem. I should have these bugs fixed soon. |
Re: #368. The Mouse action class can now be used to double/triple click, and scroll the mouse wheel, on macOS.
Re: #368. The Mouse action class can now be used to double/triple click, and scroll the mouse wheel, on macOS.
This is fixed on the master branch. There is one limitation though. Double-click and triple-click will only work when the repeat syntax is used: {
"double click": Mouse("left:2"),
"triple click": Mouse("left:3")
} The following will not work properly on macOS: Mouse("left, left").execute()
Mouse("left, left, left").execute() I'll make another comment, and close this issue, after the next release version is out. |
Single click Mouse actions work great, however I cannot get a double click to work. For example, I'd like to hover the cursor over a word and use the double click action to select it. This seems like a bug to me, but maybe I'm doing something wrong.
I've tried many variations, like adding a pause, or chaining two single click mouse actions together, but nothing seems to do the trick. There is no error in the console either.
I use Kaldi engine and I'm on macOS Monterey Version 12.4 (Macbook pro)
Thanks for the help.
The text was updated successfully, but these errors were encountered: