You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: force touch action without normal click #45
I have the "Force touch with one finger" gesture set up trigger a middle mouse click. It looks like Multitouch is sending a normal click event followed by a force touch event.
Any way to prevent the normal click event from being sent? My use case is using force touch as middle click, to open links in new tabs in Firefox.
changed the title [-]Feature request: torce touch action without normal click[/-][+]Feature request: force touch action without normal click[/+]on Jun 13, 2019
In order to prevent the normal click from being sent for this gesture, Multitouch would have to intercept all clicks on the trackpad and wait to see if a force touch follows each one before programmatically executing a click after some specified delay if no force touch occurs. If the delay is too long, then normal mouse clicks - particularly mouse down, would be noticeably delayed. If the delay is too short, the force touch has to be executed really quickly after the initial click (this might not be an issue for most people). My initial thought has always been that it wouldn't be possible to get the delay right, and that any amount of delay would produce noticeable lag at a certain point.
With all that said, the proper path forward may just be to remove click actions or specifically the middle click action as a possible option for this gesture. I left them all in because they might still be of use depending on the applications a user has, but middle click for browsers would most likely be the common choice here. I'll revisit the timing of intercepting clicks though, to be sure what the best user experience would be.
Ah, I see. Thanks for the explanation. I think you're right that delaying normal clicks to see if they're followed by a force touch is probably not going to work well. I'd be happy to try out any test releases you might make as you're experimenting. In the mean time I'm going to try to kludge force touch support into Firefox. 😆
Just playing around a bit, I think my use case could be satisfied by mapping 1-finger force touch to a "click with command key down" action. Firefox maps ⌘Click to Open Link in New Tab, and it checks for the command key on mouseUp, not mouseDown. So what about adding an option to send click events with a modifier key down?
As you might suspect, I did not include the left clicks (with modifiers) as available actions for reasons similar to what you're experiencing with the middle click. A force touch means that you have a human executed mouse down and if additional programmatic mouse clicks are executed on top of that human executed left mouse down, then there's some pretty jenky mouse click behavior. A while back, I looked into executing a programmatic mouse up followed by another mouse down/up upon force touch, but the jenky behavior still persisted.
There is something else I could try that might work, but might still have strange behavior: executing a programmatic mouse up with modifier when the force touch occurs. Since links are opened in Firefox (and other browsers) on mouse up, this theoretically should work. I'll post back when I get a chance to test it out.
Alright, I tried out the programmatic mouse up with cmd modifier on force touch, and this worked for opening links in a new tab on both Firefox and Chrome. It's in the v1.13.4 beta. Let me know when you get a chance to try it out and if it works for you.
This is one of the few actions that I would consider adding in some functionality to make it so this only occurs when firefox or chrome are frontmost, but that's not an easy thing to communicate in the UI since it's specific to a single gesture/action combination. I'll put a task on my backlog to come back to it another time and see if there's an elegant way to do it.
Still working great, @rxhanson! However, it only works for links. In firefox, middle-click on a tab header closes the tab, but cmd-click doesn't. So I'm wondering if you can revisit this one and see if a proper middle-click event can be sent.
Alright, this is now in v1.15. I made it a new click action, called Force Touch Middle Click, so you'll have to configure the gesture to this new action. Let me know if it works as you'd expect when you get a chance to try it out.
Activity
[-]Feature request: torce touch action without normal click[/-][+]Feature request: force touch action without normal click[/+]rxhanson commentedon Jun 14, 2019
In order to prevent the normal click from being sent for this gesture, Multitouch would have to intercept all clicks on the trackpad and wait to see if a force touch follows each one before programmatically executing a click after some specified delay if no force touch occurs. If the delay is too long, then normal mouse clicks - particularly mouse down, would be noticeably delayed. If the delay is too short, the force touch has to be executed really quickly after the initial click (this might not be an issue for most people). My initial thought has always been that it wouldn't be possible to get the delay right, and that any amount of delay would produce noticeable lag at a certain point.
With all that said, the proper path forward may just be to remove click actions or specifically the middle click action as a possible option for this gesture. I left them all in because they might still be of use depending on the applications a user has, but middle click for browsers would most likely be the common choice here. I'll revisit the timing of intercepting clicks though, to be sure what the best user experience would be.
smammy commentedon Jun 14, 2019
Ah, I see. Thanks for the explanation. I think you're right that delaying normal clicks to see if they're followed by a force touch is probably not going to work well. I'd be happy to try out any test releases you might make as you're experimenting. In the mean time I'm going to try to kludge force touch support into Firefox. 😆
smammy commentedon Jun 14, 2019
Just playing around a bit, I think my use case could be satisfied by mapping 1-finger force touch to a "click with command key down" action. Firefox maps ⌘Click to Open Link in New Tab, and it checks for the command key on mouseUp, not mouseDown. So what about adding an option to send click events with a modifier key down?
smammy commentedon Jun 14, 2019
(I see that "⌘-click" is an option for the three-finger click trigger, but not for force touch click triggers.)
rxhanson commentedon Jun 14, 2019
As you might suspect, I did not include the left clicks (with modifiers) as available actions for reasons similar to what you're experiencing with the middle click. A force touch means that you have a human executed mouse down and if additional programmatic mouse clicks are executed on top of that human executed left mouse down, then there's some pretty jenky mouse click behavior. A while back, I looked into executing a programmatic mouse up followed by another mouse down/up upon force touch, but the jenky behavior still persisted.
There is something else I could try that might work, but might still have strange behavior: executing a programmatic mouse up with modifier when the force touch occurs. Since links are opened in Firefox (and other browsers) on mouse up, this theoretically should work. I'll post back when I get a chance to test it out.
smammy commentedon Jun 14, 2019
That makes sense. Good luck and let me know when you have something ready to test. :)
rxhanson commentedon Jun 15, 2019
Alright, I tried out the programmatic mouse up with cmd modifier on force touch, and this worked for opening links in a new tab on both Firefox and Chrome. It's in the v1.13.4 beta. Let me know when you get a chance to try it out and if it works for you.
This is one of the few actions that I would consider adding in some functionality to make it so this only occurs when firefox or chrome are frontmost, but that's not an easy thing to communicate in the UI since it's specific to a single gesture/action combination. I'll put a task on my backlog to come back to it another time and see if there's an elegant way to do it.
smammy commentedon Jun 21, 2019
Thanks! I've been busy but will try it as soon as I can!
smammy commentedon Jun 21, 2019
This works perfectly for my use case. Thanks!
rxhanson commentedon Jun 21, 2019
Awesome! Thanks for testing it out and getting back to me.
smammy commentedon Jun 27, 2019
Still working great, @rxhanson! However, it only works for links. In firefox, middle-click on a tab header closes the tab, but cmd-click doesn't. So I'm wondering if you can revisit this one and see if a proper middle-click event can be sent.
rxhanson commentedon Jun 27, 2019
Off the top of my head, I think this should work. I'll see if I can roll it into my next release.
rxhanson commentedon Jun 29, 2019
Alright, this is now in v1.15. I made it a new click action, called Force Touch Middle Click, so you'll have to configure the gesture to this new action. Let me know if it works as you'd expect when you get a chance to try it out.
smammy commentedon Jul 3, 2019
v1.15 works great for Firefox. Thanks!
smammy commentedon Jul 3, 2019
Oh, also, I'm glad you decided to extend it to all apps... being able to middle-click in iTerm again is great!
rxhanson commentedon Jul 3, 2019
Thanks for trying it out and letting me know!