|
-
Dec 17th, 2008, 05:07 PM
#1
Thread Starter
Member
[RESOLVED] Touchscreen Does Not Respond to Touch
Hi all,
We have an issue here at work that I've been tasked with finding a solution for and I don't know where to begin. We're running a VB.NET 1.1 application on Windows CE.net 4.2. User input is through a touchscreen. Every now and again (very infrequently) the system will not respond to a touch and will continue to be unresponsive until the system is rebooted. The "welcome screen" (hi there, user, press here to begin kind of thing) has a picturebox (pbWelcome) that runs the entire width and height of the screen and the pbWelcome_Click event is what fires off the whole data collection process. This is the event that I feel is not firing. I know the system is still running because I'm still getting log entries and can even see where they rebooted the system because it was unresponsive.
My question is this.... I know the actual firing of the click event is beyond my control, right? ( I believe either the VB runtime or Windows would handle that, right?) But is there some way that I could know that the user is trying to touch the screen but it's not responding?
Thanks! I'm new here (been lurking for a few days) so if I'm saying anything stupid or not giving enough info, please let me know. Thanks in advance for the help!
-
Dec 17th, 2008, 07:32 PM
#2
Re: Touchscreen Does Not Respond to Touch
This certainly sounds like a hardware issue, but since it is a touchscreen you have lots of real estate you can work with. Would it be possible for you to have some unobtrusive square on the screen (perhaps a button in flat style with no border and no text) that would change color when touched? If you are doubting that the touches are even working, something like that would give you visual feedback that touch events are being raised. If the button doesn' change color, then the events are not happening.
Having said that, I wouldn't spend a great deal of time on it, but rather, just do something quick, because if you are having a hardware issue, then you just need to determine that.
Since you mention a whole bunch of processes, the other possibility is that the whole system is being dragged down for some reason. You might get at that with a small region that is cycling through color. If the color stops cycling, then it isn't just touches that are failing.
My usual boring signature: Nothing
 
-
Dec 18th, 2008, 02:40 AM
#3
Frenzied Member
Re: Touchscreen Does Not Respond to Touch
You'll find you get a better response if you use the MouseDown event instead of the Click event. Don't know why though. But I've run into this type of thing before.
You'll also get a much faster response if you write you own control and fire a custom event on MouseDown and then pick up the event using a runtime added handler even if the control in question exists during design time; i.e. "AddHandler MyControl.MouseDown..." instead of "...Handles MyControl.MouseDown". Again, I don't know why but it works faster.
-
Dec 18th, 2008, 10:17 AM
#4
Thread Starter
Member
Re: Touchscreen Does Not Respond to Touch
Thanks guys ... definitely gives me some ideas to try.
FourBlades, I think I have an idea of how I would add a handler as opposed to using the "handles MyControl.MouseDown", but I'm not 100% sure I understand. Can you point me towards some type of tutorial or something that discusses the two? If not, no big deal... I can google it and see what I find. But if you have something handy I'd appreciate it.
-
Dec 18th, 2008, 12:25 PM
#5
Re: Touchscreen Does Not Respond to Touch
Are the hardware buttons responding? Your issue can be some mixed up focus thing where the form remains on top but is no longer in focus.
-
Dec 18th, 2008, 01:41 PM
#6
Thread Starter
Member
Re: Touchscreen Does Not Respond to Touch
 Originally Posted by Half
Are the hardware buttons responding? Your issue can be some mixed up focus thing where the form remains on top but is no longer in focus.
No hardware buttons on this unit, but the form not being in focus is something I'll have to figure out how to check because the action (or lack thereof) does fit that scenario... although I don't know how it would lose focus. Definitely something to look at. Thanks.
-
Dec 18th, 2008, 01:48 PM
#7
Re: Touchscreen Does Not Respond to Touch
Then maybe you can use a timer to bring the form in focus every second or so...if this is the problem of course. Or use a timer to check the focused state and write it to a log.
A hardware problem is still on the table btw.
-
Dec 18th, 2008, 05:25 PM
#8
Thread Starter
Member
Re: Touchscreen Does Not Respond to Touch
 Originally Posted by Half
Then maybe you can use a timer to bring the form in focus every second or so...if this is the problem of course. Or use a timer to check the focused state and write it to a log.
A hardware problem is still on the table btw.
I'll do both.. write it to a log first and then bring it back into focus. And yes, I believe it's probably a hardware issue. But it's difficult to convince the engineers of that.
Thanks for all the help guys! You guys are wonderful!!
-
Dec 19th, 2008, 01:20 AM
#9
Frenzied Member
Re: Touchscreen Does Not Respond to Touch
Was gone all day...
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
AddHandler Button1.MouseDown, AddressOf OtherPlaceToMonitorButtonOneMouseDown
End Sub
Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown
'You can monitor for the MouseDown event here
MessageBox.Show("Handles MouseDown")
End Sub
Private Sub OtherPlaceToMonitorButtonOneMouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
'Or you can monitor for the MouseDown event here.
MessageBox.Show("Added Handler for MouseDown")
End Sub
Private Sub Form1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LostFocus
'Instead of polling every second or so to see if the form lost focus,
'just monitor this event instead.
End Sub
End Class
-
Dec 19th, 2008, 01:44 AM
#10
Re: Touchscreen Does Not Respond to Touch
 Originally Posted by FourBlades
Was gone all day...
Code:
Public Class Form1
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
AddHandler Button1.MouseDown, AddressOf OtherPlaceToMonitorButtonOneMouseDown
End Sub
Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown
'You can monitor for the MouseDown event here
MessageBox.Show("Handles MouseDown")
End Sub
Private Sub OtherPlaceToMonitorButtonOneMouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
'Or you can monitor for the MouseDown event here.
MessageBox.Show("Added Handler for MouseDown")
End Sub
Private Sub Form1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LostFocus
'Instead of polling every second or so to see if the form lost focus,
'just monitor this event instead.
End Sub
End Class
From the documentation for the LostFocus event:
The GotFocus and LostFocus events are low-level focus events that are tied to the WM_KILLFOCUS and WM_SETFOCUS Windows messages. Typically, the GotFocus and LostFocus events are only used when updating UICues or when writing custom controls. Instead the Enter and Leave events should be used for all controls except the Form class, which uses the Activated and Deactivate events. For more information about the GotFocus and LostFocus events, see the WM_SETFOCUS and WM_KILLFOCUS topics in the "Keyboard Input Reference" section of the Platform SDK Documentation in the MSDN library at http://msdn.microsoft.com/library.
-
Dec 20th, 2008, 05:00 AM
#11
Frenzied Member
Re: [RESOLVED] Touchscreen Does Not Respond to Touch
Good info, jm, thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|