Background technology
Touch screen technology is a kind of main input mode of following man-machine interaction, can eliminate input tools such as keyboard and mouse gradually, and being this field, multiple point touching (Multitouch) technology has more an attractive bright spot, but the technology that this technology uses optics that touch-screen is detected mostly, cost is too high, is that present most of user institute is unacceptable.
4 traditional wire resistance type touch-screens comprise X layer and Y layer two-layer panel, its use pattern as shown in Figure 1, wherein, R1 and R3 represent the two-part equivalent resistance that the X conductive layer is divided into, R4 and R6 represent the two-part equivalent resistance that the Y conductive layer is divided into.Can obtain the value of resistance R 3, R6 and Rz by the metering system of 4 times or 3 times, wherein, Rz represents owing to touch the resistance value that is produced.
Described 4 metering systems are as follows:
Measurement one, Xp meet positive voltage Vref+, and Xn meets negative voltage Vref-, and Yp and Yn are floating empty, measure the magnitude of voltage V3 of Yp, then can get R3=V3/4096*Rxplate, wherein, Rxplate is the all-in resistance of X conductive layer, the measurement grade of analog digital (AD) converter of 4096 expression 12bit precision.If precision is 10bit, then can distinguish 1024 grades.
Measure two, with measure one in like manner, meet Yp positive voltage Vref+, Yn meets negative voltage Vref-, Xp and Xn are floating empty, the magnitude of voltage V1 of measured X p then can get R6=V1/4096*Ryplate, wherein, Ryplate is the all-in resistance of Y conductive layer.
Measurement three, Yp meet Vref+, and Xn meets Vref-, and Xp and Yn are floating empty, the magnitude of voltage V5 of measured X p.
Measurement four, Yp meet Vref+, and Xn meets Vref-, and Xp and Yn are floating empty, measure the magnitude of voltage V6 of Yn.Then can get Rz=R3* (V6/V5-1).
Described 3 metering systems are as follows:
Measurement one, Xp meet Vref+, and Xn meets Vref-, and Yp and Yn are floating empty, measure the magnitude of voltage V3 of Yp, then can get R3=V3/4096*Rxplate.
Measure two, in like manner, Yp meets Vref+, and Yn meets Vref-, and Xp and Xn are floating empty, and the magnitude of voltage V1 of measured X p then can get R6=V1/4096*Ryplate.
Measurement three, Yp meet Vref+, and Xn meets Vref-, and Xp and Yn are floating empty, and the magnitude of voltage V5 of measured X p then can get Rz=R3* (4096/V5-1)-R4.
That is to say, 4 traditional line system resistive touch screen systems are by apply a voltage of determining on the electrode pair of directions X (X conductive layer), and on Y direction (Y conductive layer) electrode pair not during making alive, in the parallel voltage field of X, the magnitude of voltage at place, contact can reflect on the Yp electrode, by measuring Yp electrode voltage swing over the ground, just can learn the X coordinate figure Xposition of contact.In like manner, when making alive on the Y electrode pair, and on the X electrode pair not during making alive,, just can learn the Y coordinate Yposition of contact by the voltage of measured X p electrode.Promptly, therefore can obtain touch point position because the resistance of X conductive layer and Y conductive layer is linear distribution.
But prior art is only supported the detection to the single-point touches of 4 line system resistive touch screens, can't realize the detection to the multiple point touching of 4 line system resistive touch screens.
Summary of the invention
The embodiment of the invention provides a kind of method and device that touch-screen is detected, in order to detect the movement tendency of two touch points on the 4 line system resistive touch screens.
A kind of method that touch-screen is detected that the embodiment of the invention provides comprises:
Touch-screen is carried out the location, touch point, obtain the first coordinate axis positional information and the second coordinate axis positional information; Wherein, described touch-screen is the four-wire system resistive touch screen;
According to described first coordinate axis positional information and the described second coordinate axis positional information, calculate first calculated value and second calculated value of the contact resistance that produced because described touch-screen is touched;
Described first calculated value is deducted described second calculated value, obtain the difference of described first calculated value and described second calculated value;
When described difference less than zero the time, judge that two touch points on the described touch-screen are positioned on described first change in coordinate axis direction, and, when the difference of described first calculated value and described second calculated value diminishes, determine that the distance of described two touch points on described first change in coordinate axis direction becomes big; When the difference of described first calculated value and described second calculated value becomes big, determine that the distance of described two touch points on described first change in coordinate axis direction diminishes;
When described difference greater than zero the time, judge that two touch points on the described touch-screen are positioned on described second change in coordinate axis direction, and, when the difference of described first calculated value and described second calculated value becomes big, determine that the distance of described two touch points on described second change in coordinate axis direction becomes big; When the difference of described first calculated value and described second calculated value diminishes, determine that the distance of described two touch points on described second change in coordinate axis direction diminishes.
A kind of device that touch-screen is detected that the embodiment of the invention provides comprises:
Position determination unit is used for touch-screen is carried out the location, touch point, obtains the first coordinate axis positional information and the second coordinate axis positional information; Wherein, described touch-screen is the four-wire system resistive touch screen;
Contact resistance calculates the unit, is used for according to described first coordinate axis positional information and the described second coordinate axis positional information, calculates first calculated value and second calculated value of the contact resistance that produced because described touch-screen is touched;
The movement tendency identifying unit is used for described first calculated value is deducted described second calculated value, obtains the difference of described first calculated value and described second calculated value; When described difference less than zero the time, judge that two touch points on the described touch-screen are positioned on described first change in coordinate axis direction, and, when the difference of described first calculated value and described second calculated value diminishes, determine that the distance of described two touch points on described first change in coordinate axis direction becomes big; When the difference of described first calculated value and described second calculated value becomes big, determine that the distance of described two touch points on described first change in coordinate axis direction diminishes; When described difference greater than zero the time, judge that two touch points on the described touch-screen are positioned on described second change in coordinate axis direction, and, when the difference of described first calculated value and described second calculated value becomes big, determine that the distance of described two touch points on described second change in coordinate axis direction becomes big; When the difference of described first calculated value and described second calculated value diminishes, determine that the distance of described two touch points on described second change in coordinate axis direction diminishes.
The embodiment of the invention by the touch point on the touch-screen is positioned, obtains the first coordinate axis positional information and the second coordinate axis positional information of described touch point; According to described first coordinate axis positional information and the described second coordinate axis positional information, calculate owing to first calculated value and second calculated value of described touch point to the contact resistance that touch produced of described touch-screen; According to the difference of described first calculated value and described second calculated value, determine the movement tendency information of described touch point on first change in coordinate axis direction or second change in coordinate axis direction.Thereby realized detection, changed under the prerequisite of hardware device not needing, made 4 traditional line system resistive touch screens also can support the function that two point touches, had the low advantage of cost the movement tendency of two touch points on the 4 line system resistive touch screens; And this function can be widely used in the built-in field of using touch-screen, has enriched user experience, has simplified user's operation.
Embodiment
The embodiment of the invention provides a kind of method and device that touch-screen is detected, in order to detect the movement tendency of two touch points on the 4 line system resistive touch screens.
The embodiment of the invention is by the movement tendency of two touch points obtaining, for example two fingers on touch-screen contraction or flick action, can bring very interesting function to application program, such as the picture that shows on the touch-screen is carried out operations such as scaling, stretching, thereby enrich user experience, made things convenient for user's operation.
Below in conjunction with accompanying drawing the embodiment of the invention is described in detail.
Referring to Fig. 2, a kind of method that touch-screen is detected that the embodiment of the invention provides totally comprises step:
S201, the touch point on the touch-screen is positioned, obtain the first coordinate axis positional information and the second coordinate axis positional information of described touch point.
S202, according to described first coordinate axis positional information and the described second coordinate axis positional information, calculate since described touch point to first calculated value and second calculated value of the contact resistance that touch produced of described touch-screen;
S203, according to the difference of described first calculated value and described second calculated value, determine the movement tendency information of described touch point on first change in coordinate axis direction or second change in coordinate axis direction.
Below above-mentioned group method is carried out detailed explaining.
At first introduce AD converter.If the precision of AD converter is 12bit, can distinguish 4096 grades so in theory, if precision is 10bit, then can distinguish 1024 grades.That is to say that the x direction of touch-screen and the position of y direction can be as accurate as 4096 grades, suppose on the touch-screen that the total length on the x direction and y direction is 4096 (it doesn't matter for the length and width of this value and LCDs LCD, just the degree that can segment of expression).Xplate represents the all-in resistance of the x direction of actual LCD, can directly test out, and about general about 300 Ω, Yplate represents the all-in resistance of the y direction of actual LCD, generally is approximately about 700 Ω.Represent the linear resistivity of x direction and y direction respectively with P1 and P2, P1=Xplate/4096 then, P2=Yplate/4096, the corresponding resistance value of x length is Rx=P1*Xposition on the x direction, Xposition represents relative distance, Xposition ∈ [0,4095]; In like manner, the resistance value of y length correspondence is Ry=P1*Yposition on the y direction, and Yposition represents relative distance, Yposition ∈ [0,4095].Suppose that impressed voltage is 4096 (registrations of full scale), the measured value of AD converter has just been represented magnitude of voltage so.
AD converter can also be measured the pressure of single-point touches except measuring the coordinate of single touch point, and referring to Fig. 1, by add forward voltage on Yp and Xn electrode, the magnitude of voltage of measured X p and Yn is respectively V5 and V6, by formula (1):
Rz=(Rxplate)*(Xposition/4096)*(V6/V5-1)
Perhaps formula (2):
The relation that Rz=(Rxplate*Xposition/4096) * (4096/V5-1)-Ryplate* (1-Yposition/4096) utilizes touch resistance R z and touch pressure to be inversely proportional to, can obtain the relative value of the pressure size of touch point, promptly characterize the force value of touch point with the value of resistance Rz.Wherein, Rz represents owing to touch the resistance value that is produced; Rxplate is the all-in resistance of X conductive layer; Ryplate is the all-in resistance of Y conductive layer; The measurement grade of analog digital (AD) converter of 4096 expression 12bit precision; Xposition is the X coordinate figure of contact; Yposition is the Y coordinate figure of contact.
The derivation principle of formula (1) is as follows:
From Yp through R4, Rz, R3 to Xn, electric current equates that everywhere voltage ratio equals resistance ratio, as can be known: V6/V5=(Rz+R3)/R3 solves Rz=R3* (V6/V5-1) according to this formula, wherein, R3=(Rxplate) * (Xposition/4096), thus formula (1) obtained.
The derivation principle of formula (2) is as follows:
From Yp through R4, Rz, R3 to Xn, electric current equates everywhere, voltage ratio equals resistance ratio, (4096-V5)/V5=(R4+Rz)/R3 as can be known, solve Rz=(4096/V5-1) * R3-R4, wherein, R3=(Rxplate) * (Xposition/4096), R4=Ryplate* (1-Yposition/4096), thus formula (2) obtained.
The embodiment of the invention just is based on this pressure survey mode, the resistance value of removing to ask the contact resistance that the touch point causes touch-screen by different computing formula (1) and formula (2), then, relatively with two kinds of formula calculate difference.
Formula (1) and formula (2) all are the resistance values that is used under the single-point touches situation calculating contact resistance, if calculate the resistance value of 2 contact resistances under the touch situation with these two formula, then certainly exist certain error.And the embodiment of the invention is a single-point touches with 2 touch situation equivalences, and using formula (1) and formula (2) calculate the resistance value of 2 contact resistances under the touch situation, thereby judges the movement tendency of two touch points according to the error of calculation.
Obtain following rule by statistics:
If have only a point to press (single-point touches), then the calculated value of formula (1) the resulting difference deta of calculated value that deducts formula (2) approaches 0, because the calculated value error of single-point touches is very little.
If on directions X, have at 2 and press (two point touch), deta<0 then, and the distance of two touch points is big more, the absolute value of difference deta | deta| is big more, because the distance of two touch points is big more, calculated value is inaccurate more, cause error big more, therefore, the absolute value of difference is also big more.
Press if on the Y direction, have at 2, deta>0 then, and the distance of two touch points is big more, the absolute value of difference deta | and deta| is big more.
The embodiment of the invention is based on above-mentioned rule, can judge that it still is on the Y direction that two touch points are in directions X according to difference deta positive and negative, and further judge that according to the size variation of the absolute value of difference deta two distances between the touch point are expansions or shrink.
The embodiment of the invention adopts the calculated value of formula (1) poor with the calculated value of formula (2), can make the calculated value of Rz and the error amplification of actual value, and the result who adopts this error that the movement tendency of two touch points is measured so is just accurate more.
Also will consider factors such as measuring error and pressure shake in actual applications, therefore, referring to Fig. 3, a kind of method that touch-screen is detected that the embodiment of the invention provides specifically comprises step:
S301, after the incident of pressing on the touch-screen takes place, Yp connects positive voltage, Xn connects negative voltage, start AD converter and measure the touch point at position Xposition on the directions X and the position Yposition on the Y direction, and the magnitude of voltage V6 at the magnitude of voltage V5 at measured X p place and Yn place, can measure repeatedly (as three times), get the mean value of each parameter then, to remove shake.
S302, judge whether value of being beyond the boundary of Xposition and Yposition, if, illustrate that then the user lifts hand or pen, leave touch-screen, then carry out step S303; Otherwise, illustrate that the user is making touch operation, carries out step S304.
S303, release resource or hold mode are constant.
S304, calculate first calculated value and second calculated value of contact resistance respectively, and calculate both difference deta according to formula (1) and formula (2).
S305, judge that deta is whether more than or equal to the empirical value minus_limit (negative value) of negative direction, and, be less than or equal to positive dirction empirical value plus_limit (on the occasion of), if, illustrate that then deta does fluctuation among a small circle near 0 value, promptly belong to the single-point touches situation, carry out step S306 so; Otherwise, illustrate that active user's operation belongs to two point and touches situation, need execution in step S307.
S306, judgement active user are operating as the single-point touches operation.
S307, judgement deta satisfy deta<minus_limit and still satisfy deta>plus_limit, if judge deta<minus_limit, illustrate that then the touch point is on the directions X, need carry out step S308; If judge deta>plus_limit, illustrate that then the touch point is on the Y direction, need carry out step S312.
S308, the current difference deta that calculates is compared with the last difference that calculates (use deta ' to represent),
If deta<deta '-deta_limit, then execution in step S309;
If deta>deta '+deta_limit, then execution in step S310;
Otherwise promptly deta is other values, then execution in step S311.
Wherein, deta_limit represents to prevent the circuitous interval of jolting repeatedly, promptly in the embodiment of the invention, if the difference of the difference deta of twice calculating in front and back (absolute value) is then thought disturbance if less than deta_limit.
S309, determine that two touch points make extensional motion on directions X, promptly the distance between two touch points is increasing.
S310, determine that two touch points make contractile motion on directions X, promptly the distance between two touch points is reducing.
S311, be defined as disturbance.
S312, current difference deta that calculates and the last difference deta ' that calculates are compared,
If deta>deta '+deta_limit, then execution in step S313;
If deta<deta '-deta_limit, then execution in step S314;
Otherwise promptly deta is other values, then execution in step S315.
S313, determine that two touch points make extensional motion on the Y direction, promptly the distance between two touch points is increasing.
S314, determine that two touch points make contractile motion on the Y direction, promptly the distance between two touch points is reducing.
S315, be defined as disturbance.
Referring to Fig. 4, a kind of device that touch-screen is detected that the embodiment of the invention provides comprises:
Position determination unit 41 is used for the touch point on the touch-screen is positioned, and obtains the first coordinate axis positional information and the second coordinate axis positional information of described touch point.
Contact resistance calculates unit 42, is used for according to described first coordinate axis positional information and the described second coordinate axis positional information, calculates owing to first calculated value and second calculated value of described touch point to the contact resistance that touch produced of described touch-screen.
Movement tendency identifying unit 43 according to the difference of described first calculated value and described second calculated value, is determined the movement tendency information of described touch point on first change in coordinate axis direction or second change in coordinate axis direction.
Preferably, described movement tendency identifying unit 43 comprises:
Coordinate axis unit 431 is used for the difference of described first calculated value and described second calculated value is compared with zero, determines that described touch point is positioned at first change in coordinate axis direction or second change in coordinate axis direction;
Movement tendency unit 432 is used for the difference of described first calculated value and described second calculated value is compared with the last difference that calculates, and determines the movement tendency information of described touch point on described first change in coordinate axis direction or second change in coordinate axis direction.
Preferably, described coordinate axis unit 431 comprises:
Difference unit 4311 is used for described first calculated value is deducted described second calculated value, obtains the difference of described first calculated value and described second calculated value.
The first coordinate axis unit 4312 is used for judging that when described difference during less than predefined minus first threshold described touch point is positioned on described first change in coordinate axis direction.
The second coordinate axis unit 4313 is used for during greater than zero second threshold value, judging that described touch point is positioned on described second change in coordinate axis direction greater than predefined when described difference.
Preferably, described coordinate axis unit 431 also comprises:
Single-point unit 4314, be used for when described difference more than or equal to described first threshold, and, when being less than or equal to described second threshold value, judge that described touch point is a touch point.
Preferably, described movement tendency unit 432 comprises:
First module 4321 during the difference that is used for recording less than the last time when the difference of described first calculated value and described second calculated value, determines that described touch point makes extensional motion on described first change in coordinate axis direction.
Second unit 4322 during the difference that is used for recording greater than the last time when the difference of described first calculated value and described second calculated value, determines that described touch point makes contractile motion on described first change in coordinate axis direction.
The 3rd unit 4323 during the difference that is used for recording greater than the last time when the difference of described first calculated value and described second calculated value, determines that described touch point makes extensional motion on described second change in coordinate axis direction.
The 4th unit 4324 during the difference that is used for recording less than the last time when the difference of described first calculated value and described second calculated value, determines that described touch point makes contractile motion on described second change in coordinate axis direction.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.