# Touch events for WebView

**URL:** <https://community.folivora.ai/t/touch-events-for-webview/30316>\
**Category:** Feature Requests\
**Created:** [February 12, 2023, 3:06pm UTC](https://community.folivora.ai/t/touch-events-for-webview/30316 "2023-02-12T15:06:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yw4z](https://community.folivora.ai/user_avatar/community.folivora.ai/yw4z/32/10483_2.png) [@yw4z](https://community.folivora.ai/u/yw4z)\
**Post date:** [February 12, 2023, 3:06pm UTC](https://community.folivora.ai/t/touch-events-for-webview/30316/1 "2023-02-12T15:06:12Z")

</div>

i have tried touch events on webview but i coulnt get any response

window.ontouchstart=e=\>{alert(if(e.touches.length}

tried for window, document, body and few elements

im trying to bind a function to 3 finger tap

any solution for this, thanks

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [February 12, 2023, 4:08pm UTC](https://community.folivora.ai/t/touch-events-for-webview/30316/2 "2023-02-12T16:08:18Z")

</div>

sorry, I don’t think desktop webviews support on touch events, I probably won’t be able to workaround this ;-(  
BTT does only support what Safari on macOS would

---

<div class="post-metadata">

**Author:** ![yw4z](https://community.folivora.ai/user_avatar/community.folivora.ai/yw4z/32/10483_2.png) [@yw4z](https://community.folivora.ai/u/yw4z)\
**Post date:** [February 12, 2023, 5:23pm UTC](https://community.folivora.ai/t/touch-events-for-webview/30316/3 "2023-02-12T17:23:39Z")

</div>

thanks for reply,

as an idea may be floating views can be add here

 ![Screen Shot 2023-02-12 at 20.14.16](https://community.folivora.ai/uploads/default/original/3X/2/7/27a2e52c6ac9110789bd52dc7c8096d12d9cb43c.jpeg)

so we can send 3 finger tap or other gestures as keyboard shortcuts

here is a preview from latest SWM. it almost done

[/uploads/default/original/3X/1/2/12fff31613951fd60729755d6133f57d280be317.mov](https://community.folivora.ai/uploads/default/original/3X/1/2/12fff31613951fd60729755d6133f57d280be317.mov)

i can switch / toggle between different layouts with middle click but i couldnt with trackpad

if i can set 3 finger tap on SWM as middle click, it would be great

i checked hovered/focused ui elements details but floating view has no details on there

---

<div class="post-metadata">

**Author:** ![Andreas\_Hegenberg](https://community.folivora.ai/user_avatar/community.folivora.ai/andreas_hegenberg/32/39221_2.png) [@Andreas\_Hegenberg](https://community.folivora.ai/u/Andreas_Hegenberg)\
**Post date:** [February 12, 2023, 7:55pm UTC](https://community.folivora.ai/t/touch-events-for-webview/30316/4 "2023-02-12T19:55:47Z")

</div>

Good idea. I'll add a new variable to the conditional activation group (cag) variables. "currently active floating webviews" or something like that. Then you can create a CAG for your webview and assign any gestures etc. to it.

---

<div class="post-metadata">

**Author:** ![yw4z](https://community.folivora.ai/user_avatar/community.folivora.ai/yw4z/32/10483_2.png) [@yw4z](https://community.folivora.ai/u/yw4z)\
**Post date:** [February 12, 2023, 8:07pm UTC](https://community.folivora.ai/t/touch-events-for-webview/30316/5 "2023-02-12T20:07:22Z")

</div>

thanks,

i solved temporarily like this

 ![Screen Shot 2023-02-12 at 20.48.07](https://community.folivora.ai/uploads/default/original/3X/7/b/7bcb0e81e672293e5fee4d38a5cb5c12a66e27f6.jpeg)

SWM changes variable "SWM-OP" to 1 on launch, changes to 0 on close  
3 finger tap \> middle finger action checks that variable for detection is SWM visible with advanced condition

but it has a serious bug. 3 finger tap stucks as middle finger if BTT crashes while using SWM (saw many times. but reduced last versions)

this will not be problem with your fix
