The present invention relates to a touch-controlled electronic apparatus and a touch control method thereof; and more particularly to an electronic apparatus having a touch screen and a touch control method thereof.
Following the introduction of the iPhone into market by Apple, Inc. in 2007 and the introduction of the Windows 7 into market by Microsoft Corporation in 2009, the technique of touch screen once again attracts the attention of people at every corner in the world. As a result, the application of touch gestures is now gradually known and accepted among users.
Currently, the Windows CE series are operating systems developed by Microsoft Corporation particularly for the embedded platform. The Windows CE series are characterized in their small volume and fast booting time, and can therefore be used with systems that have a central processing unit having relatively low computing performance and a relatively small memory.
Products in the Windows CE series earlier than Windows CE 5.0 and Windows Embedded CE 6.0 R3 do not support the touch gesture function on a touch screen. However, since it brings users with great convenience and fun in using electronic apparatus, the touch gesture function is currently implemented by mounting it onto the Graphics, Windowing and Events Subsystem (GWES). In other words, it is the touch driver of the GWES that obtains touch points created in a slide movement according to the user's touch gesture on the touch screen and then computes the sliding direction and speed. The above design has the following disadvantages:
(1) The touch driver will largely filter the touch points on the touch screen. Therefore, there are times the touch points sent to the GWES are not sufficient for the application programs at an upper layer to compute the slide movement direction and speed.
(2) The application programs obtain the touch points via the GWES instead of directly from the touch driver. Therefore, the efficiency in computing and performing corresponding operations is low.
(3) Since the application programs of different operating system versions have different ways of recognizing and implementing touch gestures, there is no way for uniformly defining the behaviors and standards of touch gestures.
A primary object of the present invention is to provide a touch-controlled electronic apparatus and a touch control method thereof.
To achieve the above and other objects, the touch control method according to the present invention is applicable to a touch-controlled electronic apparatus having a touch screen and a control module electrically connected to the touch screen, and includes the following steps: using the control module to define a coordinate system based on the touch screen, the coordinate system presetting a plurality of directions, and an angle contained between each of the directions and an coordinate axis of the coordinate system being defined as a first angular value; using the touch screen to detect a plurality of touch points at where an object touches the touch screen; using the control module to compute an angle contained between each of any two adjacent touch points and the coordinate axis of the coordinate system to obtain a plurality of second angular values; computing an average of the plural second angular values to obtain a representative angular value; computing a movement speed of the object based on a distance difference and a time difference between any two adjacent touch points; using the control module to determine whether the representative angular value matches any one of the first angular values of the coordinate system; and in the case the representative angular value matching one of the plural first angular values of the coordinate system, using the control module to generate a control signal based on the movement speed and the representative angular value.
In the present invention, the coordinate system includes two coordinate axes, namely, an x-axis and a y-axis. And, the step of computing the second angular values of any two adjacent touch points further includes the following steps: queuing the touch points in the sequence of timestamps of the touch points; and computing the plural second angular values based on an x-axis difference and a y-axis difference between any two adjacent touch points.
The step of computing the representative angular value further includes the following steps: excluding the largest and the smallest one of the second angular values, and computing the average of the remaining second angular values to obtain the representative angular value.
In the present invention, the touch screen is selected from the group consisting of a capacitive touch screen, a resistive touch screen, and an infrared touch screen.
To achieve the above and other objects, the touch-controlled electronic apparatus according to the present invention includes a touch screen and a control module electrically connected to the touch screen. The control module includes a coordinate processing unit, a direction recognition unit, and a speed unit. The coordinate processing unit defines a coordinate system based on the touch screen, the coordinate system has a plurality of preset directions, and an angle contained between each of the plural directions and a coordinate axis of the coordinate system is defined as a first angular value, so that a plurality of different first angular values are defined. The direction recognition unit computes an angle contained between each of any two adjacent touch points and the coordinate axis to obtain a plurality of second angular values, and computes an average of the plural second angular values to obtain a representative angular value. The speed unit computes a movement speed of the object based on a distance difference and a time difference between any two adjacent ones of the plural touch points. When the representative angular value matches any one of the plural first angular values as preset in the coordinate system for the plural directions, the control module generates a control signal based on the representative angular value and the movement speed.
In the present invention, the direction recognition unit queues the touch points in the sequence of timestamps thereof, and then computes the plural second angular values based on an x-axis difference and a y-axis difference between any two adjacent touch points.
In computing the second angular values, the direction recognition unit excludes the largest and the smallest one of the plural second angular values and then computes an average of the remaining second angular values to obtain the representative angular value.
In an embodiment of the present invention, the coordinate system includes two coordinate axes, namely, an x-axis and a y-axis, and is a relative coordinate system.
In another embodiment of the present invention, the coordinate system includes two coordinate axes, namely, an x-axis and a y-axis, and is an absolute coordinate system.
In the present invention, the touch screen can be a capacitive touch screen, a resistive touch screen, or an infrared touch screen.
With the above arrangements, the touch-controlled electronic apparatus and the touch control method thereof according to the present invention is advantageous in that:
The control module generates the control signal based on the object movement speed on the touch screen and the representative angular value, so that the touch screen executes operations corresponding to the control signal and enables a user to perform touch control at an increased speed.
The structure and the technical means adopted by the present invention to achieve the above and other objects can be best understood by referring to the following detailed description of the preferred embodiments and the accompanying drawings, wherein
Please refer to
Please refer to
Accordingly, the touch-controlled electronic apparatus 1 of the present invention can operate and compute at an increased rate. Further, since it is not necessary to filter and sample the touch points with the GWES 23, the touch gesture can be recognized in upgraded efficiency. Meanwhile, the problem of differently defined touch gesture behaviors and standards among different operating systems can be solved, so that the gesture behaviors can be actively and flexibly defined according to customer's actual need.
Please refer to
Δyi=(Aiy−A(i−1)y);
Δxi=(Aix−A(i−1)x);
where, Δxi is an x-axis difference, and Δyi is a y-axis difference.
In the Windows CE operating system, the second angular value Anglei of the contained angle is computed using the following function:
Anglei=α tan 2(Δyi, Δxi);
To minimize the error, the direction recognition unit 111 will exclude the largest angular value Anglem and the smallest angular value Anglen in the process of computing the average of the second angular values to obtain a representative angular value AverageAngle, as expressed below:
AverageAngle=(Angle1+Angle2+ . . . +Anglei−Anglem−Anglen)/(i−3);
Thereafter, the direction recognition unit 111 determines whether the representative angular value AverageAngle matches the first angular value of any one of the eight directions defined by the coordinate processing unit 110. In the case the representative angular value AverageAngle matches the first angular value of one of the eight directions, the speed unit 112 will compute a finger movement speed Δvi using the following formulas:
Δsi=Δxi*Δxi+Δyi*Δyi;
Δti=Δti−Δt(i−1);
Δvi=sqrt(Δsi)/Δti;
where, Δsi is a distance difference between any two adjacent touch points, and Δti is a time difference between any two adjacent touch points.
To minimize the error, the largest speed Δm and the smallest speed Δvn are excluded in computation, so as to obtain an average speed AverageSpeed, as expressed in the following formula:
AverageSpeed=(Δv1+Δv2+ . . . +Δvi−Δvm−Δvn)/(i−2);
Finally, the control module 11 generates a control signal as a function of the average speed AverageSpeed and the representative angular value AverageAngle:
PostMessage(HWND_BROADCAST, WM_TOUCH_GESTURE, TGesture.Angle, TGesture.Speed);
When the application program 24 receives the control signal, it will execute operations corresponding to the control signal.
Please refer to
Please refer to
Please refer to
Please refer to
S21: using a control module to define a coordinate system based on a touch screen. The coordinate system includes two coordinate axes, namely, an x-axis and a y-axis, and further defines a plurality of directions, each of which corresponds to one of a plurality of different first angular values.
S22: using the touch screen to detect a plurality of touch points at where an object touches the touch screen. The touch screen can be a capacitive touch screen or a resistive touch screen.
S23: using the control module to compute an angle between each of any two adjacent touch points and one of the two coordinate axes of the coordinate system to obtain a plurality of second angular values.
The step S23 of computing the second angular values of any two adjacent touch points further includes the following steps: queuing the touch points in the sequence of the timestamps of the touch points; and computing a plurality of second angular values based on an x-axis difference and a y-axis difference between any two adjacent touch points.
S24: computing an average of the plural second angular values to obtain a representative angular value.
S25: computing a movement speed of the object based on a distance difference and a time difference between any two adjacent touch points.
S26: using the control module to determine whether the representative angular value matches any one of the first angular values of the coordinate system. If the representative angular value matches one of the first angular values of the coordinate system, the method goes to a step S27; or if not, the method goes to the step S22.
S27: using the control module to generate a control signal based on the movement speed and the representative angular value.
S28: the touch screen executing operations corresponding to the control signal.
The step S24 of computing the representative angular value further includes the following steps: excluding the largest and the smallest one of the second angular values, and computing the average of the remaining second angular values to obtain the representative angular value.
In brief, the touch-controlled electronic apparatus uses the touch screen thereof to detect touch points on the touch screen, and uses the control module to compute the object movement direction and speed based on the touch points, so that an application program can be used to directly execute corresponding operations. Therefore, the operating process in the prior art that must be performed via the GWES is simplified to allow users to operate the touch-controlled electronic apparatus in a highly efficient manner.
The present invention has been described with some preferred embodiments thereof and it is understood that many changes and modifications in the described embodiments can be carried out without departing from the scope and the spirit of the invention that is intended to be limited only by the appended claims.
Number | Date | Country | Kind |
---|---|---|---|
099122767 | Jul 2010 | TW | national |