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

Method and device for controlling input data Download PDF

Info

Publication number
CN102651023A
CN102651023A CN2012100940982A CN201210094098A CN102651023A CN 102651023 A CN102651023 A CN 102651023A CN 2012100940982 A CN2012100940982 A CN 2012100940982A CN 201210094098 A CN201210094098 A CN 201210094098A CN 102651023 A CN102651023 A CN 102651023A
Authority
CN
China
Prior art keywords
input frame
languages
focus
html
list
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.)
Granted
Application number
CN2012100940982A
Other languages
Chinese (zh)
Other versions
CN102651023B (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
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 Qizhi Software Beijing Co Ltd filed Critical Qizhi Software Beijing 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

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

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 and device to the input data
Technical field
The application relates to data input technology field, particularly relates to a kind of control method and device to the input data.
Background technology
Internet technology has deeply influenced people's life at present, has also become a part indispensable in people's routine work and the amusement such as E-mail address, forum, web game etc.Above-mentioned internet, applications could be used after needing the user to register and login mostly.In most cases, mostly user name is to be made up of English alphabet and character, when the user logins on the page or registers, often need specially switch to English input method when inputing user name, uses very inconvenience.
In order to improve the convenience of user's input; The above browser of IE5.0 version provides the cascade CSS relevant with an input method (Cascading Style Sheet in the prior art; CSS) attribute ime-mode; Be used to be provided with or retrieve input method (Input Method Editor, IME) state that whether allows user activation input Chinese, Korean, Japanese etc.Its value is auto, active, and inactive or disabled, the value meaning is following.Auto: do not influence the state of IME, identical when not specifying the ime-mode attribute; Active: original state activates the native language input method, and the user still can manually cancel and activate IME; Inactive: initial native language input method is in unactivated state, and the user still can manually activate IME.Disabled: forbid IME fully, for focal control (like input frame), the user cannot activate IME.Its corresponding script characteristic is imeMode.The section of being is used the code sample of IME attribute below:
Common input frame: < input type=" text " style=" width:190px; "
Only can import English input frame: < input type=" text " style=" width:190px; Ime-mode:disabled; "
Though above-mentioned prior art can be utilized the input method of ime-mode attribute shielding input frame, third party's browsers such as following version of IE5.0 and red fox all can't be supported the ime-mode attribute, can't realize browser-safe, cause the processing failure to input method.
In a word, need the urgent technical matters that solves of those skilled in the art to be exactly: how can guarantee under the situation of browser-safe, to realize to the input method shielding processing.
Summary of the invention
The application's technical matters to be solved provides a kind of control method and device to the input data; So that adapting under the situation of different browsers, convert the Chinese key information of user's input into corresponding English output and be shown in the focus element in the window.
In order to address the above problem, the application discloses a kind of control method to the input data, comprising:
Interception keyboard message, said keyboard message includes the first languages message;
Obtain the focus element in the current window;
According to the object element best property of attribute mapping table that presets, obtain second languages of in focus element, importing;
According to the languages coding mapping table that presets, said keyboard message conversion is the corresponding keypad information of encoding by second languages;
Export the said keypad information of pressing second languages coding in said focus element.
Preferably, before said interception keyboard message, also comprise:
Object element best property of attribute mapping table according to presetting obtains the object element in the current window;
Monitor said object element and become focus element up to said object element acquisition focus.
Preferably, also comprise after the said interception keyboard message:
Judge whether said keyboard message comprises press key message,, then return and carry out again said interception keyboard message if do not comprise.
Preferably, also comprise after the said focus element that obtains in the window:
Object element best property of attribute mapping table according to presetting matees said focus element, if do not match, then returns and carry out again said interception keyboard message.
Preferably, also comprise:
The first languages input method in the shielding current window.
Preferably, also comprise:
If said focus element loses focus, recover the first languages input method in the current window.
Preferably, it is characterized in that,
Focus element in the said current window is the input frame element;
Comprise input frame attribute of an element sign and corresponding webpage domain name or window name in the said object element best property of attribute mapping table that presets.
Preferably, also comprise one or more lists in the said object element best property of attribute mapping table that presets, comprise two or more input frame elements in the said list, said method also comprises:
If only contain 1 password input frame in the said list, and the input frame of the said password input frame subordinate brotgher of node is not the text input frame, and second languages that all input frame elements are corresponding in the then said list be English.
Preferably, said method also comprises:
If only contain 1 password input frame in the said list, and the input frame of the said password input frame subordinate brotgher of node is the text input frame, and second languages that all input frame elements are corresponding in the then said list be English.
Preferably, said method also comprises:
If only contain 2 positions password input frame of the brotgher of node continuously and each other in the said list, second languages that all input frame elements are corresponding in the then said list be English.
Preferably, said method also comprises:
If only contain 3 positions password input frame of the brotgher of node continuously and each other in the said list, second languages that all input frame elements are corresponding in the then said list be English.
Preferably, the said focus element that obtains in the current window comprises:
Obtain the application programming interfaces object of current window;
Obtain the focus element in the current window through said application programming interfaces object.
Preferably, said current window is a html web page, and the said focus element that obtains in the current window through the application programming interfaces object comprises:
Obtain HTML forms object according to the corresponding browser control part object of current html web page;
Obtain the html document object through said HTML forms object;
Obtain the focus element in the said html web page through said html document object.
Preferably, further comprise:
If can't obtain the html document object through HTML forms object, then HTML forms object obtains the service support object of current operation system;
Said service support object obtains the browser control part object;
Obtain said html document object based on said browser control part object.
Preferably, further comprise:
If the said focus element that obtains in the said html web page through said html document object is framework element/inner frame element, through the corresponding corresponding HTML forms object of HTML frame foundation object acquisition of said framework element/inner frame element.
For addressing the above problem, disclosed herein as well is a kind of control device to the input data, comprising:
Keyboard message block module is used to tackle keyboard message, and said keyboard message includes the first languages message;
The focus element acquisition module is used for obtaining the focus element of current window;
Languages codings mapping table is used to store the code conversion mapping relations of first languages and second languages;
The second languages acquisition module is used for obtaining second languages of in focus element, importing according to languages coding mapping table;
The keypad information modular converter is used for said keyboard message conversion is the keypad information by second languages coding correspondence;
The keypad information output module is used for the keypad information that the keypad information modular converter is produced is outputed to focus element.
Preferably, also comprise:
Object element best property of attribute mapping table is used to store object element best property of attribute mapping relation;
The object element acquisition module is used for obtaining according to object element best property of attribute mapping table the object element of current window;
Monitor module, being used for the intercept target element becomes focus element up to said object element acquisition focus.
Preferably, also comprise:
The press key message authentication module is used to judge whether keyboard message comprises press key message, if do not comprise, notify keyboard message block module begins to tackle keyboard message.
Preferably, also comprise:
The focus element matching module, according to the object element best property of attribute mapping table that presets, the coupling focus element, if do not match, then notify keyboard message block module begins to tackle keyboard message.
Preferably, it is characterized in that, also comprise:
The input method shroud module is used for shielding the first languages input method of current window.
Preferably, also comprise:
The input method recovery unit is used for judging and drags focus element to lose focus, recover in the current window the first languages input method.
Preferably, it is characterized in that, also comprise:
Focus element in the said current window is the input frame element;
Comprise input frame attribute of an element sign and corresponding webpage domain name or window name in the said object element best property of attribute mapping table that presets.
Preferably, also comprise one or more lists in the said object element best property of attribute mapping table that presets, comprise two or more input frame elements in the said list, said device also comprises:
The logon form configuration module is used for judging if current list only has 1 password input frame, and the input frame of the said password input frame subordinate brotgher of node is not the text input frame, then disposes all input frame elements are corresponding in the said list second languages for English.
Preferably, said device also comprises:
The first enrollment form configuration module is used for judging if said list only contains 1 password input frame; And the input frame of the said password input frame subordinate brotgher of node is the text input frame, then disposes all input frame elements are corresponding in the said list second languages for English.
Preferably, said device also comprises:
The second enrollment form configuration module is used for judging if said list only contains 2 positions password input frame of the brotgher of node continuously and each other, then disposes all input frame elements are corresponding in the said list second languages for English.
Preferably, said device also comprises:
Password is revised the list configuration module, is used for judging if said list only contains 2 positions password input frame of the brotgher of node continuously and each other, then disposes all input frame elements are corresponding in the said list second languages for English.
Preferably, also comprise:
Application programming interfaces object acquisition unit is used to obtain the application programming interfaces object of current window;
Said focus element acquisition module obtains the focus element in the current window through said application programming interfaces object.
Preferably, said current window is a html web page, and said focus element acquisition module comprises:
HTML forms object acquisition unit is used for obtaining HTML forms object according to the corresponding browser control part object of html web page;
Html document object acquisition unit is used for obtaining the html document object through HTML forms object;
The first focus element acquiring unit is used for the focus element through html document object acquisition html web page.
Preferably, further comprise:
HTML forms object acquisition unit, if being used for judging can't obtain the html document object through HTML forms object, then HTML forms object obtains the service support object of current operation system;
Said service support object obtains the browser control part object;
Obtain said html document object based on said browser control part object.
Preferably, further comprise:
Framework element authentication unit; Be used for judging if the focus element that obtains said html web page through said html document object is framework element/inner frame element, through the corresponding corresponding HTML forms object of HTML frame foundation object acquisition of said framework element/inner frame element.
Compared with prior art, the application has the following advantages:
In the prior art, the ime-mode shielding input method through < input>input frame can't be supported all browsers, and needs the developer to be solidificated in the web page files with the mode of the code ime-mode attribute with input frame.To this problem, we propose: interception keyboard message, if this keyboard message is press key message, the languages information output that then the original languages information translation one-tenth in the press key message of active user's input is needed is presented in the focus element in the current window.So, not only can adapt to the browser of all versions, and need not web page files is made any modification, solve the problems referred to above effectively, improve user's input and experienced.
Description of drawings
Fig. 1 is the schematic flow sheet of embodiment one of a kind of control method to the input data of the application;
Fig. 2 is the schematic flow sheet of embodiment two of a kind of control method to the input data of the application;
Fig. 3 is the structural representation of the embodiment one of a kind of control device of importing data of the application.
Embodiment
For above-mentioned purpose, the feature and advantage that make the application can be more obviously understandable, the application is done further detailed explanation below in conjunction with accompanying drawing and embodiment.
With reference to Fig. 1, show the schematic flow sheet of embodiment one of a kind of control method to the input data of the application.Said method comprises:
Step 101, interception keyboard message, said keyboard message includes the first languages message.
The window interception is from the message of keyboard.Window can be browser window, software window or other Any Application windows.
Because window is a current thread, so all message of current keyboard operation all can be passed through window.
With the browser is example, and the flow process of the message that produces is roughly following when the user knocks on the webpage of keyboard in browser window input Chinese:
It is Chinese → browser → be shown in the input frame with the keyboard message conversion that button operation produces keyboard message → browser → operating system → input method → input method.
Data flow is following among the application:
Button operation produces keyboard message → browser → browser the keyboard message conversion is shown for the keypad information → browser output by second languages coding correspondence.
Both no longer carried out the subsequent step of existing procedure when browser window is intercepted keyboard message and handled, this keyboard message no longer is passed to operating system.
Step 102 is obtained the focus element in the current window.
Focus element in the current window is exactly the corresponding element in current cursor focus position, and this element can be the optional position in input frame, check box, combobox, certain character text or certain file window in the webpage etc.
Step 103 according to the object element best property of attribute mapping table that presets, obtains second languages of in focus element, importing.
Store the attribute information relevant in the said object element best property of attribute mapping table with object element, for example this element position, name, second languages that will change, whether shield map informations such as input method.
Preferably, the focus element in the said current window is the input frame element; Comprise input frame attribute of an element sign and corresponding webpage domain name or window name in the said object element best property of attribute mapping table that presets.
After from webpage, getting access to the focus input frame; Extract the name property value of this input frame and the URL of input frame place webpage, mate at object element best property of attribute mapping table according to these two information then, if mate successfully; From object element best property of attribute mapping table, extract the correlation attribute information of current focus input frame and second languages that will change; If the coupling failure, expression current focus input frame need not to carry out the languages conversion not in object element best property of attribute mapping table.
Step 104 according to the languages coding mapping table that presets, is the corresponding keypad information of encoding by second languages with said keyboard message conversion.
Said languages coding mapping table has comprised the mapping relations that said first languages are encoded and second languages coding is changed.
First languages and second languages are two corresponding languages, and wherein the particular content of languages can be decided in its sole discretion according to the enforcement needs, and for example first languages and second languages can be respectively Chinese and English, Chinese and German, French and Spanish etc.
Step 105 is exported the said keypad information of pressing second languages coding in said focus element.
The user implements button operation under the first languages input method status; Window obtains can comprise the first languages message in the keyboard message from keyboard; According to languages coding mapping table said keyboard message conversion is the keypad information by second languages coding correspondence then, exports the said keypad information of pressing second languages coding at last in said focus element.
Referring to Fig. 2, Fig. 2 shows the schematic flow sheet of embodiment two of a kind of control method to the input data of the application.Said method specifically comprises:
Step 201, interception keyboard message, said keyboard message comprises the first languages message.
Behind the button in knocking keyboard, comprise two press key messages of WM_KEYDOWN and WM_KEYUP in the keyboard message of generation.
Under different input method status, the WM_KEYDOWN message of sending behind the button, its corresponding wParam value is different.For example, the button under the English state sends WM_KEYDOWN message, and its wParam is the corresponding Virtual Key of button.Button under the Chinese state also can send WM_KEYDOWN message, but its wParam is VK_PROCESSKEY.With first languages serves as that Chinese is given an example:
If the wParam property value of current press key message equals VK_PROCESSKEY, comprise Chinese message in the so current press key message, otherwise, abandon current keyboard message and tackle new keyboard message.
Do not comprise the first languages message in the keyboard message, explain that the first languages input method does not start or do not produce the corresponding first languages message.For example, press numerical key under the Chinese character coding input method starting state, the wParam of press key message is not equal to VK_PROCESSKEY, and this moment interrupts subsequent treatment so that conserve system resources as far as possible.
Step 202 if said keyboard message does not comprise press key message, is then returned step 201.
Behind the button in knocking keyboard, comprise two press key messages of WM_KEYDOWN and WM_KEYUP in the keyboard message of generation.If comprise any in above-mentioned two message in the keyboard message, mean that then the user has implemented the action of keyboard, otherwise, then return step 201 and carry out interception keyboard message again.
Step 203 is obtained the focus element in the current window.
Step 204 according to the object element best property of attribute mapping table that presets, obtains second languages of in focus element, importing.
Step 205, the object element best property of attribute mapping table according to presetting matees said focus element, if coupling then shields the first languages input method in the said window.
Whether object element best property of attribute mapping table storage focus element need shield the mapping relations of the first languages input method.
Preferably, said focus element is < input>text input frame; Comprise the webpage domain name URL of needs shielding input method and the attribute-bit of corresponding focus input frame < input>in the said object element best property of attribute mapping table that presets.Attribute-bit can be < input>attribute and corresponding property values such as name, ID.For example, the name value for user name input frame in the logon form possibly comprise email, regemail, username, user name etc.
Below, illustrating the content of object element best property of attribute mapping table, data are by following form in this object element best property of attribute mapping table:
Domain name=form ID=< father node sign >=< 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 focus element < input>the text input frame in the window; Mate according to the URL of current window and the name attribute and the said object element best property of attribute mapping table of focus element < input >; If coupling; Find corresponding input method option, if closeime ' true ' then shields the current first languages input method.
Input method IME can be presented in the current main window with the mode of floating frame under starting state usually, causes the main window partial content to be blocked, and makes troubles for user's operation and use.Secondly; Because we will convert first languages among the input method IME into second languages to output in the focus input frame; The current first languages input method of shielding in the conversion output procedure can avoid the user in use because of different the obscuring of producing of input and output.
Preferably, also comprise one or more lists in the said object element best property of attribute mapping table that presets, comprise two or more input frame elements in the said list;
If only contain 1 password input frame in the said list, and the input frame of the said password input frame subordinate brotgher of node is not the text input frame, and then said list is a logon form, and second languages that all input frame elements are corresponding in the said list be English.
Preferably, if only contain 1 password input frame in the said list, and the input frame of the said password input frame subordinate brotgher of node is the text input frame, and then said list is an enrollment form, and second languages that all input frame elements are corresponding in the said list be English.
Preferably, if only contain 2 positions password input frame of the brotgher of node continuously and each other in the said list, then said list enrollment form, then said list is an enrollment form, second languages that all input frame elements are corresponding in the said list be English.
Preferably, if only contain 3 positions password input frame of the brotgher of node continuously and each other in the said list, then said list is that password is revised list, and second languages that all input frame elements are corresponding in the said list be English.
The input frame that satisfies certain condition is set in the same list, when using object element information mapping table to mate, but his-and-hers watches single element priority processing.Further; When if the public attribute of a certain element in the list is known, can use identical operations to all elements in this list, for example; The element of password1 input frame need shield input method among the list form11; Just, therefore, saved a large amount of system losses to the element Close All input method among this list form1.
Object element best property of attribute mapping table with top is an example, and the element with identical formID is the element in the unified list, and the element with identical father node is the brotgher of node each other.
Step 206 according to the languages coding mapping table that presets, is the corresponding keypad information of encoding by second languages with said keyboard message conversion.
Step 207 is exported the said keypad information of pressing second languages coding in said focus element.
Step 208 if said focus element loses focus, is recovered the first languages input method.
After focus in the window < input>input frame loses focus, recover original first languages input method and corresponding input method window, make things convenient for the user to carry out other operations.
With reference to the description of the foregoing description, under the Chinese character coding input method starting state, shield current Chinese character coding input method, the Chinese message conversion with the user key-press input is shown in the current focus input frame for corresponding English message output simultaneously.In this course, except this mode of time shielding input method that is chosen in button operation, also can select to shield other opportunitys current Chinese character coding input method.
In another embodiment of the application, we obtain focus element and comprise: the object element best property of attribute mapping table according to presetting, obtain the object element in the current window; Monitor said object element and become focus element up to said object element acquisition focus.At first, find object element, then, when this element obtains focus, carry out follow-up judgment processing.Concrete; Can be to all input element registered events in the corresponding Document Complete incident of document; Through attachEvent method registration onfous and onblur incident; Next mutual through window.external in incident with browser, and the rule that lets browser propose by the application goes to judge whether to need the current input method of forbidding.
Based on above-mentioned shielding mode, need consume the higher system resource for the webpage of dynamic generation.If the element in the webpage dynamically generates,, need in the corresponding onpropertychange incident of document, catch the event registration of input in the webpage.Iframe for dynamic generation needs this process of repetition especially.Said method not only complexity is higher, and Event triggered and code are carried out very frequent, and owing to there is invalid Event triggered, causes system resources consumption big and can cause the very big wasting of resources.For example; A lot of other actions such as focus element switching all can trigger the onpropertychange incident; And this can cause the code relevant with the application when this incident triggers at every turn, all can be performed, and wherein a lot of incident to be triggered to the application be invalid, cause system resource waste.
With reference to the description of above each embodiment, below be another embodiment of the disclosed a kind of control method to the input data of the application.
Because having comprised nested in a lot of webpages is the sub-pages of nested content with < frame>or < iframe>framed structure, focus element might be positioned at sub-pages.For this situation, when obtaining the focus element of window, consider the situation of main page and sub-pages respectively.Among the embodiment below, the situation that we obtain focus element when comprising nested subpage frame further specifies, and the said focus element that obtains in the window comprises: the application programming interfaces object that obtains current window; The focus element that obtains in the current window through said application programming interfaces object comprises that specifically this method specifically comprises:
S101 obtains HTML forms object IHTMLWindow2 according to the corresponding browser control part object IWebBrowser2 of current html web page;
S102, HTML forms object IHTMLWindow2 obtains html document object IHTMLDocument2 through document object acquisition methods get_document;
S103, html document object IHTMLDocument2 obtains the focus element in the html web page in the said window through focus element acquisition methods get_activeElement.
Said process further comprises:
If HTML forms object IHTMLWindow2 can't obtain html document object IHTMLDocument2 through document acquisition methods get_document; Then HTML forms object IHTMLWindow2 at first obtains the service support object IServiceProvider of current operation system; Obtain browser control part object IWebBrowser2 by said service support object IServiceProvider then, obtain html document object IHTMLDocument2 based on said browser control part object IWebBrowser2 at last.
Said process further comprises:
If the focus element that obtains is framework element < frame>or inner frame element < iframe >, obtain corresponding HTML forms object IHTMLWindow2 through said < frame>or < iframe>corresponding frame foundation object IHTMLFrameBase2; Repeating does not afterwards have focus element in focus element or the window of above-mentioned steps in getting access to window.
More than the application is obtained focus element method done further explain; Through implementing this method; Can make the application also can successfully obtain focus element to the window that comprises complicated nested sub-pages; Effectively improved the said adaptation of methods property of the application, the success ratio that provides method to implement.
Among the above embodiment, we are is current window with the html web page, be that focus element is that example is described the method that the application is provided with the input input frame.Among the embodiment that introduces below, the method that we utilize the application to provide to the non-browser application window realizes the input data are controlled.
So-called non-browser application window can be based on the multipad that different development language is developed, and like Java, C# program, also can be our Word of using always, Excel etc.When these application window inputs were controlled, its key was to want accurately to obtain the focus element in the window.
For realizing above-mentioned purpose, at first, we at first obtain the application programming interfaces object of current window; Then, obtain the focus element in the current window through said application programming interfaces object.
With Excel is example, and we obtain the focus element among the Excel through the application programming interfaces VBA that Excel provides.In Excel; The user can be in the cell of Excel the data of different-formats such as input text, numeral, date; Suppose under the situation of unlatching Chinese character coding input method, cell A1 to be imported as the user; If it is English that we need show at this cell, externally come the cell among the excel is operated through obtaining a Microsoft.Office.Interop.Excel.Range object in the application program, for example:
Worksheets (1) .Range (" A1 ") .Value comes whether judging unit lattice A1 is focus element.
After the focus of acquiring unit lattice; Convert the Chinese message in the current keyboard message to English coding corresponding keypad information by the languages coding mapping table that presets; Shield current Chinese character coding input method; Simultaneously the output of the QWERTY keyboard information after the said conversion is shown among the cell A1, after A1 loses focus, recovers to show current Chinese character coding input method.
Better understand the application's content for the ease of those skilled in the art, a kind of data processing method of the application is done describing in further detail below in conjunction with concrete example and pseudo-code.
During this is implemented, when user's filling login information, under the Chinese character coding input method state,, then close current Chinese character coding input method, convert press key message sent by user into English output and be presented in the user name input frame if the user imports accounts information in the user name input frame; When the user name input frame loses focus, recover Chinese character coding input method.Detailed process comprises:
At first user key-press is judged,, obtained the focus input frame, whether need do shielding according to object element best property of attribute mapping table coupling current focus input frame if keyboard message is Chinese, if coupling, shielding input method, and the corresponding English character of conversion output.
Referring to following example code, wherein the IsCurrentElement function is used for judging whether forbidding input method.
Figure BDA0000149664530000141
Figure BDA0000149664530000151
Explanation to above-mentioned IsCurrentElement () function: the effect of this function is name (or id) and the url that at first obtains focus element, and the content according to object element best property of attribute mapping table judges whether needs forbidding input method then.Through being set, the onblur incident recovers the input method window behind the forbidding input method window.False code is following:
BOOL?IsCurrentElement()
{
1. if there is switching input method mark in this element, then direct return false is imported Chinese to allow the user.After having imported abc such as the user, automatically switch to input in Chinese again, we are provided with at this moment switches the input method mark.
2. obtain the name (or id) and the url of focus element.
3. judge whether needs forbidding input method according to object element best property of attribute mapping table, as not forbidding return false.
4. forbid input method if desired, hide the input method window through ImmSetOpenStatus, so that the good experience that the user is obtained.
5. the attachEvent method through the IHTMLElement2 interface is that currentElement is provided with onfocus and onblur incident.In the onfocus incident, hide the input method window, recover the input method window in the onblur incident.
6. return true.
}
If this function is returned as TRUE, the input method window has been hidden in expression, and needs forbidding input method message, and then follow-up processing can shield Chinese message, and transmits corresponding English character.
More than through embodiment a kind of control method to the input data of the application has been described, with reference to the description of preceding text embodiment, a kind of control device to the data input of the application is described below.
Referring to Fig. 3, Fig. 3 shows the structural representation of a kind of control device to data inputs of the application, and said device comprises:
Disclosed herein as well is a kind of control device, comprising the input data:
Keyboard message block module 310 is used to tackle keyboard message, and said keyboard message includes the first languages message;
Focus element acquisition module 320 is used for obtaining the focus element of current window;
Languages codings mapping table 330 is used to store the code conversion mapping relations of first languages and second languages;
The second languages acquisition module 340 is used for obtaining second languages of in focus element, importing according to languages coding mapping table;
Keypad information modular converter 350 is used for said keyboard message conversion is the keypad information by second languages coding correspondence;
Keypad information output module 360 is used for the keypad information that the keypad information modular converter is produced is outputed to focus element.
Preferably, also comprise:
Object element best property of attribute mapping table 370 is used to store object element best property of attribute mapping relation;
Object element acquisition module 380 is used for obtaining according to object element best property of attribute mapping table the object element of current window;
Monitor module 390, being used for the intercept target element becomes focus element up to said object element acquisition focus.
Preferably, also comprise:
Press key message authentication module 400 is used to judge whether keyboard message comprises press key message, if do not comprise, notify keyboard message block module begins to tackle keyboard message.
Preferably, also comprise:
Focus element matching module 410, according to the object element best property of attribute mapping table that presets, the coupling focus element, if do not match, then notify keyboard message block module begins to tackle keyboard message.
Preferably, it is characterized in that, also comprise:
Input method shroud module 420 is used for shielding the first languages input method of current window.
Preferably, also comprise:
Input method recovery unit 430 is used for judging and drags focus element to lose focus, recover in the current window the first languages input method.
Preferably, it is characterized in that, also comprise:
Focus element in the said current window is the input frame element;
Comprise input frame attribute of an element sign and corresponding webpage domain name or window name in the said object element best property of attribute mapping table that presets.
Preferably, also comprise one or more lists in the said object element best property of attribute mapping table that presets, comprise two or more input frame elements in the said list, said device also comprises:
Logon form configuration module 440; Be used for judging if current list only has 1 password input frame; And the input frame of the said password input frame subordinate brotgher of node is not the text input frame, then disposes all input frame elements are corresponding in the said list second languages for English.
Preferably, said device also comprises:
The first enrollment form configuration module 450; Be used for judging if said list only contains 1 password input frame; And the input frame of the said password input frame subordinate brotgher of node is the text input frame, then disposes all input frame elements are corresponding in the said list second languages for English.
Preferably, said device also comprises:
The second enrollment form configuration module 460 is used for judging if said list only contains 2 positions password input frame of the brotgher of node continuously and each other, then disposes all input frame elements are corresponding in the said list second languages for English.
Preferably, said device also comprises:
Password is revised list configuration module 470, is used for judging if said list only contains 2 positions password input frame of the brotgher of node continuously and each other, then disposes all input frame elements are corresponding in the said list second languages for English.
Preferably, also comprise:
Application programming interfaces object acquisition unit 480 is used to obtain the application programming interfaces object of current window;
Said focus element acquisition module obtains the focus element in the current window through said application programming interfaces object.
Preferably, said current window is a html web page, and said focus element acquisition module 420 comprises:
HTML forms object acquisition unit 421 is used for obtaining HTML forms object according to the corresponding browser control part object of html web page;
Html document object acquisition unit 422 is used for obtaining the html document object through HTML forms object;
The first focus element acquiring unit 423 is used for the focus element through html document object acquisition html web page.
Preferably, further comprise:
HTML forms object acquisition unit 424, if being used for judging can't obtain the html document object through HTML forms object, then HTML forms object obtains the service support object of current operation system;
Said service support object obtains the browser control part object;
Obtain said html document object based on said browser control part object.
Preferably, further comprise:
Framework element authentication unit 490; Be used for judging if the focus element that obtains said html web page through said html document object is framework element/inner frame element, through the corresponding corresponding HTML forms object of HTML frame foundation object acquisition of said framework element/inner frame element.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed all is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.For system and/or device embodiment, because it is similar basically with method embodiment, so description is fairly simple, relevant part gets final product referring to the part explanation of method embodiment.
Also need to prove; In this article; Relational terms such as first and second grades only is used for an entity or operation are made a distinction with another entity or operation, and not necessarily requires or hint relation or the order that has any this reality between these entities or the operation.
More than to the application provided a kind of control method and device to the input data; Carried out detailed introduction; Used concrete example among this paper the application's principle and embodiment are set forth, the explanation of above embodiment just is used to help to understand the application's method and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to the application's thought, the part that on embodiment and range of application, all can change, in sum, this description should not be construed as the restriction to the application.

Claims (30)

1. the control method to the input data is characterized in that, comprising:
Interception keyboard message, said keyboard message includes the first languages message;
Obtain the focus element in the current window;
According to the object element best property of attribute mapping table that presets, obtain second languages of in focus element, importing;
According to the languages coding mapping table that presets, said keyboard message conversion is the corresponding keypad information of encoding by second languages;
Export the said keypad information of pressing second languages coding in said focus element.
2. the method for claim 1 is characterized in that, before said interception keyboard message, also comprises:
Object element best property of attribute mapping table according to presetting obtains the object element in the current window;
Monitor said object element and become focus element up to said object element acquisition focus.
3. the method for claim 1 is characterized in that, also comprises after the said interception keyboard message:
Judge whether said keyboard message comprises press key message,, then return and carry out again said interception keyboard message if do not comprise.
4. method as claimed in claim 3 is characterized in that, also comprises after the said focus element that obtains in the window:
Object element best property of attribute mapping table according to presetting matees said focus element, if do not match, then returns and carry out again said interception keyboard message.
5. like any described method of claim of claim 2 to 4, it is characterized in that, also comprise:
The first languages input method in the shielding current window.
6. method as claimed in claim 5 is characterized in that, also comprises:
If said focus element loses focus, recover the first languages input method in the current window.
7. like any described method of claim of claim 2 to 4, it is characterized in that,
Focus element in the said current window is the input frame element;
Comprise input frame attribute of an element sign and corresponding webpage domain name or window name in the said object element best property of attribute mapping table that presets.
8. method as claimed in claim 7 is characterized in that, also comprises one or more lists in the said object element best property of attribute mapping table that presets, and comprises two or more input frame elements in the said list, and said method also comprises:
If only contain 1 password input frame in the said list, and the input frame of the said password input frame subordinate brotgher of node is not the text input frame, and second languages that all input frame elements are corresponding in the then said list be English.
9. method as claimed in claim 8 is characterized in that, said method also comprises:
If only contain 1 password input frame in the said list, and the input frame of the said password input frame subordinate brotgher of node is the text input frame, and second languages that all input frame elements are corresponding in the then said list be English.
10. method as claimed in claim 9 is characterized in that, said method also comprises:
If only contain 2 positions password input frame of the brotgher of node continuously and each other in the said list, second languages that all input frame elements are corresponding in the then said list be English.
11. method as claimed in claim 10 is characterized in that, said method also comprises:
If only contain 3 positions password input frame of the brotgher of node continuously and each other in the said list, second languages that all input frame elements are corresponding in the then said list be English.
12. the method for claim 1 is characterized in that, the said focus element that obtains in the current window comprises:
Obtain the application programming interfaces object of current window;
Obtain the focus element in the current window through said application programming interfaces object.
13. method as claimed in claim 12 is characterized in that, said current window is a html web page, and the said focus element that obtains in the current window through the application programming interfaces object comprises:
Obtain HTML forms object according to the corresponding browser control part object of current html web page;
Obtain the html document object through said HTML forms object;
Obtain the focus element in the said html web page through said html document object.
14. method as claimed in claim 13 is characterized in that, further comprises:
If can't obtain the html document object through HTML forms object, then HTML forms object obtains the service support object of current operation system;
Said service support object obtains the browser control part object;
Obtain said html document object based on said browser control part object.
15. method as claimed in claim 14 is characterized in that, further comprises:
If the said focus element that obtains in the said html web page through said html document object is framework element/inner frame element, through the corresponding corresponding HTML forms object of HTML frame foundation object acquisition of said framework element/inner frame element.
16. the control device to the input data is characterized in that, comprising:
Keyboard message block module is used to tackle keyboard message, and said keyboard message includes the first languages message;
The focus element acquisition module is used for obtaining the focus element of current window;
Languages codings mapping table is used to store the code conversion mapping relations of first languages and second languages;
The second languages acquisition module is used for obtaining second languages of in focus element, importing according to languages coding mapping table;
The keypad information modular converter is used for said keyboard message conversion is the keypad information by second languages coding correspondence;
The keypad information output module is used for the keypad information that the keypad information modular converter is produced is outputed to focus element.
17. device as claimed in claim 16 is characterized in that, also comprises:
Object element best property of attribute mapping table is used to store object element best property of attribute mapping relation;
The object element acquisition module is used for obtaining according to object element best property of attribute mapping table the object element of current window;
Monitor module, being used for the intercept target element becomes focus element up to said object element acquisition focus.
18. device as claimed in claim 16 is characterized in that, also comprises:
The press key message authentication module is used to judge whether keyboard message comprises press key message, if do not comprise, notify keyboard message block module begins to tackle keyboard message.
19. device as claimed in claim 18 is characterized in that, also comprises:
The focus element matching module, according to the object element best property of attribute mapping table that presets, the coupling focus element, if do not match, then notify keyboard message block module begins to tackle keyboard message.
20. like any described device of claim of claim 17 to 19, it is characterized in that, also comprise:
The input method shroud module is used for shielding the first languages input method of current window.
21. device as claimed in claim 20 is characterized in that, also comprises:
The input method recovery unit is used for judging and drags focus element to lose focus, recover in the current window the first languages input method.
22. like any described device of claim of claim 17 to 19, it is characterized in that, also comprise:
Focus element in the said current window is the input frame element;
Comprise input frame attribute of an element sign and corresponding webpage domain name or window name in the said object element best property of attribute mapping table that presets.
23. device as claimed in claim 22 is characterized in that, also comprises one or more lists in the said object element best property of attribute mapping table that presets, and comprises two or more input frame elements in the said list, said device also comprises:
The logon form configuration module is used for judging if current list only has 1 password input frame, and the input frame of the said password input frame subordinate brotgher of node is not the text input frame, then disposes all input frame elements are corresponding in the said list second languages for English.
24. device as claimed in claim 23 is characterized in that, said device also comprises:
The first enrollment form configuration module is used for judging if said list only contains 1 password input frame; And the input frame of the said password input frame subordinate brotgher of node is the text input frame, then disposes all input frame elements are corresponding in the said list second languages for English.
25. device as claimed in claim 24 is characterized in that, said device also comprises:
The second enrollment form configuration module is used for judging if said list only contains 2 positions password input frame of the brotgher of node continuously and each other, then disposes all input frame elements are corresponding in the said list second languages for English.
26. device as claimed in claim 25 is characterized in that, said device also comprises:
Password is revised the list configuration module, is used for judging if said list only contains 2 positions password input frame of the brotgher of node continuously and each other, then disposes all input frame elements are corresponding in the said list second languages for English.
27. device as claimed in claim 16 is characterized in that, also comprises:
Application programming interfaces object acquisition unit is used to obtain the application programming interfaces object of current window;
Said focus element acquisition module obtains the focus element in the current window through said application programming interfaces object.
28. device as claimed in claim 27 is characterized in that, said current window is a html web page, and said focus element acquisition module comprises:
HTML forms object acquisition unit is used for obtaining HTML forms object according to the corresponding browser control part object of html web page;
Html document object acquisition unit is used for obtaining the html document object through HTML forms object;
The first focus element acquiring unit is used for the focus element through html document object acquisition html web page.
29. device as claimed in claim 28 is characterized in that, further comprises:
HTML forms object acquisition unit, if being used for judging can't obtain the html document object through HTML forms object, then HTML forms object obtains the service support object of current operation system;
Said service support object obtains the browser control part object;
Obtain said html document object based on said browser control part object.
30. device as claimed in claim 29 is characterized in that, further comprises:
Framework element authentication unit; Be used for judging if the focus element that obtains said html web page through said html document object is framework element/inner frame element, through the corresponding corresponding HTML forms object of HTML frame foundation object acquisition of said framework element/inner frame element.
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 true CN102651023A (en) 2012-08-29
CN102651023B 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)

