Summary of the invention
In view of above-mentioned the deficiencies in the prior art, the object of the present invention is to provide a kind of method and the device that utilize touch-screen simulated range sensor, being intended to solve existing touch-screen needs to rely on range sensor and to realize going out the problem of screen, bright screen function when talking state.
Technical scheme of the present invention is as follows:
Utilize a method for touch-screen simulated range sensor, wherein, comprise step:
A, when detect mobile terminal be in call state time, improve the sensitivity of touch-screen by enable first register;
B, by touch-screen identification face be press close to or away from, and control the light on and off of touch-screen according to recognition result.
The described method utilizing touch-screen simulated range sensor, wherein, described steps A specifically comprises:
A1, in touch-screen parameter, specify the value of the first register to control sensitivity of touch screen in advance;
A2, when detect mobile terminal be in call state time, this first register enable, improves the sensitivity of touch-screen.
The described method utilizing touch-screen simulated range sensor, wherein, described steps A 2 specifically comprises:
A21, touch-screen drive in create a range sensor virtual unit;
A22, mobile terminal be in call state time, this range sensor virtual unit enable;
A23, by enable first register of this range sensor virtual unit.
The described method utilizing touch-screen simulated range sensor, wherein, described step B specifically comprises:
B1, in touch-screen parameter, one second register is specified to store the parameter that touch-screen reports;
When B2, touch-screen detect that face is pressed close to, write a fixed value to this second register, and report upper strata, to control bright screen, detect face away from time, write another fixed value to this second register, and report upper strata, to control the screen that goes out.
The described method utilizing touch-screen simulated range sensor, wherein, in described steps A 1, controls the sensitivity of touch-screen the first half by specifying the value of the first register in touch-screen parameter.
Utilize a device for touch-screen simulated range sensor, wherein, comprising:
Sensitivity arranges module, for when detect mobile terminal be in call state time, improve the sensitivity of touch-screen by enable first register;
Touch screen control module, for by touch-screen identification face be press close to or away from, and control the light on and off of touch-screen according to recognition result.
The described device utilizing touch-screen simulated range sensor, wherein, described sensitivity arranges module and specifically comprises:
First designating unit, for specifying the value of the first register to control sensitivity of touch screen in advance in touch-screen parameter;
The enable unit of first register, for when detect mobile terminal be in call state time, this first register enable, improves the sensitivity of touch-screen.
The described device utilizing touch-screen simulated range sensor, wherein, the enable unit of described first register specifically comprises:
Virtual unit creates subelement, in driving at touch-screen, create a range sensor virtual unit;
The enable subelement of virtual unit, when calling state for being at mobile terminal, this range sensor virtual unit enable;
The enable subelement of first register, for passing through enable first register of this range sensor virtual unit.
The described device utilizing touch-screen simulated range sensor, wherein, described touch screen control module specifically comprises:
Second designating unit, stores for specifying one second register in touch-screen parameter the parameter that touch-screen reports;
Touch-screen control module, when detecting that face is pressed close to for touch-screen, writes a fixed value to this second register, and report upper strata, to control bright screen, detect face away from time, write another fixed value to this second register, and report upper strata, to control the screen that goes out.
The described device utilizing touch-screen simulated range sensor, wherein, described first designating unit is used for by specifying the value of the first register to control the sensitivity of touch-screen the first half in touch-screen parameter.
Beneficial effect: the present invention by detect mobile terminal be in call state time, enable first register improves the sensitivity of touch-screen, pressing close to of face is responded to or away from action by touch-screen, and the light on and off of touch-screen are controlled according to recognition result, because method of the present invention is without the need to increasing range sensor in the terminal, so both reduced mobile terminal hardware cost, the bright screen that in turn ensure that when touch-screen is conversed goes out screen function.
Embodiment
The invention provides a kind of method and the device that utilize touch-screen simulated range sensor, for making object of the present invention, technical scheme and effect clearly, clearly, the present invention is described in more detail below.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
Refer to Fig. 1, Fig. 1 is a kind of process flow diagram utilizing the method preferred embodiment of touch-screen simulated range sensor of the present invention, and as shown in the figure, it comprises step:
S101, when detect mobile terminal be in call state time, improve the sensitivity of touch-screen by an enable register;
S102, by touch-screen identification face be press close to or away from, and control the light on and off of touch-screen according to recognition result.
In the present embodiment, it realizes principle: detect mobile terminal be in call state time, the sensitivity of touch-screen is improved by an enable register, the data reported according to touch-screen again identify user's face be away from or press close to touch-screen, then controlling the light on and off of touch-screen according to recognition result, namely when identifying user away from touch-screen, controlling touch-screen bright screen, when identifying user near touch-screen, then control touch-screen and to go out screen.
The basis that the present embodiment realizes is after the sensitivity of touch-screen is brought up to a certain degree, its identifiable design go out face away from or the action of pressing close to, preferably, the sensitivity of touch-screen is brought up to can identify within the scope of 3 ~ 5cm away from or press close to action, such as 5cm, touch-screen can detect face from the position of distance touch-screen 5cm to the action that touch-screen is close, also can to detect from the position within distance touch-screen 5cm then away from action.Touch-screen is after above-mentioned action being detected, upper strata can be transferred to process, to control the light on and off of touch-screen according to recognition result, when close action namely being detected, then control touch-screen to go out screen, detect away from action time, then control touch-screen bright screen, thus the function realized by simulated range sensor, control touch-screen bright screen and the screen that goes out.
After detecting that talking state terminates, then this first register of forbidden energy, the sensitivity by this touch-screen returns to arm's length standard, reduces sensitivity of touch screen, enables user normally use the function of touch-screen.
As the preferred embodiment of the present invention, as shown in Figure 2, described step S101 specifically comprises:
S201, in touch-screen parameter, specify the value of the first register to control sensitivity of touch screen in advance;
S202, when detect mobile terminal be in call state time, this first register enable, improves the sensitivity of touch-screen.
The present embodiment first resets touch-screen parameter, make touch-screen can simulate the function of range sensor, need specifically in touch-screen parameter, specify the value of the first register to control sensitivity of touch screen, detect mobile terminal be in call state time, then this first register enable, thus strengthen the sensitivity of this touch-screen.
In the present embodiment, in touch-screen parameter, preferably specify the value of the first register to control the sensitivity of touch-screen the first half.
Because user is in communication process, generally need the latter half holding touch-screen, if improve the sensitivity of monoblock touch-screen, just likely make user when holding touch-screen, cause touch-screen the action of pressing close to be detected always, cause and identify by mistake, cause touch-screen to be in screen state of going out always.So the preferred mode of the present invention is the sensitivity only improving touch-screen the first half, only when touch-screen is pressed close to face in talking state by user, the action of pressing close to just can be detected, or only user by touch-screen away from face time, just can detect away from action, make to detect identification more accurate, and this also existing range sensor cannot realize, so the function of simulated range sensor of the present invention, can not only realize controlling touch-screen in the bright screen called in process and screen function of going out, control procedure hommization more can also be made simultaneously, more accurate.In the specific implementation, the value 0xB0 of the first register can be specified in touch-screen parameter to control the sensitivity of touch-screen the first half.Certainly, its region controlled also specifically can adjust according to actual conditions, such as, for large-screen mobile phone and little screen mobile phone, suitably can adjust the control band of sensitivity of touch screen, to make touch-screen recognition detection more accurate.
As the preferred embodiment of the present invention, as shown in the figure, described step S202 specifically comprises:
S301, touch-screen drive in create a range sensor virtual unit;
S302, mobile terminal be in call state time, this range sensor virtual unit enable;
S303, by enable first register of this range sensor virtual unit.
In the present embodiment, except need configuring touch-screen parameter, also in touch-screen drives, a range sensor virtual unit is created at software section, detect mobile terminal be in call state time, then this range sensor virtual unit enable, this range sensor virtual unit will open the function of this first register, i.e. this first register enable further, thus open the function of touch-screen simulated range sensor, and detecting that mobile terminal is called after state terminates, then this range sensor virtual unit of forbidden energy, this first register of further forbidden energy, namely the value of the first register can not be specified, sensitivity of touch screen is in the standard of normal using forestland, thus close the function of touch-screen simulated range sensor, meet the function that user normally uses.
After creating range sensor virtual unit, also can build a communication interface, such as sysfs communication interface, this communication interface is used to provide to upper strata, upper strata is operated this range sensor virtual unit by this communication interface, operation wherein comprises this range sensor virtual unit enable, or this range sensor virtual unit of forbidden energy.
As the preferred embodiment of the present invention, as shown in the figure, described step S102 specifically comprises:
S401, in touch-screen parameter, one second register is specified to store the parameter that touch-screen reports;
When S402, touch-screen detect that face is pressed close to, write a fixed value to this second register, and report upper strata, to control bright screen, detect face away from time, write another fixed value to this second register, and report upper strata, to control the screen that goes out.
This second register is used for receiving and stores the parameter that touch-screen reports, touch-screen is when the action identifying that user's face is close or press close to, corresponding parameter can be reported, stored by the second register, specifically, touch-screen detect be in sensing range near or away from action, such as, when there is close action within 5cm, then write a fixed value to this second register, such as C0, then the data of write are reported upper strata, upper strata is transferred to process, thus control the screen that goes out of touch-screen, when have within 5cm away from action time, then to this second register write another one fixed value, such as E0, then the data of write are reported upper strata, upper strata is transferred to process, thus control the bright screen of touch-screen.
As the preferred embodiment of the present invention, in described step S401, in touch-screen drives, build communication interface, by this communication interface, this range sensor virtual unit is operated for upper strata.
Based on said method, the present invention also provides a kind of device preferred embodiment utilizing touch-screen simulated range sensor, and as shown in Figure 5, it comprises:
Sensitivity arranges module 100, for when detect mobile terminal be in call state time, improve the sensitivity of touch-screen by enable first register;
Touch screen control module 200, for by touch-screen identification face be press close to or away from, and control the light on and off of touch-screen according to recognition result.
Further, as shown in Figure 6, described sensitivity arranges module 100 and specifically comprises:
First designating unit 110, for specifying the value of the first register to control sensitivity of touch screen in advance in touch-screen parameter;
The enable unit 120 of first register, for when detect mobile terminal be in call state time, this first register enable, improves the sensitivity of touch-screen.
Further, as shown in Figure 7, the enable unit 120 of described first register specifically comprises:
Virtual unit creates subelement 121, in driving at touch-screen, create a range sensor virtual unit;
The enable subelement 122 of virtual unit, when calling state for being at mobile terminal, this range sensor virtual unit enable;
The enable subelement 123 of first register, for passing through enable first register of this range sensor virtual unit.
Further, as shown in Figure 8, described touch screen control module 200 specifically comprises:
Second designating unit 210, stores for specifying one second register in touch-screen parameter the parameter that touch-screen reports;
Touch-screen control module 220, when detecting that face is pressed close to for touch-screen, writes a fixed value to this second register, and report upper strata, to control bright screen, detect face away from time, write another fixed value to this second register, and report upper strata, to control the screen that goes out.
Further, described first designating unit 110 for by specifying the value of the first register to control the sensitivity of touch-screen the first half in touch-screen parameter.
Ins and outs about above-mentioned modular unit are existing in method above to be described in detail, therefore repeats no more.
In sum, the present invention by detect mobile terminal be in call state time, enable first register improves the sensitivity of touch-screen, pressing close to of face is responded to or away from action by touch-screen, and the light on and off of touch-screen are controlled according to recognition result, because method of the present invention is without the need to increasing range sensor in the terminal, so both reduced mobile terminal hardware cost, the bright screen that in turn ensure that when touch-screen is conversed goes out screen function.
Should be understood that, application of the present invention is not limited to above-mentioned citing, for those of ordinary skills, can be improved according to the above description or convert, and all these improve and convert the protection domain that all should belong to claims of the present invention.