|
Rank: Member Groups: Member
Joined: 9/3/2015 Posts: 19
|
I am writing a WinForm application which connected to a web service that designed for touch-input devices(iPad/Smartphones). The website listens to touch events and do corresponding actions, sample HTML codes: Quote:<a data-ajax="false" onclick="return false;" data-bind="event: {'tap': function (value) {$...... It works on normal touch-based devices, however when I load the same page using EO WebBrowser to my WinForm, the page won't work because a normal PC only generates Mouse_Click events. Can I transform those Mouse_Click events to Touch events(i.e. Click -> Tap) in order to make the page function as usual in a WinForm environment?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi,
You can't translate these events. In the latest version, if the OS supports touch and your hardware supports touch, then touch events will be automatically generated. Otherwise they will not be generated.
Thanks!
|
|
Rank: Member Groups: Member
Joined: 9/3/2015 Posts: 19
|
Then can I generate a Touch event given mouse's current position? (simulate a touch)
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
ChiYuen wrote:Then can I generate a Touch event given mouse's current position? (simulate a touch) No. We do not provide any way for you to simulate touch event.
|
|
Rank: Member Groups: Member
Joined: 9/3/2015 Posts: 19
|
I found a way to simulate touch at system level. However, I can't stop mouse Click events from passing into the web browser/web page.
I can stop the event for normal WinForm controls by using IMessageFilter and capture WM_LBUTTONDOWN , however, when the EO WebControl is active and mouse is inside, the MessageFilter didn't get any messages.
Any way to filter and stop mouse click events from passing into the web control component?
i.e. What I want to do is to capture mouse action at system level, once found the Cursor is inside my form, I would like to stop all mouse_click/down/up events and then use TouchInjector to simulate touches.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
You should not do that. The product is not designed for this, so you should not do it and we won't support it. The only situation the browser engine will get touch events is when both your OS and the hardware supports it. No other cases are supported.
|
|
Rank: Member Groups: Member
Joined: 9/16/2015 Posts: 18
|
Hi, try this http://hammerjs.github.io/touch-emulator/1. download touch-emulator.js 2. modify : function hasTouchSupport() { return false; } 3. webview.JSInitCode = js source + "TouchEmulator();"
|
|
Rank: Member Groups: Member
Joined: 9/3/2015 Posts: 19
|
Hello CLEARSOFT,
Thanks! The script looks good, I will have it a try later!
I am currently using TouchInjection(https://code.msdn.microsoft.com/windowsapps/TouchInjection-on-Windows-885150d2) which is supported on >=Win8 systems. I capture keyboard events to simulate touch (cuz I still wanna keep the Click events). e.g. F2 key down-> start touch on current cursor point, mouse move -> touch move, F2 key up -> end touch. Tried on some touch-testing pages worked well.
|
|