[background technology]
High speed development along with electron trade, computer industry, embedded device has obtained very widespread use, the user also no longer only is confined to initial shirtsleeve operation to the requirement at its interface, the interface of present embedded device has become more and more friendly and has been rich in hommization, with the smart mobile phone is example, receiving and dispatching mail, Edit Document etc., these all be unable to do without man-machine mutual, also just arise at the historic moment so satisfy the input method of the embedded device that the exchange of people's complex information handles.
Exist a lot of commercial input methods in the market, but its cost is high and be difficult for obtaining, so it is quite desirable to write input method voluntarily.At present, the implementation of the input method on the most embedded device all is to carry out a data mapping by the input of the terminal of embedded device, return the result of mapping then, embedded device finds real input key word again according to mapping result in character library.
The general entry terminal of existing Embedded Input Method is touch-screen or keyboard, for the embedded device of telepilot as entry terminal, as digital TV set-top box, hard disk media player etc., does not also have disclosed input method at present.
[summary of the invention]
Technical matters to be solved by this invention is to provide a kind of embedded simple input method, be mainly used in the built-in terminal of telepilot as input equipment, can import Chinese character, letter and ASCII DBC case fast, it is mutual to be well positioned to meet fairly simple but necessary literal.
The present invention solves the problems of the technologies described above by the following technical solutions:
Embedded device simple input method comprises the steps:
Step 1:, launch the infrared light of certain coding by the number keys of remote controller input;
Step 2: the system in the embedded device obtains corresponding telepilot key after changing through the remote control keys code table;
Step 3: the key after system will change is passed to embedded simple input method processing module and is handled;
Step 4: the data mapping tables that the data that embedded simple input method processing module is imported into according to system are carried out under the associative mode carries out Data Matching, and the data message after will mating then returns to the embedded device system and handles.
Described data mapping tables comprises phonetic mapping table, capitalization mapping table, lowercase mapping table, ASCII DBC case mapping table.
The advantage of embedded device simple input method of the present invention is: the present invention has realized with telepilot mutual as the literal of the built-in terminal of input equipment, adopt self-defining data mapping tables, can import Chinese character, letter and ASCII DBC case fast, it is mutual to be well positioned to meet fairly simple but necessary literal.In addition, the present invention is simple to operate, and it is little to take up room, as long as embedded system is supported the GB2312 standard, does not need to add extra character library simultaneously, and code all is that basic C language is realized, and is portable high.
[embodiment]
See also shown in Figure 1ly, embedded device simple input method comprises the steps:
Step 1:, launch the infrared light of certain coding by the number keys of remote controller input;
Step 2: the embedded device system obtains corresponding telepilot key after changing through the remote control keys code table;
The remote control keys code table is: the letter of numerical key 2~9 correspondences: 2:abc; 3:def; 4:ghI; 5:jkl; 6:mno; 7:pqrs; 8:tuv; 9:wxyz;
Step 3: the key after the embedded device system will change imports the input method processing module into;
Step 4: input method is managed the data that module imports into according to system and the input pattern of these data everywhere, and the data mapping tables that carries out under the associative mode carries out Data Matching, and the data message after will mating then returns to embedded system and handles.
If input pattern is a Chinese character, input method place progressive die piece will return to system with the pinyin combinations and the Chinese character information (district's sign indicating number and bit code) of corresponding key, system is so long as support to show the GB2312 standard, just can find and demonstrate corresponding Chinese character information with bit code, so character library does not need to add separately according to district's sign indicating number; If input pattern is letter (comprising capitalization and small letter), input method is directly returned the capitalization or the lowercase of this button correspondence; If input pattern is a special character, directly return all ASCII DBC cases.
The phonetic mapping table is:
{1,0,0,0,0,0,3,1}
16,1,16,37,18,33,1,2,3,
Form by two arrays.
First array is button and phonetic contrast, the highest combination of preceding 6 element representation phonetics, and the number of the 7th element representation pinyin combinations, last represents that current pinyin combinations has several letters.1,0,0,0,0,0,3,1} represents the current three kinds of pinyin combinations a that have, and b, c, pinyin combinations is made up of a letter.
Second array is phonetic and Chinese character contrast, and a: corresponding first Hanzi section-position code is 16,1; B: corresponding first Hanzi section-position code is 16,37; C: corresponding first Hanzi section-position code is 18,33; Represent a respectively for ensuing 1,2,3, b, three letters of c;
Letter with the corresponding relation of numeral is: a-01 b-02 c-03 d-04 e-05 f-06 g-07 h-08 i-09 j-10k-11 l-12 m-13 n-14 o-15 p-16 q-17 r-18 s-19 t-20 u-21 v-22 w-23 x-24 y-25 z-26.
The capitalization mapping table is:
{‘A’,‘B’,‘C’,0,3}
The lowercase mapping table is:
{‘a’,‘b’,‘c’,0,3}
Capitalization and lowercase mapping table all are two-dimensional arrays of one 8 * 5, preceding four element representations be the button correspondence may the letter, for example that 2 correspondences is exactly alphabetical A, B, C (perhaps a, b, c), and the letter of 9 correspondences is W, X, Y, Z (perhaps w, x, y, z), the 5th alphabetical number that this delegation of element representation is total.
ASCII DBC case mapping table is:
{‘.’,‘,’,‘:’,‘;’,‘-’,‘!’,‘?’,0,7}
ASCII DBC case mapping table is one 5 * 9 a two-dimensional array, return 32 DBC cases, and the first eight element is represented the ASCII DBC case respectively, last element representation DBC case quantity altogether.
The present invention has realized with telepilot mutual as the literal of the built-in terminal of input equipment, and is of the present invention simple to operate, and it is little to take up room, simultaneously as long as embedded system is supported the GB2312 standard, do not need to add extra character library, code all is that basic C language is realized, and is portable high.