CN102769697B - Method and system for preventing false key-pressing caused by earphone inserted into terminal device - Google Patents
Method and system for preventing false key-pressing caused by earphone inserted into terminal device Download PDFInfo
- Publication number
- CN102769697B CN102769697B CN201210224301.3A CN201210224301A CN102769697B CN 102769697 B CN102769697 B CN 102769697B CN 201210224301 A CN201210224301 A CN 201210224301A CN 102769697 B CN102769697 B CN 102769697B
- Authority
- CN
- China
- Prior art keywords
- earphone
- hook key
- line
- terminal equipment
- event
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Telephone Function (AREA)
Abstract
The invention discloses a method and a system for preventing false key-pressing caused by an earphone inserted into a terminal device. The method comprises the steps as follows: after the earphone is inserted into the terminal device and before preset time is up, a hook key event is shielded, and the state of a hook key is detected when the preset time is up; when the hook key is pressed, the earphone is determined to be a three-wire earphone, and the hook key event is continuously shielded; when the hook key is not pressed, the earphone is determined to be a four-wire earphone, and the hook key event occurs; and after the earphone is determined to be the three-wire earphone, the earphone is determined to be the four-wire earphone when a releasing event of the hook key is detected, and the hook key event occurs.
Description
Technical field
The present invention relates to earphone field, particularly relate to a kind of method and system preventing from producing during earphone insertion terminal equipment button by mistake.
Background technology
4 at present conventional line earphone interfaces, as shown in Figure 1, the definition of 4 lines wherein respectively: 1 is mic line, and 2 is GND line, and 3 is R channel, and 4 is L channel.And often only having 3 lines i.e. 3 line earphones with the earphone on computers or on mp3,3 line earphones are exactly the earphone not with microphone, and it synthesizes a GND line mic line and GND line, and left and right acoustic channels line remains unchanged.
Due to the defect of earphone and measurement circuit design thereof, if the speed of user's plugged earphone is on mobile terminals fast not, the situation of the hook key event occurred on wrong report earphone is easy in the process will inserted at earphone, user can realize some shirtsleeve operations by hook key, such as connect/hang up, control player and broadcast receiver etc., if but wrong report hook key, the actual influence that can cause to user may have: 1, in communication process, plugged earphone causes phone to hang up; 2, during incoming call, plugged earphone causes automatic call answering; 3, during plugged earphone, the music player originally suspended starts automatic broadcasting; 4, during plugged earphone, the FM originally suspended starts automatic broadcasting; 5, the earphone not with microphone is not supported.
Slow earphone of inserting causes the reason of wrong report hook key to be: when user inserts 4 line earphone, if the speed of user's plugged earphone is fast not, GND line on earphone can the local overstand of mic detection line on mobile phone, the direct ground connection of mic detection line namely on mobile phone, this is just equivalent to the effect that user presses hook key, so now software will think it is that user presses hook key by mistake, then after user inserts mobile phone completely earphone, the event of hook key release can be reported again by mistake.What insert as user is the earphone of 3 lines, and because the earphone mic line of 3 lines and GND line are same single lines, mobile phone will be in state that hook key presses all the time and cause related application operation exception.
Current common solution is: after earphone insertion event being detected, and within the sufficiently long time, (such as 5 seconds) shield all hook key events, carry out plugged earphone to user's time enough, just starts afterwards to detect hook key.But this method or many places defect: 1, fast not to the response speed of hook key, such as user is anxious by hook key after plugged earphone, after upper 5 second such as so also needing, button just can work; If the time of 2 user's plugged earphones was more than 5 seconds, or earphone rests on the state being inserted into half always, or the situation of the wrong button of meeting produces; 3,3 line earphones are not still supported.
Therefore, prior art has yet to be improved and developed.
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 system preventing from producing during earphone insertion terminal equipment button by mistake, be intended to solve the problem easily producing button by mistake when existing earphone inserted slow.
Technical scheme of the present invention is as follows:
Produce a method for button by mistake when preventing earphone from inserting terminal equipment, wherein, comprise step:
A, when Test earphone inserts after terminal equipment, within a scheduled time, control the hook key event of shielding earphone;
B, when Test earphone insert terminal equipment reach the described scheduled time time, the state of hook key described in start detection, when described hook key is down state, then judges that current inserted earphone is as 3 line earphones, and continues control and shield hook key event; When described hook key is non-down state, then judge that described earphone is as 4 line earphones, and enable hook key event;
C, when judging that described earphone is as 3 line earphones, and when detecting that described hook key is released event, then again judge that described earphone is as 4 line earphones, and enable hook key event.
Described preventing produces the method missing button during earphone insertion terminal equipment, wherein, also comprises step D:
When judging that current inserted earphone is as 4 line earphones, and when hook key event being detected, report hook key event to terminal equipment.
Described preventing produces the method missing button during earphone insertion terminal equipment, and wherein, the state detecting hook key in described steps A is specially:
The state of hook key is obtained by the state of sense terminals equipment MIC line, when detecting that described terminal equipment MIC line judges that described hook key is as down state when being ground state, when detecting that described terminal equipment MIC line then judges when being unearthed state that described hook key is as non-down state.
Described preventing produces the method missing button during earphone insertion terminal equipment, and wherein, the described scheduled time is 1 second.
Described preventing produces the method missing button during earphone insertion terminal equipment, and wherein, described terminal equipment is mobile phone.
The described method producing by mistake button when preventing earphone from inserting terminal equipment, wherein, when judging current inserted earphone as 3 line earphone, the MIC arranging sound collection is the MIC on terminal equipment.
Produce a system for button by mistake when preventing earphone from inserting terminal equipment, it comprises:
Hook key event mask module, for after Test earphone inserts terminal equipment, within a scheduled time, controls the hook key event of shielding earphone;
Headset type determination module, for when Test earphone insertion terminal equipment reaches the described scheduled time, the state of hook key described in start detection, when described hook key is down state, then judge that current inserted earphone is as 3 line earphones, and continue to control shielding hook key event; When described hook key is non-down state, then judge that described earphone is as 4 line earphones, and enable hook key event;
For working as, the heavy determination module of 3 line earphones, judges that described earphone is as 3 line earphones, and when detecting that described hook key is released event, then again judges that described earphone is as 4 line earphones, and enable hook key event.
Described preventing produces the system missing button during earphone insertion terminal equipment, wherein, also comprises:
For working as, hook key reporting events module, judges that current inserted earphone is as 4 line earphones, and when hook key event being detected, reports hook key event to terminal equipment.
Beneficial effect: the method and system producing button by mistake when the present invention prevents earphone from inserting terminal equipment, by detecting the state of the hook key when the enough short scheduled time, situation about pressing according to hook key and do not press judges the type of earphone, and determine whether shield or enable hook key event, until when earphone is inserted terminal equipment by user completely, detect again 3 line earphones determine whether correct, the present invention not only prevent the situation producing wrong report hook key event when plugged earphone is crossed slow, also add the New function of Test earphone type.
Accompanying drawing explanation
Fig. 1 is the earphone interface structural representation of 4 line earphones in prior art.
Fig. 2 is the flow chart that the present invention prevents from producing during earphone insertion terminal equipment the method preferred embodiment of button by mistake.
Fig. 3 is the structured flowchart that the present invention prevents from producing during earphone insertion terminal equipment the system preferred embodiment of button by mistake.
Embodiment
The invention provides a kind of method and system preventing from producing during earphone insertion terminal equipment button by mistake, 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. 2, Fig. 2 is the flow chart that the present invention prevents from producing during earphone insertion terminal equipment the method preferred embodiment of button by mistake, and as shown in the figure, it comprises step:
S101, when Test earphone inserts after terminal equipment, within a scheduled time, control the hook key event of shielding earphone;
S102, when Test earphone insert terminal equipment reach the described scheduled time time, the state of hook key described in start detection, when described hook key is down state, then judges that current inserted earphone is as 3 line earphones, and continues control and shield hook key event; When described hook key is non-down state, then judge that described earphone is as 4 line earphones, and enable hook key event;
S103, when judging that described earphone is as 3 line earphones, and when detecting that described hook key is released event, then again judge that described earphone is as 4 line earphones, and enable hook key event.
In step S101, after detecting that earphone is inserted into the event of terminal equipment, start timing immediately, specifically carry out timing by a timer, and enough short scheduled time (such as 1 second) is set, before reaching this scheduled time, control to mask all hook key events;
In step s 102, when reaching this scheduled time, detect the state of this hook key, to judge the type of current inserted earphone, and according to corresponding type, determine whether enable hook key event, namely determine whether to allow hoo key events, after detecting the state of hook key, different settings is carried out for different states, when described hook key is down state, then judge that described earphone is as 3 line earphones, because within the described scheduled time, hook key is pressed and illustrates or be the wrong report hook key that user's plugged earphone is fast not or caused by 3 line earphones, now temporarily can judge that this earphone is as 3 line earphones, when described hook key is non-down state, then illustrate that described earphone is 3 line earphones scarcely, can judge that described earphone is as 4 line earphones, and can enable hook key event, such as, connect/hang up, control player and broadcast receiver etc.
In step s 103, when detecting that hook key is down state, judge that described earphone is as 3 line earphones, but also having a kind of may be that the speed of user's plugged earphone is fast not, GND line on earphone can the place of MIC detection line on the terminal device stop long, namely the direct ground connection of MIC detection line on terminal equipment, so also need being judged to be that the situation of 3 line earphones judges again again, its decision method is: then again judge that when detecting that described hook key is released event described earphone is as 4 line earphones, and enable hook key event, otherwise still judge that described earphone is as 3 line earphones.The principle of this decision method is when the speed that earphone inserts is fast not, the time that GND line on earphone rests on MIC detection line is long, but when earphone is inserted in terminal equipment by user completely, GND line can leave MIC detection line, then the d/d event of hook key now can be detected, if there is above-mentioned situation, unquestionablely can judge that described earphone is as 4 line earphones, and before this because shield hook key event, so can't by hook key reporting events before, so avoid the situation of wrong report hook key.
In the present invention, the described scheduled time needs enough short, such as can arrange the scheduled time is 1 second, and an important evidence of the present invention is exactly user substantially can not press hook key within 1 second by plugged earphone again, because hook key is arranged on earphone cord instead of on terminal equipment, except non-user is deliberately tested, otherwise user does not generally have so fast key scroll, even and if user presses hook key at plugged earphone within 1 second, even if do not respond this hook key to press event, the hook key event after also can not affecting user.
After step s 103, after being judged to be 4 line earphones, report hook event when hook key event being detected to terminal equipment, after detecting that described earphone is 4 line earphones, can start to report hook key event, such as, connect and hang up, control player and broadcast receiver etc.And after judging that described earphone is as 3 line earphones, even if the MIC that sound collection also can be set be MIC on terminal equipment to ensure that the earphone inserted is 3 line earphones, also can carry out the functions such as call normally.
In the present invention, terminal equipment is mobile phone, because the earphone on computer or MP3 is generally 3 line earphones, and the earphone namely not with microphone, but the earphone on mobile phone is generally 4 line earphones, and it needs microphone to carry out conversing etc. function.
Based on said method, the present invention also provides a kind of system preventing from producing during earphone insertion terminal equipment button by mistake, and as shown in Figure 3, it comprises:
Hook key event mask module 100, for after Test earphone inserts terminal equipment, within a scheduled time, controls the hook key event of shielding earphone;
Headset type determination module 200, for when Test earphone insertion terminal equipment reaches the described scheduled time, the state of hook key described in start detection, when described hook key is down state, then judge that current inserted earphone is as 3 line earphones, and continue to control shielding hook key event; When described hook key is non-down state, then judge that described earphone is as 4 line earphones, and enable hook key event;
For working as, the heavy determination module 300 of 3 line earphone, judges that described earphone is as 3 line earphones, and when detecting that described hook key is released event, then again judges that described earphone is as 4 line earphones, and enable hook key event.
Further, described system also comprises:
For working as, hook key reporting events module 400, judges that current inserted earphone is as 4 line earphones, and when hook key event being detected, reports hook key event to terminal equipment.Describe in detail about existing before the function of above-mentioned each module, therefore repeat no more.
The present invention produces the method and system of button by mistake when preventing earphone from inserting terminal equipment, by detecting the state of the hook key when the enough short scheduled time, situation about pressing according to hook key and do not press judges the type of earphone, and determine whether shield or enable hook key event, until when earphone is inserted terminal equipment by user completely, detect again 3 line earphones determine whether correct, the present invention not only prevent the situation producing wrong report hook key event when plugged earphone is crossed slow, also add the New function of Test earphone type.
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 range that all should belong to claims of the present invention.
Claims (6)
1. produce a method for button by mistake when preventing earphone from inserting terminal equipment, it is characterized in that, comprise step:
A, when Test earphone inserts after terminal equipment, within a scheduled time, control the hook key event of shielding earphone;
B, when Test earphone insert terminal equipment reach the described scheduled time time, the state of hook key described in start detection, when described hook key is down state, then judges that current inserted earphone is as 3 line earphones, and continues control and shield hook key event; When described hook key is non-down state, then judge that described earphone is as 4 line earphones, and enable hook key event;
C, when judging that described earphone is as 3 line earphones, and when detecting that described hook key is released event, then again judge that described earphone is as 4 line earphones, and enable hook key event, described judgement is that the time that the GND line on earphone rests on MIC detection line is long when the speed that earphone inserts is fast not, but when earphone is inserted in terminal equipment by user completely, GND line can leave MIC detection line, then the d/d event of hook key now can be detected;
The state detecting hook key in described steps A is specially:
The state of hook key is obtained by the state of sense terminals equipment MIC line, when detecting that described terminal equipment MIC line judges that described hook key is as down state when being ground state, when detecting that described terminal equipment MIC line then judges when being unearthed state that described hook key is as non-down state;
The described scheduled time is 1 second.
2. produce the method for button by mistake when preventing earphone from inserting terminal equipment according to claim 1, it is characterized in that, also comprise step D:
When judging that current inserted earphone is as 4 line earphones, and when hook key event being detected, report hook key event to terminal equipment.
3. produce the method for button by mistake when preventing earphone from inserting terminal equipment according to claim 1, it is characterized in that, described terminal equipment is mobile phone.
4. produce the method for by mistake button when preventing earphone from inserting terminal equipment according to claim 3, it is characterized in that, when judging current inserted earphone as 3 line earphone, the MIC arranging sound collection is the MIC on terminal equipment.
5. produce a system for button by mistake when preventing earphone from inserting terminal equipment, it comprises:
Hook key event mask module, for after Test earphone inserts terminal equipment, within a scheduled time, controls the hook key event of shielding earphone;
Headset type determination module, for when Test earphone insertion terminal equipment reaches the described scheduled time, the state of hook key described in start detection, when described hook key is down state, then judge that current inserted earphone is as 3 line earphones, and continue to control shielding hook key event; When described hook key is non-down state, then judge that described earphone is as 4 line earphones, and enable hook key event;
The heavy determination module of 3 line earphones, judge that described earphone is as 3 line earphones for working as, and when detecting that described hook key is released event, then again judge that described earphone is as 4 line earphones, and enable hook key event, described judgement is when the speed that earphone inserts is fast not, the time that GND line on earphone rests on MIC detection line is long, but when earphone is inserted in terminal equipment by user completely, GND line can leave MIC detection line, then the d/d event of hook key now can be detected;
The state detecting hook key is specially:
The state of hook key is obtained by the state of sense terminals equipment MIC line, when detecting that described terminal equipment MIC line judges that described hook key is as down state when being ground state, when detecting that described terminal equipment MIC line then judges when being unearthed state that described hook key is as non-down state;
The described scheduled time is 1 second.
6. produce the system of button by mistake when preventing earphone from inserting terminal equipment according to claim 5, it is characterized in that, also comprise:
For working as, hook key reporting events module, judges that current inserted earphone is as 4 line earphones, and when hook key event being detected, reports hook key event to terminal equipment.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210224301.3A CN102769697B (en) | 2012-07-02 | 2012-07-02 | Method and system for preventing false key-pressing caused by earphone inserted into terminal device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210224301.3A CN102769697B (en) | 2012-07-02 | 2012-07-02 | Method and system for preventing false key-pressing caused by earphone inserted into terminal device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102769697A CN102769697A (en) | 2012-11-07 |
CN102769697B true CN102769697B (en) | 2015-03-25 |
Family
ID=47096944
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210224301.3A Active CN102769697B (en) | 2012-07-02 | 2012-07-02 | Method and system for preventing false key-pressing caused by earphone inserted into terminal device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102769697B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103442133A (en) * | 2013-08-16 | 2013-12-11 | 上海闻泰电子科技有限公司 | Mobile terminal simultaneously supporting three-section type earphone and four-section type earphone and operation method |
CN104093114B (en) * | 2014-07-22 | 2018-03-16 | Tcl通讯(宁波)有限公司 | A kind of detection means of earphone keystroke, detecting system and detection method |
CN104821981B (en) * | 2015-03-13 | 2017-11-07 | 惠州Tcl移动通信有限公司 | A kind of detection method of earphone operation |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5832075A (en) * | 1996-09-20 | 1998-11-03 | Mitel Corporation | Off-hook detector for headset |
CN1867133A (en) * | 2006-03-08 | 2006-11-22 | 华为技术有限公司 | Method for preventing mobile terminal earphone keystroke mis-operation and mobile terminal |
CN101184284A (en) * | 2007-11-20 | 2008-05-21 | 东莞欧珀移动通信有限公司 | Control method for judging insertion type of earphone by mobile phone |
CN101945172A (en) * | 2010-09-17 | 2011-01-12 | 惠州Tcl移动通信有限公司 | Mobile phone-based earphone recognition calling method and mobile phone |
CN102075845A (en) * | 2010-12-29 | 2011-05-25 | 上海华勤通讯技术有限公司 | Method for identifying earphone types |
-
2012
- 2012-07-02 CN CN201210224301.3A patent/CN102769697B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5832075A (en) * | 1996-09-20 | 1998-11-03 | Mitel Corporation | Off-hook detector for headset |
CN1867133A (en) * | 2006-03-08 | 2006-11-22 | 华为技术有限公司 | Method for preventing mobile terminal earphone keystroke mis-operation and mobile terminal |
CN101184284A (en) * | 2007-11-20 | 2008-05-21 | 东莞欧珀移动通信有限公司 | Control method for judging insertion type of earphone by mobile phone |
CN101945172A (en) * | 2010-09-17 | 2011-01-12 | 惠州Tcl移动通信有限公司 | Mobile phone-based earphone recognition calling method and mobile phone |
CN102075845A (en) * | 2010-12-29 | 2011-05-25 | 上海华勤通讯技术有限公司 | Method for identifying earphone types |
Also Published As
Publication number | Publication date |
---|---|
CN102769697A (en) | 2012-11-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103414982B (en) | A kind of method and apparatus that sound is provided | |
CN103118191B (en) | Using control method and mobile terminal for iPhone wire control earphone | |
CN105372026B (en) | A kind of air-tightness detection device and its method of microphone pickup structural path | |
CN102932549A (en) | Mobile terminal and method for accessing application programs rapidly through earphones | |
CN103095915B (en) | A kind of method that prevents maloperation and mobile phone based on touch-screen mobile phone | |
CN102624980A (en) | Method for detecting abrupt environment and prompting based on earphone of mobile phone and mobile phone | |
CN103338317B (en) | The method and system of audio-visual devices are controlled according to incoming call situation | |
CN103051997A (en) | Earphone, and terminal equipment and method for controlling audio presentation through earphone | |
CN102769697B (en) | Method and system for preventing false key-pressing caused by earphone inserted into terminal device | |
CN104320529A (en) | Information receiving processing method and voice communication device | |
CN106453791A (en) | A sound signal output method and apparatus and an earphone state detection method and apparatus | |
CN102938819A (en) | Mobile terminal music control system and method | |
CN104980884A (en) | Information transmission method and information transmission device | |
CN103067601B (en) | Mobile terminal and detecting method of earphone inserting state thereof | |
CN103279410A (en) | Externally-connected device prompt device and method thereof | |
CN104735697A (en) | Mobile terminal automated calling field test method and system based on AT instruction | |
CN104754098A (en) | Volume adjusting method and system for single-key earphone | |
CN102546897A (en) | Method for preventing X undercover interception software from environment monitoring | |
CN105872209A (en) | Information processing method and electronic device | |
CN104821981B (en) | A kind of detection method of earphone operation | |
CN105407221B (en) | False-touch prevention method and system when using self-shooting bar | |
CN105848030A (en) | Time obtaining method and device, mobile terminal and earphone | |
CN106657675B (en) | Method and system for playing mobile terminal audio and video through Bluetooth playing device | |
CN109873906A (en) | A kind of wireless headset control method, system and electronic equipment and storage medium | |
CN103581414B (en) | A kind of electronic equipment and the communication event prompt method being applied to electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |