talonvoice / beta

Issue tracker for the private Talon Beta
10 stars 0 forks source link

Command drag doesn't show dragging without eye tracker (Mac OS Mojave) #81

Open DJA89 opened 4 years ago

DJA89 commented 4 years ago

To reproduce, using only a mouse or touchpad (without eye tracker) do the following: Place your cursor on a window's title bar, say the command "drag", move your cursor to a different place, say the command "drag".

I would expect it to move the window while I'm moving my cursor like it would were I pressing the mouse's button while dragging.

What I see is that the window does not move at all and I have no indication that it's working (or not), but after I issue the second "drag" command the window instantly moves to where the cursor is as if I had been dragging it all along.

lunixbochs commented 4 years ago

This script can fix it I think:

from talon import ctrl, tap

def on_move(typ, e):
    buttons = ctrl.mouse_buttons_down()
    if not e.flags & tap.DRAG and buttons:
        e.flags |= tap.DRAG
        e.button = buttons[0]
        e.modify()

tap.register(tap.MMOVE | tap.HOOK, on_move)
knausj85 commented 3 years ago

FYI, this workaround doesn't seem to work anymore.

I tried the below on 0.1.2-111 & Big Sur (11.0.1) since I have clickless mouse thingy I use from time to time.

if app.platform == "mac":
    from talon import tap

    def on_move(e):
        buttons = ctrl.mouse_buttons_down()
        if not e.flags & tap.DRAG and buttons:
            e.flags |= tap.DRAG
            #buttons is a set now
            e.button = next(iter(buttons))
            e.modify()

    tap.register(tap.MMOVE | tap.HOOK, on_move)