# Touch input fires click event twice on Windows 10

**URL:** <https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662>\
**Category:** UI\
**Tags:** click-event, unreal-engine, touch, slate, UI, question, UMG\
**Created:** [March 22, 2017, 2:52pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662 "2017-03-22T14:52:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlekseyIlin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlekseyIlin](https://forums.unrealengine.com/u/AlekseyIlin)\
**Post date:** [March 22, 2017, 2:52pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/1 "2017-03-22T14:52:16Z")

</div>

Build Type: Unreal Launcher and from Github

Version: 4.15.1-3348071+++UE4+Release-4.15

For some reason on windows devices when button is _touched_ it fires two click events instead of one. It also calls `SButton::OnMouseButtonDown` and `SButton::OnMouseButtonUp` twice.

It can be reproduced both on real device with Windows 10 and Windows Simulator. I used blank project and simple user widget with `UButton`.

---

<div class="post-metadata">

**Author:** ![AlekseyIlin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlekseyIlin](https://forums.unrealengine.com/u/AlekseyIlin)\
**Post date:** [March 23, 2017, 2:04pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/2 "2017-03-23T14:04:00Z")

</div>

You don’t even have to run the game, the same thing happens in Editor.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [March 23, 2017, 2:10pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/3 "2017-03-23T14:10:42Z")

</div>

Hello AlekseyIlin,

After doing some digging I found a known issue with what I believe to be the same root cause. I have provided a link below to the public tracker. Please feel free to use the link provided for future updates.

Link: [Unreal Engine Issues and Bug Tracker (UE-22105)](https://issues.unrealengine.com/issue/UE-22105)

Make it a great day

---

<div class="post-metadata">

**Author:** ![AlekseyIlin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlekseyIlin](https://forums.unrealengine.com/u/AlekseyIlin)\
**Post date:** [March 23, 2017, 2:39pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/4 "2017-03-23T14:39:25Z")

</div>

It says “Unknown Issue”

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [March 23, 2017, 3:59pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/5 "2017-03-23T15:59:29Z")

</div>

I have pushed it to public. It should be available now.

---

<div class="post-metadata">

**Author:** ![AlekseyIlin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlekseyIlin](https://forums.unrealengine.com/u/AlekseyIlin)\
**Post date:** [March 26, 2017, 8:13am UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/6 "2017-03-26T08:13:40Z")

</div>

Bug can be reproduced on 4.8, so I don’t think this bug and UE-22105 have the same root cause

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [March 27, 2017, 4:38pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/7 "2017-03-27T16:38:08Z")

</div>

Hello AlekseyIlin,

I have a few questions for you that will help narrow down what issue it is that you are experiencing.

Quick questions:

1. Can you reproduce this issue in a clean project?
2. If so, could you provide a detailed list of steps to reproduce this issue on our end?
3. Could you provide screen shots of any settings/blueprints/widgets that may be involved with this issue?

---

<div class="post-metadata">

**Author:** ![AlekseyIlin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlekseyIlin](https://forums.unrealengine.com/u/AlekseyIlin)\
**Post date:** [March 28, 2017, 11:41am UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/8 "2017-03-28T11:41:41Z")

</div>

After checking once again I discovered that bug can’t be reproduced on 4.8, but also it can’t be reproduced on 4.9 and all later versions until 4.13.  
Windows Multitouch was added in 4.14 and it, in my opinion, broke the touch event.

As for questions:  
1 . Yes, it can be reproduced in a clean project, as I said before you don’t even have to launch the game to reproduce the bug

2 . Launch windows simulator or windows 10 with touch screen, open editor with 4.15 version, touch any dropdown button, it will do nothing because click happens twice, so it opens and then immediately closes the dropdown. Alternatively you can create user widget with button add Print String to OnClicked event, then add it to the viewport (exact level blueprint used:

[http://i.imgur.com/BZ7i3CN.png](http://i.imgur.com/BZ7i3CN.png)

). When you run the game and touch the button it will print the message twice

3 . I don’t think any particular widget is to blame, I think it has something to do with the way windows fires its input events: when user touches the screen it every time fires these events in this order:  
Touch started  
Touch ended  
Left mouse button down  
Left mouse button up  
Before 4.14 windows touch events weren’t handled but now they are. Simple workaround I found (I don’t know how well it works yet) is to not handle mouse events while touch hasn’t ended (had to change engine source code for that)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [March 28, 2017, 5:09pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/9 "2017-03-28T17:09:42Z")

</div>

Thank you for the additional information. You were correct, The first issue that I linked was incorrect. After doing some digging I was able to find a report that shows the exact issue that you have reported here. I have provided a link below

Link: [Unreal Engine Issues and Bug Tracker (UE-43213)](https://issues.unrealengine.com/issue/UE-43213)

Make it a great day

---

<div class="post-metadata">

**Author:** ![Zeclown](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zeclown](https://forums.unrealengine.com/u/Zeclown)\
**Post date:** [March 28, 2017, 5:15pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/10 "2017-03-28T17:15:05Z")

</div>

Hey! I’m having the same problem. At what point do you intercept the input call and block it? In PlayerController.Cpp?

---

<div class="post-metadata">

**Author:** ![AlekseyIlin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlekseyIlin](https://forums.unrealengine.com/u/AlekseyIlin)\
**Post date:** [March 28, 2017, 6:19pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/11 "2017-03-28T18:19:33Z")

</div>

You have to dive a bit deeper and intercept it in FSlateApplication, and for that you need to build engine from source code. I’ll post my workaround later

---

<div class="post-metadata">

**Author:** ![ZhymonNorman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zhymonnorman/32/1008863_2.png) [@ZhymonNorman](https://forums.unrealengine.com/u/ZhymonNorman)\
**Post date:** [April 10, 2017, 3:58pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/12 "2017-04-10T15:58:02Z")

</div>

Is there a link to your workaround?

---

<div class="post-metadata">

**Author:** ![AlekseyIlin](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AlekseyIlin](https://forums.unrealengine.com/u/AlekseyIlin)\
**Post date:** [April 10, 2017, 5:30pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/13 "2017-04-10T17:30:00Z")

</div>

I made a pull request with fix, and it goes one layer deeper - straight to FWindowsApplication  
[https://github.com/EpicGames/UnrealEngine/pull/3448](https://github.com/EpicGames/UnrealEngine/pull/3448)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_8b31b095](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_8b31b095](https://forums.unrealengine.com/u/anonymous_user_8b31b095)\
**Post date:** [May 25, 2017, 2:37pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/14 "2017-05-25T14:37:01Z")

</div>

If you set `ShowMouseCursor` to false in Player Controller class defaults, event should fire only once.

---

<div class="post-metadata">

**Author:** ![Brainshack](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Brainshack](https://forums.unrealengine.com/u/Brainshack)\
**Post date:** [September 4, 2017, 8:37am UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/15 "2017-09-04T08:37:12Z")

</div>

I am still getting the same buggy behaviour on a windows 10 touch machine using 4.17.1.

---

<div class="post-metadata">

**Author:** ![TTimo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TTimo](https://forums.unrealengine.com/u/TTimo)\
**Post date:** [September 4, 2017, 9:28pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/16 "2017-09-04T21:28:43Z")

</div>

(just confirming - seeing this problem still as well)

---

<div class="post-metadata">

**Author:** ![plastik21](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@plastik21](https://forums.unrealengine.com/u/plastik21)\
**Post date:** [September 11, 2017, 1:16pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/17 "2017-09-11T13:16:36Z")

</div>

Oh ■■■■… I just wanted to convert my project to 4.17 version to get properly working touch functions ☹ Seems will have to use my hacks with delay again ☹

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [October 2, 2017, 6:19pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/18 "2017-10-02T18:19:29Z")

</div>

Hello plastik21,

After running a few tests on our end. I found that this issue is no longer occurring unless “Use Mouse for Touch” is enabled in the project settings. I would suggest ensuring that this setting is disabled. I hope that this information helps.

Make it a great day

---

<div class="post-metadata">

**Author:** ![plastik21](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@plastik21](https://forums.unrealengine.com/u/plastik21)\
**Post date:** [October 4, 2017, 9:33am UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/19 "2017-10-04T09:33:37Z")

</div>

Thanks, Rudy!

---

<div class="post-metadata">

**Author:** ![TTimo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TTimo](https://forums.unrealengine.com/u/TTimo)\
**Post date:** [October 4, 2017, 5:54pm UTC](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662/20 "2017-10-04T17:54:51Z")

</div>

I think this would still deserve to be fixed when ‘Use mouse for Touch’ is selected. We rely on the feature to support both mouse and touch interaction against the same application easily.

Now it seems our alternative is to build an abstraction and process touch and mouse on separate code paths at application level.

The API between the two is inconsistent (there is Input Touch event for ‘Moved’ but no mouse ‘Move’ event for instance, also mouse events are per button when touch events give you a finger index) … nothing impossible to work around but unfortunately more work to do for the developer.

[Next page](https://forums.unrealengine.com/t/touch-input-fires-click-event-twice-on-windows-10/388662.md?page=2)
