x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Linux touchscreen inactive when game launches

Greetings,

We are creating a game that does not use a mouse or keyboard, only a touchscreen. We are using Ubuntu 16.04 for the OS. I found that after cross-compiling our game on Linux and running, there was no Linux touchscreen support. So we added code to LinuxApplication.cpp using the SDL_Event library documentation and the existing mouse events that works for simple touch and swipe/drag events.

The only issue that we have now is that if we turn on the computer and boot up then launch the game without first using the touchscreen, we get no input. Once the touchscreen is "touched" just once, we can launch the game without any issue and it works fine. If we fail to touch the screen before we launch the game, however, we must quit the game and relaunch. We need to be able to launch the game after startup, so we must have the touchscreen work without first having to touch the screen.

I am looking at all options, from scripting a fake touch (not sure if this is possible) before scripting the game launch after startup of the computer, to perhaps modifying more of the engine code or possibly some of the Linux OS code. I was hoping that a post here would ilicit some good ideas or suggestions.

Cheers

Product Version: UE 4.12
Tags:
more ▼

asked Oct 27 '16 at 06:52 PM in Linux

avatar image

jonathan720
6 1 3

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

I would suggest first understanding why the issue happens and trying to fix it properly before attempting a workaround. Try figuring out if this is a SDL issue or UE4 issue, then try narrowing it down - if the bug can be reproduced in a standalone "hello touch" it would be easier to test (or, in case it is a UE4 issue, use a more lightweight SlateViewer). Once the issue is understood it'll be easier to suggest a fix (or workaround, if fixing is too hard).

more ▼

answered Oct 28 '16 at 02:17 PM

avatar image

RCL STAFF
2.7k 59 6 88

avatar image jonathan720 Oct 28 '16 at 06:50 PM

I completely agree. I have a basic blueprint only project using the Umg quickstart tutorial in the documentation that I have been using for testing. Seems its as if the code I have written to solve this issue does not run unless you touch the screen before you run the project. In other words I think either the SDL or Linux OS is sending a mouse event instead of a touch event unless you use the touchscreen in the OS first, if that makes sense.

avatar image RCL STAFF Oct 28 '16 at 07:21 PM

I'm afraid this is still not low level enough to understand the problem, at least for me. Would you mind using one of non-UE4 SDL examples to see if the same behavior is reproducible there?

If you don't have time or motivation to drill deeper, I suggest implementing whatever workaround works best for you. We don't have a Linux system with a touchscreen currently, so unfortunately it may take time to get the issue fixed on our side. Reaching out to Linux community (like you did by posting here on AnswerHub) is a valid option too; I suggest soliciting ideas on other communication channels too (UE forums, IRC - whatever you have time for).

avatar image jonathan720 Nov 01 '16 at 09:10 PM

Figured it out, at least part of the way. Unreal is not the only application that has the issue and apparently it is related to how X11 apps queue up drivers for their Virtual Master input through xinput. For more information here is the same issue using Chromium. https://bugs.chromium.org/p/chromium/issues/detail?id=439914. I am currently looking into a way to possibly repoll the application for touch inputs after the initial game launch or perhaps using the SDL framework. Not my forte by any stretch of the imagination.

avatar image RCL STAFF Nov 01 '16 at 11:15 PM

Thanks for the update! We're going to look into touchscreen support pretty soon, so this helps.

avatar image RCL STAFF Nov 02 '16 at 02:45 PM

Also, just so we know, could you share the details of hardware (a separate touchscreen or a laptop, and brand names if any) that you are testing this with?

avatar image jonathan720 Nov 02 '16 at 04:55 PM

Sure there are two machines we are testing on. We have an Acer ASPIRE Z3-715 with a USBest SiS HID Touch Controller vendor 0457 product 109f and a custom built machine that uses Ilitek Multi-Touch-V3000 vendor 222a product 004d.

avatar image RCL STAFF Nov 02 '16 at 07:57 PM

Thank you, that's good to know!

avatar image RCL STAFF Nov 02 '16 at 07:59 PM

By the way, would you be so kind to share the code you added to LinuxApplication? You can submit a pull request which is our normal way of taking submissions, or you can attach it here.

avatar image jonathan720 Nov 07 '16 at 07:07 PM

I submitted a pull request to the 4.12 branch as that is what we are currently working in: https://github.com/EpicGames/UnrealEngine/pull/2916 You'll notice I added some notes. I never had a remote debugger going between my windows box and the dev linux machines I was testing on, so I have no doubt that you might want to make some changes or refactorings if the code is something that you might want to use.

avatar image RCL STAFF Nov 07 '16 at 08:17 PM

Thank you for sharing the code. Over the last weekend I added a simpler implementation that uses Slate's OnTouch*() API. If you want to try it, I can let you know when it hits Main branch, but if you are fine with your version it is also fine.

avatar image Botanicvelious Feb 09 '17 at 09:33 PM

We are having the same issue, were you ever able to come up with a solution?

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question