CN102651023B - Method and device for controlling input data - Google Patents

Method and device for controlling input data Download PDF

Info

Publication number
CN102651023B
CN102651023B CN201210094098.2A CN201210094098A CN102651023B CN 102651023 B CN102651023 B CN 102651023B CN 201210094098 A CN201210094098 A CN 201210094098A CN 102651023 B CN102651023 B CN 102651023B
Authority
CN
China
Prior art keywords
languages
input frame
focus
html
input
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
Application number
CN201210094098.2A
Other languages
Chinese (zh)
Other versions
CN102651023A (en
Inventor
孙鹏
刘鸿威
贺跃松
张广宇
任寰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201210094098.2A priority Critical patent/CN102651023B/en
Publication of CN102651023A publication Critical patent/CN102651023A/en
Application granted granted Critical
Publication of CN102651023B publication Critical patent/CN102651023B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention provides a method and a device for controlling input data. The method comprises the following steps of: intercepting a keyboard message which includes a first language message; acquiring a focal element in a current window; acquiring a second language input in the focal element in accordance with a preset target element attribute mapping table; converting the keyboard message into corresponding keyboard information coded according to the second language in accordance with a preset language code mapping table; and outputting the keyboard information coded according to the second language in the focal element. The shielding of an input method is realized in a condition that the compatibility of a browser cannot be met in the prior art, and by using the method and the device, through intercepting the keyboard message and converting a keyboard input, the conventional technical problem is effectively solved.

Description

A kind of control method to input data and device
Technical field
The application relates to data entry teclmique field, particularly relates to a kind of control method to input data and device.
Background technology
Current Internet technology has deeply affected the life of people, and such as E-mail address, forum, web game etc. have also become a part indispensable in people's routine work and amusement.Above-mentioned internet, applications mostly needs user to register and could use after logging in.In most cases, mostly user name is to be made up of English alphabet and character, and when user logs in or registers on the page, often need specially to switch to English input method when inputting user name, it is very inconvenient to use.
In order to improve the convenience of user's input, browser in prior art more than IE5.0 version provides a Cascading Style Sheet relevant to input method (Cascading Style Sheet, CSS) attribute ime-mode, for arranging or retrieve input method (Input Method Editor, the IME) state whether allowing user to activate input Chinese, Korean, Japanese etc.Its value is auto, active, inactive or disabled, and value meaning is as follows.Auto: the state not affecting IME is identical with when not specifying ime-mode attribute; Active: original state activates native language input method, user still manually can cancel and activate IME; Inactive: initial native language input method is in unactivated state, and user still can manual actuation IME.Disabled: forbid IME completely, for focal control (as input frame), user cannot activate IME.The script characteristic of its correspondence is imeMode.The here section of being uses the code sample of IME attribute:
Common input frame: <input type=" text " style=" width:190px; " >
Only can input English input frame: <input type=" text " style=" width:190px; Ime-mode:disabled; " >
Although above-mentioned prior art can utilize ime-mode attribute to shield the input method of input frame, third party's browsers such as below IE5.0 version and red fox all cannot support ime-mode attribute, cannot realize browser-safe, cause the process failure to input method.
In a word, the technical matters needing those skilled in the art urgently to solve is exactly: how can ensure to realize input method shielding processing when browser-safe.
In prior art, shield input method by the ime-mode of <input> input frame and cannot support all browsers, and need developer to be solidificated in web page files with the ime-mode attribute of the mode of code by input frame.For this problem, we propose: interception Keyboard Message, if this Keyboard Message is press key message, then in the focus element of the language information output display that the original language information in press key message active user inputted converts needs in current window.So, not only can adapt to the browser of all versions, and without the need to making any amendment to web page files, efficiently solve the problems referred to above, the input that improve user is experienced.
Summary of the invention
Technical problems to be solved in this application are to provide a kind of control method to input data and device, so that when adapting to different browsers, the Chinese key information that user inputs is converted to corresponding English output display in the focus element in window.
In order to solve the problem, this application discloses a kind of control method to input data, comprising:
Interception Keyboard Message, described Keyboard Message includes the first languages message;
Judge whether described Keyboard Message comprises press key message, if do not comprise, then return and re-execute described interception Keyboard Message;
Obtain the focus element in current window;
According to preset object element best property of attribute mapping table, mate described focus element, if do not mate, then return and re-execute described interception Keyboard Message;
According to preset object element best property of attribute mapping table, obtain the second languages carrying out inputting in focus element;
According to preset languages Code Mapping Tables, described Keyboard Message is converted to by keypad information corresponding to the second languages coding;
Export the described keypad information by the second languages coding in described focus element.
Preferably, also comprised before described interception Keyboard Message:
According to preset object element best property of attribute mapping table, obtain the object element in current window;
Monitor described object element until described object element obtains focus become focus element.
Preferably, also comprise:
The first languages input method in shielding current window.
Preferably, also comprise:
If described focus element loses focus, recover the first languages input method in current window.
Preferably, it is characterized in that,
Focus element in described current window is input frame element;
Described preset object element best property of attribute mapping table comprises webpage domain name or the window name of input frame attribute of an element mark and correspondence.
Preferably, also comprise one or more lists in described preset object element best property of attribute mapping table, comprise two or more input frame element in described list, described method also comprises:
If only containing 1 Password Input frame in described list, and the input frame of the described Password Input frame subordinate brotgher of node is not Text Entry, then the second languages that in described list, all input frame elements are corresponding are English.
Preferably, described method also comprises:
If only containing 1 Password Input frame in described list, and the input frame of the described Password Input frame subordinate brotgher of node is Text Entry, then the second languages that in described list, all input frame elements are corresponding are English.
Preferably, described method also comprises:
If the Password Input frame only containing 2 positions continuously and each other brotgher of node in described list, then the second languages that in described list, all input frame elements are corresponding be English.
Preferably, described method also comprises:
If the Password Input frame only containing 3 positions continuously and each other brotgher of node in described list, then the second languages that in described list, all input frame elements are corresponding be English.
Preferably, the focus element in described acquisition current window comprises:
Obtain the application programming interfaces object of current window;
The focus element in current window is obtained by described application programming interfaces object.
Preferably, described current window is html web page, and the described focus element obtained in current window by application programming interfaces object is comprised:
The browser control part object corresponding according to current html web page obtains HTML forms object;
Html document object is obtained by described HTML forms object;
The focus element in described html web page is obtained by described html document object.
Preferably, comprise further:
If cannot obtain html document object by HTML forms object, then HTML forms object obtains the service support object of current operation system;
Described service support object obtains browser control part object;
Described html document object is obtained based on described browser control part object.
Preferably, comprise further:
Frame elements/inner frame element if described by the described html document object focus element obtained in described html web page, by the HTML forms object that HTML frame foundation object acquisition that described frame elements/inner frame element is corresponding is corresponding.
For solving the problem, disclosed herein as well is a kind of control device to input data, comprising:
Keyboard Message blocking module, for tackling Keyboard Message, described Keyboard Message includes the first languages message;
Press key message authentication module, for judging whether Keyboard Message comprises press key message, if do not comprise, notify keyboard message block module starts to tackle Keyboard Message;
Focus element acquisition module, for obtaining the focus element in current window;
Focus element matching module, according to preset object element best property of attribute mapping table, coupling focus element, if do not mate, then notify keyboard message block module starts to tackle Keyboard Message; Described languages Code Mapping Tables, for storing the code conversion mapping relations of the first languages and the second languages;
Second languages acquisition module, for according to preset object element best property of attribute mapping table, obtains the second languages carrying out inputting in focus element;
Keypad information modular converter, for according to preset languages Code Mapping Tables, is converted to by keypad information corresponding to the second languages coding by described Keyboard Message; Described preset languages Code Mapping Tables, for storing the code conversion mapping relations of the first languages and the second languages;
Keypad information output module, outputs in focus element for the keypad information produced by keypad information modular converter.
Preferably, also comprise:
Object element acquisition module, for according to preset object element best property of attribute mapping table, obtains the object element in current window;
Monitor module, for monitoring object element until described object element obtains focus become focus element.
Preferably, it is characterized in that, also comprise:
Input method shroud module, for shielding the first languages input method in current window.
Preferably, also comprise:
Input method recovery unit, drags focus element to lose focus for judging, recover in current window the first languages input method.
Preferably, it is characterized in that, also comprise:
Focus element in described current window is input frame element;
Described preset object element best property of attribute mapping table comprises webpage domain name or the window name of input frame attribute of an element mark and correspondence.
Preferably, also comprise one or more lists in described preset object element best property of attribute mapping table, comprise two or more input frame element in described list, described device also comprises:
Logon form configuration module, if for judging only there is 1 Password Input frame in current form, and the input frame of the described Password Input frame subordinate brotgher of node is not Text Entry, then configuring the second languages that in described list, all input frame elements are corresponding is English.
Preferably, described device also comprises:
First enrollment form configuration module, if for judging in described list only containing 1 Password Input frame, and the input frame of the described Password Input frame subordinate brotgher of node is Text Entry, then configuring the second languages that in described list, all input frame elements are corresponding is English.
Preferably, described device also comprises:
Second enrollment form configuration module, if for judging in described list the Password Input frame only containing 2 positions continuously and each other brotgher of node, then configures the second languages that in described list, all input frame elements are corresponding for English.
Preferably, described device also comprises:
Password amendment form configuration module, if for judging in described list the Password Input frame only containing 2 positions continuously and each other brotgher of node, then configures the second languages that in described list, all input frame elements are corresponding for English.
Preferably, also comprise:
Application programming interfaces object acquisition unit, for obtaining the application programming interfaces object of current window;
Described focus element acquisition module obtains the focus element in current window by described application programming interfaces object.
Preferably, described current window is html web page, and described focus element acquisition module comprises:
HTML forms object acquisition unit, obtains HTML forms object for the browser control part object corresponding according to html web page;
Html document object acquisition unit, for obtaining html document object by HTML forms object;
First focus element acquiring unit, for obtaining the focus element in html web page by html document object.
Preferably, comprise further:
HTML forms object acquisition unit, if cannot obtain html document object for judging by HTML forms object, then HTML forms object obtains the service support object of current operation system;
Described service support object obtains browser control part object;
Described html document object is obtained based on described browser control part object.
Preferably, comprise further:
Frame elements authentication unit, frame elements/inner frame element for judging if by the described html document object focus element obtained in described html web page, by the HTML forms object that HTML frame foundation object acquisition that described frame elements/inner frame element is corresponding is corresponding.
Compared with prior art, the application has the following advantages:
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the embodiment one of a kind of control method to input data of the application;
Fig. 2 is the schematic flow sheet of the embodiment two of a kind of control method to input data of the application;
Fig. 3 is a kind of structural representation inputting the embodiment one of the control device of data of the application.
Embodiment
For enabling above-mentioned purpose, the feature and advantage of the application more become apparent, below in conjunction with the drawings and specific embodiments, the application is described in further detail.
With reference to Fig. 1, show the schematic flow sheet of the embodiment one of a kind of control method to input data of the application.Described method comprises:
Step 101, interception Keyboard Message, described Keyboard Message includes the first languages message.
Window interception is from the message of keyboard.Window can be browser window, software window or other any application windows.
Because window is current thread, so all message of current keyboard operation all can pass through window.
For browser, when user to knock on the webpage of keyboard in browser window input Chinese to produce the flow process of message roughly as follows:
Button operation produces Keyboard Message → browser → operating system → input method → input method and Keyboard Message is converted to Chinese → browser → be shown in input frame.
In the application, data flow is as follows:
Button operation produces Keyboard Message → browser → browser and is converted to by Keyboard Message by keypad information → browser output display corresponding to the second languages coding.
Browser window had both no longer performed the subsequent step process of existing procedure when intercepting Keyboard Message, this Keyboard Message is no longer passed to operating system.
Step 102, obtains the focus element in current window.
Focus element in current window is exactly element corresponding to current cursor focus position, and this element can be the optional position etc. in input frame, check box, combobox, certain character text or certain file window in webpage.
Step 103, according to preset object element best property of attribute mapping table, obtains the second languages carrying out inputting in focus element.
Store the attribute information relevant with object element in described object element best property of attribute mapping table, such as this element position, name, the second languages that change, whether shield the map informations such as input method.
Preferably, the focus element in described current window is input frame element; Described preset object element best property of attribute mapping table comprises webpage domain name or the window name of input frame attribute of an element mark and correspondence.
After get focus input frame from webpage, extract the name property value of this input frame and the URL of input frame place webpage, then mate at object element best property of attribute mapping table according to these two information, if the match is successful, the correlation attribute information extracting current focus input frame from object element best property of attribute mapping table and the second languages that will change, if it fails to match, represent that current focus input frame is not in object element best property of attribute mapping table, without the need to carrying out languages conversion.
Step 104, according to preset languages Code Mapping Tables, is converted to described Keyboard Message by keypad information corresponding to the second languages coding.
Described languages Code Mapping Tables contains described first languages coding and the second languages and encodes and carry out the mapping relations changed.
First languages and the second languages are two corresponding languages, and wherein the particular content of languages can be decided in its sole discretion according to enforcement needs, and such as the first languages and the second languages can be Chinese and English, Chinese and German, French and Spanish etc. respectively.
Step 105, exports the described keypad information by the second languages coding in described focus element.
User implements button operation under the first languages input method status, window obtains from comprising the first languages message in the Keyboard Message of keyboard, then according to languages Code Mapping Tables, described Keyboard Message is converted to by keypad information corresponding to the second languages coding, finally exports the described keypad information by the second languages coding in described focus element.
The schematic flow sheet of the embodiment two of a kind of control method to input data of the application is shown see Fig. 2, Fig. 2.Described method specifically comprises:
Step 201, interception Keyboard Message, described Keyboard Message comprises the first languages message.
After knocking in keyboard button, the Keyboard Message of generation comprises WM_KEYDOWN and WM_KEYUP two press key messages.
Under different input method status, the WM_KEYDOWN message sent after button, the wParam value of its correspondence is different.Such as, the button under English state sends WM_KEYDOWN message, and its wParam is the Virtual Key that button is corresponding.Button under Chinese language state also can send WM_KEYDOWN message, but its wParam is VK_PROCESSKEY.With the first languages for Chinese is illustrated:
If the wParam property value of current press key message equals VK_PROCESSKEY, so current press key message comprises Chinese message, otherwise, abandon current Keyboard Message and tackle new Keyboard Message.
Keyboard Message does not comprise the first languages message, illustrates that the first languages input method does not start or do not produce corresponding first languages message.Such as, press numerical key under Chinese character coding input method starting state, the wParam of press key message is not equal to VK_PROCESSKEY, now interrupts subsequent treatment to save system resource as far as possible.
Step 202, if described Keyboard Message does not comprise press key message, then returns step 201.
After knocking in keyboard button, the Keyboard Message of generation comprises WM_KEYDOWN and WM_KEYUP two press key messages.If Keyboard Message comprises any one in above-mentioned two message, then mean that user implements the action of keyboard, otherwise, then return step 201 and re-execute interception Keyboard Message.
Step 203, obtains the focus element in current window.
Step 204, according to preset object element best property of attribute mapping table, obtains the second languages carrying out inputting in focus element.
Step 205, according to preset object element best property of attribute mapping table, mates described focus element, if coupling, then shields the first languages input method in described window.
Object element best property of attribute mapping table stores the mapping relations of focus element the need of shielding first languages input method.
Preferably, described focus element is <input> Text Entry; Described preset object element best property of attribute mapping table comprises the attribute-bit of webpage domain name URL and the corresponding focus input frame <input> needing to shield input method.Attribute-bit can be the property value of the <input> attributes such as name, ID and correspondence.Such as, email, regemail, username, user name etc. may be comprised for the name value of user name input frame in logon form.
, illustrate the content of object element best property of attribute mapping table below, in this object element best property of attribute mapping table, data are by following form:
Domain name=form ID=< father node mark >=<input name input frame name >=language ' second languages '=closeime ' whether close input method '
Www.renren.com=form11=< father node A>=<input name=email|regEmail>=
language’en’=closeime’true’
Www.renren.com=form11=< father node A ' >=<input name=password1>=
language’en’=closeime’true’
Mail.cn.yahoo.com=form12=< father node ' B ' >=<input name=login>=
language’de’=closeime’false’
After obtaining the focus element <input> Text Entry in window, mate with described object element best property of attribute mapping table according to the URL of current window and the name attribute of focus element <input>, if coupling, find corresponding input method option, if closeime=' is true ', shield current first languages input method.
Input method IME in the start-up conditions, usually can be presented in current main window in the mode of floating frame, cause main window partial content to be blocked, make troubles to the operation of user and use.Secondly, because the first languages in input method IME will be converted to the second languages to output in focus input frame by us, in conversion output procedure, shield current first languages input method, that can avoid user in use producing because input and output are different obscures.
Preferably, also comprise one or more lists in described preset object element best property of attribute mapping table, in described list, comprise two or more input frame element;
If only containing 1 Password Input frame in described list, and the input frame of the described Password Input frame subordinate brotgher of node is not Text Entry, then described list is logon form, and the second languages that in described list, all input frame elements are corresponding are English.
Preferably, if only containing 1 Password Input frame in described list, and the input frame of the described Password Input frame subordinate brotgher of node is Text Entry, then described list is enrollment form, and the second languages that in described list, all input frame elements are corresponding are English.
Preferably, if the Password Input frame only containing 2 positions continuously and each other brotgher of node in described list, then described list enrollment form, then described list is enrollment form, and the second languages that in described list, all input frame elements are corresponding be English.
Preferably, if the Password Input frame only containing 3 positions continuously and each other brotgher of node in described list, then described list is password amendment list, and the second languages that in described list, all input frame elements are corresponding be English.
The input frame meeting certain condition is set in same list, when using object element information MAP table to mate, can to Form Element priority processing.Further, if when the public attribute of a certain element in list is learned, identical operation can be used to all elements in this list, such as, in list form11, the element of password1 input frame needs to shield input method, just to the element Close All input method in this list form1, therefore, save a large amount of system losses.
For object element best property of attribute mapping table above, the element with identical formID is unify the element in list, has the element brotgher of node each other of identical father node.
Step 206, according to preset languages Code Mapping Tables, is converted to described Keyboard Message by keypad information corresponding to the second languages coding.
Step 207, exports the described keypad information by the second languages coding in described focus element.
Step 208, if described focus element loses focus, recovers the first languages input method.
After focus <input> input frame loses focus in window, recover original first languages input method and corresponding input method window, facilitate user to carry out other operations.
With reference to the description of above-described embodiment, under Chinese character coding input method starting state, the Chinese message conversion that user key-press inputs is that the English message output display of correspondence is in current focus input frame by shielding current Chinese input method simultaneously.In this course, except this mode of shielding input method, also can select shield current Chinese input method other opportunitys except selecting when button operation.
In another embodiment of the application, we obtain focus element and comprise: according to preset object element best property of attribute mapping table, obtain the object element in current window; Monitor described object element until described object element obtains focus become focus element.First, object element be found, then, carry out follow-up judgement process when this element obtains focus.Concrete, can to all input element registered events in the Document Complete event that document is corresponding, by attachEvent method registration onfous and onblur event, come with browser mutual by window.external in event, and allow browser go to judge whether to need to forbid current input method by the rule that the application proposes.
Based on above-mentioned shielding mode, the webpage dynamically generated is needed to consume higher system resource.If the element dynamics in webpage generates, to the event registration of input in webpage, need to catch in the onpropertychange event that document is corresponding.This process of repetition is needed especially for the iframe dynamically generated.Said method not only complexity is higher, and event triggers and code performs very frequent, and triggers owing to there is invalid event, causes system resources consumption comparatively greatly and can cause the very large wasting of resources.Such as, other actions a lot of such as focus element switching all can trigger onpropertychange event, and this can cause the code relevant with the application all can be performed when this event triggers at every turn, and wherein a lot of event is triggered concerning the application to be invalid, to cause system resource waste.
With reference to the description of above each embodiment, it is below another embodiment of a kind of control method to input data disclosed in the present application.
Owing to containing the nested sub-pages being nested content with <frame> or <iframe> framed structure in a lot of webpage, focus element is likely positioned at sub-pages.For this situation, when obtaining the focus element of window, the situation of main page and sub-pages to be considered respectively.In the following embodiments, we further illustrate the situation obtaining focus element when comprising nested subpage frame, and the focus element in described acquisition window comprises: the application programming interfaces object obtaining current window; The focus element obtained in current window by described application programming interfaces object is specifically comprised, and the method specifically comprises:
S101, the browser control part object IWebBrowser2 corresponding according to current html web page obtains HTML forms object IHTMLWindow2;
S102, HTML forms object IHTMLWindow2 obtains html document object IHTMLDocument2 by document object acquisition methods get_document;
S103, html document object IHTMLDocument2 obtains the focus element in described window in html web page by focus element acquisition methods get_activeElement.
Said process comprises further:
If HTML forms object IHTMLWindow2 cannot obtain html document object IHTMLDocument2 by document acquisition methods get_document, then first HTML forms object IHTMLWindow2 obtains the service support object IServiceProvider of current operation system, then obtain browser control part object IWebBrowser2 by described service support object IServiceProvider, finally obtain html document object IHTMLDocument2 based on described browser control part object IWebBrowser2.
Said process comprises further:
If the focus element that obtains is frame elements <frame> or inner frame element <iframe>, the frame foundation object IHTMLFrameBase2 corresponding by described <frame> or <iframe> obtains corresponding HTML forms object IHTMLWindow2; Repeat above-mentioned steps afterwards until without focus element in the focus element that gets in window or window.
Above the method that the application obtains focus element is further described, by implementing the method, the application can be made also successfully to obtain focus element to the window comprising complicated nested sub-pages, effectively improve adaptation of methods described in the application, provide the success ratio that method is implemented.
In above embodiment, we are take html web page as current window, the method that provides to describe the application for focus element for input input frame.In the embodiment introduced below, we realize controlling input data to the method that non-browser application window utilizes the application to provide.
So-called non-browser application window can be the multipad developed based on different development language, as Java, C# program, also can be Word, Excel etc. that we commonly use.When controlling the input of these application windows, its key is to want the focus element in energy Obtaining Accurate window.
For achieving the above object, first, first we obtain the application programming interfaces object of current window; Then, the focus element in current window is obtained by described application programming interfaces object.
For Excel, we obtain the focus element in Excel by the application programming interfaces VBA that Excel provides.In Excel, user can in the cell of Excel the data of the different-format such as input text, numeral, date, suppose when user inputs cell A1 when opening Chinese character coding input method, if we need in the display of this cell English, can operate the cell in excel by obtaining a Microsoft.Office.Interop.Excel.Range object in external application, such as:
Whether Worksheets (1) .Range (" A1 ") .Value carrys out judging unit lattice A1 is focus element.
After the focus of acquiring unit lattice, the Chinese message in current Keyboard Message is converted keypad information corresponding to English coding to by preset languages Code Mapping Tables, shielding current Chinese input method, simultaneously by the QWERTY keyboard information output display after described conversion in cell A1, after A1 loses focus, recover display current Chinese input method.
Better understand the content of the application for the ease of those skilled in the art, below in conjunction with concrete example and pseudo-code, a kind of data processing method to the application is described in further detail.
In this enforcement, when user's filling login information, under Chinese character coding input method state, if user inputs accounts information in user name input frame, then close current Chinese input method, the key information of user is converted to English output display in user name input frame; When user name input frame loses focus, recover Chinese character coding input method.Detailed process comprises:
First user key-press is judged, if Keyboard Message is Chinese, obtain focus input frame, according to object element best property of attribute mapping table coupling current focus input frame the need of shielding, if coupling, shielding input method, and conversion exports corresponding English character.
See example code below, wherein IsCurrentElement function is used for judging whether to need to forbid input method.
while(GetMessage(&msg,NULL,0,0))
To above-mentioned IsCurrentElement() explanation of function: the effect of this function is the name (or id) and the url that first obtain focus element, then judges whether to need to forbid input method according to the content of object element best property of attribute mapping table.Input method window is recovered by arranging onblur event after forbidding input method window.False code is as follows:
BOOL?IsCurrentElement()
{
1. if this element exists switching input method mark, then directly return FALSE, input Chinese to allow user.After such as user have input abc, automatically switch to input in Chinese again, we now arrange and switch input method mark.
2. obtain name (or id) and the url of focus element.
3. judging whether to need to forbid input method according to object element best property of attribute mapping table, returning FALSE if do not needed forbidding.
4., if need to forbid input method, hide input method window by ImmSetOpenStatus, so that the good experience making user obtain.
5. be that currentElement arranges onfocus and onblur event by the attachEvent method of IHTMLElement2 interface.In onfocus event, hide input method window, in onblur event, recover input method window.
6. return TRUE.
}
If this function is returned as TRUE, represents and hide input method window, and need forbidding input method message, then follow-up process can shield Chinese message, and forwards corresponding English character.
Describe a kind of control method to input data of the application by embodiment above, referring to the description of foregoing embodiments, a kind of control device to data input of the application is described.
Show the structural representation of a kind of control device to data input of the application see Fig. 3, Fig. 3, described device comprises:
Disclosed herein as well is a kind of control device to input data, comprising:
Keyboard Message blocking module 310, for tackling Keyboard Message, described Keyboard Message includes the first languages message;
Focus element acquisition module 320, for obtaining the focus element in current window;
Languages Code Mapping Tables 330, for storing the code conversion mapping relations of the first languages and the second languages;
Second languages acquisition module 340, for according to languages Code Mapping Tables, obtains the second languages carrying out inputting in focus element;
Keypad information modular converter 350, for being converted to by keypad information corresponding to the second languages coding by described Keyboard Message;
Keypad information output module 360, outputs in focus element for the keypad information produced by keypad information modular converter.
Preferably, also comprise:
Object element best property of attribute mapping table 370, for storing object element best property of attribute mapping relation;
Object element acquisition module 380, for obtaining the object element in current window according to object element best property of attribute mapping table;
Monitor module 390, for monitoring object element until described object element obtains focus become focus element.
Preferably, also comprise:
Press key message authentication module 400, for judging whether Keyboard Message comprises press key message, if do not comprise, notify keyboard message block module starts to tackle Keyboard Message.
Preferably, also comprise:
Focus element matching module 410, according to preset object element best property of attribute mapping table, coupling focus element, if do not mate, then notify keyboard message block module starts to tackle Keyboard Message.
Preferably, it is characterized in that, also comprise:
Input method shroud module 420, for shielding the first languages input method in current window.
Preferably, also comprise:
Input method recovery unit 430, drags focus element to lose focus for judging, recover in current window the first languages input method.
Preferably, it is characterized in that, also comprise:
Focus element in described current window is input frame element;
Described preset object element best property of attribute mapping table comprises webpage domain name or the window name of input frame attribute of an element mark and correspondence.
Preferably, also comprise one or more lists in described preset object element best property of attribute mapping table, comprise two or more input frame element in described list, described device also comprises:
Logon form configuration module 440, if for judging only there is 1 Password Input frame in current form, and the input frame of the described Password Input frame subordinate brotgher of node is not Text Entry, then configuring the second languages that in described list, all input frame elements are corresponding is English.
Preferably, described device also comprises:
First enrollment form configuration module 450, if for judging in described list only containing 1 Password Input frame, and the input frame of the described Password Input frame subordinate brotgher of node is Text Entry, then configuring the second languages that in described list, all input frame elements are corresponding is English.
Preferably, described device also comprises:
Second enrollment form configuration module 460, if for judging in described list the Password Input frame only containing 2 positions continuously and each other brotgher of node, then configures the second languages that in described list, all input frame elements are corresponding for English.
Preferably, described device also comprises:
Password amendment form configuration module 470, if for judging in described list the Password Input frame only containing 2 positions continuously and each other brotgher of node, then configures the second languages that in described list, all input frame elements are corresponding for English.
Preferably, also comprise:
Application programming interfaces object acquisition unit 480, for obtaining the application programming interfaces object of current window;
Described focus element acquisition module obtains the focus element in current window by described application programming interfaces object.
Preferably, described current window is html web page, and described focus element acquisition module 420 comprises:
HTML forms object acquisition unit 421, obtains HTML forms object for the browser control part object corresponding according to html web page;
Html document object acquisition unit 422, for obtaining html document object by HTML forms object;
First focus element acquiring unit 423, for obtaining the focus element in html web page by html document object.
Preferably, comprise further:
HTML forms object acquisition unit 424, if cannot obtain html document object for judging by HTML forms object, then HTML forms object obtains the service support object of current operation system;
Described service support object obtains browser control part object;
Described html document object is obtained based on described browser control part object.
Preferably, comprise further:
Frame elements authentication unit 490, frame elements/inner frame element for judging if by the described html document object focus element obtained in described html web page, by the HTML forms object that HTML frame foundation object acquisition that described frame elements/inner frame element is corresponding is corresponding.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar part mutually see.For system and/or device embodiment, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method.
Also it should be noted that, in this article, the such as relational terms of first and second grades and so on is only used for an entity or operation to separate with another entity or operational zone, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.
Above to a kind of control method and device to inputting data that the application provides, be described in detail, apply specific case herein to set forth the principle of the application and embodiment, the explanation of above embodiment is just for helping method and the core concept thereof of understanding the application; Meanwhile, for one of ordinary skill in the art, according to the thought of the application, all will change in specific embodiments and applications, in sum, this description should not be construed as the restriction to the application.

Claims (26)

1., to a control method for input data, it is characterized in that, comprising:
Interception Keyboard Message, described Keyboard Message includes the first languages message;
Judge whether described Keyboard Message comprises press key message, if do not comprise, then return and re-execute described interception Keyboard Message;
Obtain the focus element in current window;
According to preset object element best property of attribute mapping table, mate described focus element, if do not mate, then return and re-execute described interception Keyboard Message;
According to preset object element best property of attribute mapping table, obtain the second languages carrying out inputting in focus element;
According to preset languages Code Mapping Tables, described Keyboard Message is converted to by keypad information corresponding to the second languages coding;
Export the described keypad information by the second languages coding in described focus element.
2. the method for claim 1, is characterized in that, also comprises before described interception Keyboard Message:
According to preset object element best property of attribute mapping table, obtain the object element in current window;
Monitor described object element until described object element obtains focus become focus element.
3. the method as described in claim 1 to 2 any one claim, is characterized in that, also comprise:
The first languages input method in shielding current window.
4. method as claimed in claim 3, is characterized in that, also comprise:
If described focus element loses focus, recover the first languages input method in current window.
5. the method as described in claim 1 to 2 any one claim, is characterized in that,
Focus element in described current window is input frame element;
Described preset object element best property of attribute mapping table comprises webpage domain name or the window name of input frame attribute of an element mark and correspondence.
6. method as claimed in claim 5, it is characterized in that, also comprise one or more lists in described preset object element best property of attribute mapping table, comprise two or more input frame element in described list, described method also comprises:
If only containing 1 Password Input frame in described list, and the input frame of the described Password Input frame subordinate brotgher of node is not Text Entry, then the second languages that in described list, all input frame elements are corresponding are English.
7. method as claimed in claim 6, it is characterized in that, described method also comprises:
If only containing 1 Password Input frame in described list, and the input frame of the described Password Input frame subordinate brotgher of node is Text Entry, then the second languages that in described list, all input frame elements are corresponding are English.
8. method as claimed in claim 7, it is characterized in that, described method also comprises:
If the Password Input frame only containing 2 positions continuously and each other brotgher of node in described list, then the second languages that in described list, all input frame elements are corresponding be English.
9. method as claimed in claim 8, it is characterized in that, described method also comprises:
If the Password Input frame only containing 3 positions continuously and each other brotgher of node in described list, then the second languages that in described list, all input frame elements are corresponding be English.
10. the method for claim 1, is characterized in that, the focus element in described acquisition current window comprises:
Obtain the application programming interfaces object of current window;
The focus element in current window is obtained by described application programming interfaces object.
11. method as claimed in claim 10, it is characterized in that, described current window is html web page, and the described focus element obtained in current window by application programming interfaces object is comprised:
The browser control part object corresponding according to current html web page obtains HTML forms object;
Html document object is obtained by described HTML forms object;
The focus element in described html web page is obtained by described html document object.
12. methods as claimed in claim 11, is characterized in that, comprise further:
If cannot obtain html document object by HTML forms object, then HTML forms object obtains the service support object of current operation system;
Described service support object obtains browser control part object;
Described html document object is obtained based on described browser control part object.
13. methods as claimed in claim 12, is characterized in that, comprise further:
Frame elements/inner frame element if described by the described html document object focus element obtained in described html web page, by the HTML forms object that HTML frame foundation object acquisition that described frame elements/inner frame element is corresponding is corresponding.
14. 1 kinds, to the control device of input data, is characterized in that, comprising:
Keyboard Message blocking module, for tackling Keyboard Message, described Keyboard Message includes the first languages message;
Press key message authentication module, for judging whether Keyboard Message comprises press key message, if do not comprise, notify keyboard message block module starts to tackle Keyboard Message;
Focus element acquisition module, for obtaining the focus element in current window;
Focus element matching module, for according to preset object element best property of attribute mapping table, coupling focus element, if do not mate, then notify keyboard message block module starts to tackle Keyboard Message; Described preset object element best property of attribute mapping table, for storing object element best property of attribute mapping relation;
Second languages acquisition module, for according to preset object element best property of attribute mapping table, obtains the second languages carrying out inputting in focus element;
Keypad information modular converter, for according to preset languages Code Mapping Tables, is converted to by keypad information corresponding to the second languages coding by described Keyboard Message; Described languages Code Mapping Tables, for storing the code conversion mapping relations of the first languages and the second languages;
Keypad information output module, outputs in focus element for the keypad information produced by keypad information modular converter.
15. devices as claimed in claim 14, is characterized in that, also comprise:
Object element acquisition module, for according to preset object element best property of attribute mapping table, obtains the object element in current window;
Monitor module, for monitoring object element until described object element obtains focus become focus element.
16. devices as described in claim 14 to 15 any one claim, is characterized in that, also comprise:
Input method shroud module, for shielding the first languages input method in current window.
17. devices as claimed in claim 16, is characterized in that, also comprise:
Input method recovery unit, drags focus element to lose focus for judging, recover in current window the first languages input method.
18. devices as described in claim 14 to 15 any one claim, is characterized in that, also comprise:
Focus element in described current window is input frame element;
Described preset object element best property of attribute mapping table comprises webpage domain name or the window name of input frame attribute of an element mark and correspondence.
19. devices as claimed in claim 18, is characterized in that, also comprise one or more lists in described preset object element best property of attribute mapping table, comprise two or more input frame element in described list, described device also comprises:
Logon form configuration module, if for judging only there is 1 Password Input frame in current form, and the input frame of the described Password Input frame subordinate brotgher of node is not Text Entry, then configuring the second languages that in described list, all input frame elements are corresponding is English.
20. devices as claimed in claim 19, it is characterized in that, described device also comprises:
First enrollment form configuration module, if for judging in described list only containing 1 Password Input frame, and the input frame of the described Password Input frame subordinate brotgher of node is Text Entry, then configuring the second languages that in described list, all input frame elements are corresponding is English.
21. devices as claimed in claim 20, it is characterized in that, described device also comprises:
Second enrollment form configuration module, if for judging in described list the Password Input frame only containing 2 positions continuously and each other brotgher of node, then configures the second languages that in described list, all input frame elements are corresponding for English.
22. devices as claimed in claim 21, it is characterized in that, described device also comprises:
Password amendment form configuration module, if for judging in described list the Password Input frame only containing 2 positions continuously and each other brotgher of node, then configures the second languages that in described list, all input frame elements are corresponding for English.
23. devices as claimed in claim 14, is characterized in that, also comprise:
Application programming interfaces object acquisition unit, for obtaining the application programming interfaces object of current window;
Described focus element acquisition module obtains the focus element in current window by described application programming interfaces object.
24. devices as claimed in claim 23, it is characterized in that, described current window is html web page, and described focus element acquisition module comprises:
HTML forms object acquisition unit, obtains HTML forms object for the browser control part object corresponding according to html web page;
Html document object acquisition unit, for obtaining html document object by HTML forms object;
First focus element acquiring unit, for obtaining the focus element in html web page by html document object.
25. devices as claimed in claim 24, is characterized in that, comprise further:
HTML forms object acquisition unit, if cannot obtain html document object for judging by HTML forms object, then HTML forms object obtains the service support object of current operation system;
Described service support object obtains browser control part object;
Described html document object is obtained based on described browser control part object.
26. devices as claimed in claim 25, is characterized in that, comprise further:
Frame elements authentication unit, frame elements/inner frame element for judging if by the described html document object focus element obtained in described html web page, by the HTML forms object that HTML frame foundation object acquisition that described frame elements/inner frame element is corresponding is corresponding.
CN201210094098.2A 2012-03-31 2012-03-31 Method and device for controlling input data Active CN102651023B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210094098.2A CN102651023B (en) 2012-03-31 2012-03-31 Method and device for controlling input data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210094098.2A CN102651023B (en) 2012-03-31 2012-03-31 Method and device for controlling input data

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN201410751711.2A Division CN104504005A (en) 2012-03-31 2012-03-31 Method and device for controlling input data

Publications (2)

Publication Number Publication Date
CN102651023A CN102651023A (en) 2012-08-29
CN102651023B true CN102651023B (en) 2015-01-07

Family

ID=46693031

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210094098.2A Active CN102651023B (en) 2012-03-31 2012-03-31 Method and device for controlling input data

Country Status (1)

Country Link
CN (1) CN102651023B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105528342A (en) * 2015-12-29 2016-04-27 科大讯飞股份有限公司 Intelligent translation method and system in input method
CN107992457B (en) * 2017-12-01 2021-12-03 深圳乐信软件技术有限公司 Information conversion method, device, terminal equipment and storage medium
CN108563486B (en) * 2018-04-26 2022-02-25 广州品唯软件有限公司 Cursor control method and device
CN112364269B (en) * 2020-11-24 2023-08-22 中国电子科技集团公司第十五研究所 Method for creating WebApp graphic application based on URL

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5862383A (en) * 1996-11-27 1999-01-19 Nokia Research Center Generation of code by graphical representation
CN1858701A (en) * 2006-05-29 2006-11-08 无锡永中科技有限公司 Realizing method for on-screen aid
CN101706690A (en) * 2009-12-07 2010-05-12 北京搜狗科技发展有限公司 Adaptive input method and adaptive input system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102207816B (en) * 2010-07-16 2017-04-19 北京搜狗科技发展有限公司 Method for performing adaptive input based on input environment, and input method system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5862383A (en) * 1996-11-27 1999-01-19 Nokia Research Center Generation of code by graphical representation
CN1858701A (en) * 2006-05-29 2006-11-08 无锡永中科技有限公司 Realizing method for on-screen aid
CN101706690A (en) * 2009-12-07 2010-05-12 北京搜狗科技发展有限公司 Adaptive input method and adaptive input system

Also Published As

Publication number Publication date
CN102651023A (en) 2012-08-29

Similar Documents

Publication Publication Date Title
CN101847100B (en) Method for expanding software application and device
US9690779B2 (en) Quasi natural language man-machine conversation device base on semantic logic
CN105518633B (en) More equipment in Web server system, application and development auxiliary system, the multi-language support method in Web server system, Web server system support method and application and development householder method
US20070288853A1 (en) Software, methods and apparatus facilitating presentation of a wireless communication device user interface with multi-language support
US20100324887A1 (en) System and method of online user-cycled web page vision instant machine translation
CN109144567B (en) Cross-platform webpage rendering method and device, server and storage medium
CN103324613A (en) System and method for automatic language translation for applications
CA2428821C (en) Accessing a platform independent input method editor from an underlying operating system
US20070078925A1 (en) Porting an interface defining document between mobile device platforms
CN102651023B (en) Method and device for controlling input data
CN102129364A (en) Method for embedding widget toolbar in application program and rapid widget accessing method
CN101882007A (en) Method and device for carrying out information input and execution based on input interface
CN102520966B (en) Method for prompting codes and device
CN103383645A (en) Code generation method and system
CN103268361A (en) Extracting method, device and system of hidden URL (Uniform Resource Locator) in webpage
CN108304172A (en) A kind of web development approaches and web develop engine
CN102087577A (en) Location independent execution of user interface operations
KR102550540B1 (en) Landing page processing method, device, equipment and medium
CN101957756A (en) System and method for rapidly generating intelligent mobile terminal program
CN109656951A (en) Method and inquiry system based on expression formula inquiry data
US20120254712A1 (en) Map Service
CN112328342A (en) To-do item processing method and device based on online document
CN101488154A (en) Words input implementing method used for web page
CN109446454A (en) A kind of high performance PHPWeb system framework of lightweight and working method
CN104504005A (en) Method and device for controlling input data

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: QIZHI SOFTWARE (BEIJING) CO., LTD.

Effective date: 20121108

Owner name: BEIJING QIHU TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: QIZHI SOFTWARE (BEIJING) CO., LTD.

Effective date: 20121108

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 100016 CHAOYANG, BEIJING TO: 100088 XICHENG, BEIJING

TA01 Transfer of patent application right

Effective date of registration: 20121108

Address after: 100088 Beijing city Xicheng District xinjiekouwai Street 28, block D room 112 (Desheng Park)

Applicant after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Applicant after: Qizhi software (Beijing) Co.,Ltd.

Address before: The 4 layer 100016 unit of Beijing city Chaoyang District Jiuxianqiao Road No. 14 Building C

Applicant before: Qizhi software (Beijing) Co.,Ltd.

C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220727

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.