Cited By (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
CN107992457A (en) * 2017-12-01 2018-05-04 深圳乐信软件技术有限公司 A kind of information conversion method, device, terminal device and storage medium
CN108563486A (en) * 2018-04-26 2018-09-21 广州品唯软件有限公司 A kind of method and device for controlling cursor
CN112364269A (en) * 2020-11-24 2021-02-12 中国电子科技集团公司第十五研究所 Method for creating WebApp graphic application based on URL

Citations (4)

* 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
CN102207816A (en) * 2010-07-16 2011-10-05 北京搜狗科技发展有限公司 Method for performing adaptive input based on input environment, and input method system

Patent Citations (4)

* 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
CN102207816A (en) * 2010-07-16 2011-10-05 北京搜狗科技发展有限公司 Method for performing adaptive input based on input environment, and input method system

Cited By (5)

* 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
CN107992457A (en) * 2017-12-01 2018-05-04 深圳乐信软件技术有限公司 A kind of information conversion method, device, terminal device and storage medium
CN108563486A (en) * 2018-04-26 2018-09-21 广州品唯软件有限公司 A kind of method and device for controlling cursor
CN112364269A (en) * 2020-11-24 2021-02-12 中国电子科技集团公司第十五研究所 Method for creating WebApp graphic application based on URL
CN112364269B (en) * 2020-11-24 2023-08-22 中国电子科技集团公司第十五研究所 Method for creating WebApp graphic application based on URL

Also Published As

Publication number Publication date
CN102651023B (en) 2015-01-07

Similar Documents

Publication Publication Date Title
CN108664239B (en) Cross-technology-stack web front-end development system and method based on micro-service
CA2428821C (en) Accessing a platform independent input method editor from an underlying operating system
US20100318894A1 (en) Modifications to Editable Elements of Web Pages Rendered in Word Processor Applications
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
CN109445886A (en) A kind of interface display method, system and terminal device
CN103324613A (en) System and method for automatic language translation for applications
CN201298231Y (en) Multilingual communication and application system capable of automatically identifying multilanguage
CN102917023A (en) Method and mobile terminal for accessing webpage based on two-dimension code
CN101882007A (en) Method and device for carrying out information input and execution based on input interface
CN102651023B (en) Method and device for controlling input data
KR102550540B1 (en) Landing page processing method, device, equipment and medium
CN113139390A (en) Language conversion method and device applied to code character strings
CN101021748A (en) Method for starting immediate communication tool chatting window
CN107608669A (en) A kind of method based on database table structure automatic generation function and the page
CN102831150A (en) Interactive method, system and terminal for browser and local application
CN106375810B (en) Automatic switching method and system for input method of smart television
US20150199337A1 (en) Smart device capable of easily converting into multinational languages
CN101739394A (en) Network translation inquiry system embedded in webpage and method thereof
CN102681780A (en) Intelligent Linux device and input method switching method for same
CN113641433A (en) Multi-language page conversion method and unit of front-end internationalized multi-language file based on i18n technology
CN103164226B (en) A kind of set top box human-computer interface automatic generation method
CN102314468A (en) Synchronous browse method
CN115065945B (en) Short message link generation method and device, electronic equipment and storage medium
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

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.

TR01 Transfer of patent right