A kind of mobile phone and its implementation with mouse function
Technical field
The present invention relates to a kind of mobile phone and its implementation with mouse function.
Background technology
At present in most of medium-to-high grade mobile phone products, keyboard, touch-screen, USB interface, the usb data line has become standard configuration, keyboard and touch-screen are connected to realize the purpose of the various functions of operating handset with communications electronics circuit in being arranged on hand set machine shell as the man-machine input interface of mobile phone, and the usb data line that is connected with peripheral hardware such as computer connects after the mobile phone USB interface, main with the portable hard drive of mobile phone as peripheral hardwares such as computers, web camera (when mobile phone disposes camera), instruments such as virtual serial port, realize the diversification of mobile phone function of use, mobile phone USB interface with charge also for mobile phone self when peripheral hardware such as computer is connected.
And computer mouse becomes the indispensable important peripheral configuration of computer as control, moving cursor, for the business people who often goes on business, the computer that need carry and all kinds of computer peripheral equipment become many burden, occur forgeing the unusual malfunctioning situation of the cursor Trackpad that carries computer mouse or notebook computer easily, this will cause very big puzzlement to the user; And mobile phone has now become people's work, the necessity of life and its purposes of free articles under passenger are also more and more widely, it has mouse function in the market some mobile phones also, for example notification number is that the Chinese utility model patent of CN 2874973Y (patent No. is: ZL 200520114537.7) discloses " a kind of mobile phone with mouse function ", it comprises a handset shell and is arranged on described housing interior mobile module and wireless mouse module, its characteristics are, described wireless mouse module comprises: a left side that is arranged on described housing upper surface, right button, be arranged on a described left side, roller between the right button, be arranged on the optical sensor of described housing bottom surface, and be arranged on described handset shell inside and connect a described left side, right button, the bluetooth module of described roller and described optical sensor.The above-mentioned mobile phone that can doublely do mouse its when realizing mouse function, on handset shell, increased a left side, right button, roller, optical sensor, bluetooth module, be equivalent to unit construction with traditional mouse to mobile phone, and need utilize bluetooth module to realize communicating by letter of mobile phone and computer, it need increase the structure member of mobile phone on the one hand, increased the mobile phone hardware cost, on the other hand, the computer corresponding with this mobile phone must possess corresponding bluetooth module could communicate the realization mouse function with mobile phone, and not all computer all possesses bluetooth module, and it is well-known, the transmission range of bluetooth module is shorter, mobile phone during as the mouse action computer, must be unfavorable for operation with mobile phone and computer controlled in the scope of application of bluetooth module.
Summary of the invention
First technical problem to be solved by this invention is to provide a kind of need not to increase hardware cost, the easy to operate mobile phone with mouse function at above-mentioned prior art.
The technical problem that the present invention further will solve provides a kind of mobile phone implementation method with mouse function.
The present invention solves the technical scheme that above-mentioned first technical problem adopts: this has the mobile phone of mouse function, comprise casing, be arranged on the button on the casing, touch-screen, USB interface, communications electronics circuit that is equipped with in the casing and the key control circuit that links to each other with the communications electronics circuit, touch screen control circuit, usb control circuit, the usb data line that matches and be connected with described USB interface, it is characterized in that: described communications electronics circuit includes a mobile phone mode of operation and selects module, one mouse performance mode control module, the input of described operating handset mode selection module is connected with described usb control circuit, the output of described operating handset mode selection module is connected with described mouse performance mode control module, and described key control circuit or/and touch screen control circuit also be connected with described mouse performance mode control module.
For the analog mouse use habit, above-mentioned button comprises a left button, a right button at least, general cell phone keyboard all include digital keys and about, move up and down button and answer buttons such as button, on-hook button, left button and right button when the present invention can utilize left and right press key on the existing mobile phone as mobile phone mouse performance pattern are used for the button operation of analog mouse.
Above-mentioned mouse performance mode control module includes a touch-screen timer that is used to monitor the touch screen control circuit signal, like this cursor move operation that the touch-screen of mobile phone just can analog mouse.
Certainly, described operating handset mode selection module can also comprise mode of operations such as portable hard drive mode of operation, cell-phone charging mode of operation.
The present invention solves above-mentioned second technical scheme that technical problem adopted: this has the mobile phone implementation method of mouse function, the casing that comprises mobile phone, be arranged on the button on the casing, touch-screen, USB interface, communications electronics circuit that is equipped with in the casing and the key control circuit that links to each other with the communications electronics circuit, touch screen control circuit, usb control circuit, the usb data line that matches and be connected with described USB interface, it is characterized in that: described communications electronics circuit includes an operating handset mode selection module that comprises the mouse performance pattern at least, one mouse performance mode control module, the input of described operating handset mode selection module is connected with described usb control circuit, the output of described operating handset mode selection module is connected with described mouse performance mode control module, and described key control circuit or/and touch screen control circuit also be connected with described mouse performance mode control module; Described mobile phone is realized mouse function by following steps:
Step 1: usb control circuit at first detects the usb data line that is connected with USB interface and whether is connected to computer;
Step 2: if mobile phone USB interface links to each other with computer by the usb data line, described operating handset mode selection module transmits operating handset model selection information by the usb data line to computer;
Step 3: when the computer user selected the mouse performance pattern, handset starting was communicated by letter with computer, and after machine identification mobile phone to be calculated was the mouse peripheral hardware, mobile phone entered the mouse performance pattern;
Step 4: the mouse performance mode control module starts button and detects task, touch-screen detection task and usb data line transformation task; Thereby and detected key information, contact screen information are transferred to the operation of computer control computer by the usb data line.
In the above-mentioned steps three, handset starting comprises following steps with communicating by letter of computer:
Step (one): the mobile phone USB interface control circuit is drawn high dateout pin level in the USB interface, and the notice computer has peripheral hardware to insert;
Step (two): the computer usb bus that resets, inquiry mobile phone peripheral hardware attribute;
Step (three): mobile phone feeds back to computer with the descriptor information of USB mouse;
Step (four): after the computer Recognition mobile phone is the USB mouse, call mouse driver automatically.
See the mobile phone from computer-side this moment is exactly a standard USB mouse external equipment, because present computer operating system all has mouse-driven, so does not just need to adorn extra software-driven on the computer.
Above-mentioned mobile phone key comprises a left button, a right button at least, and the mouse performance mode control module detects the button task in the following manner in the above-mentioned steps four:
Step (one): whether key control circuit at first detects has left and right press key to press or discharge;
Step (two): the key information that the mouse performance mode control module is noted left and right press key promptly: left button is pressed, and left button discharges, right button is pressed, right button discharges;
Step (three): the key information that the mouse performance mode control module will be noted left and right press key sends to touch screen control circuit and usb data line;
Step (four): after touch screen control module is received above-mentioned press key message, preserve the current state of button, the usb data line is then issued computer to key information, and computer is received this data, just thinks the mousebutton incident.
Above-mentioned mouse performance mode control module includes a touch-screen timer that is used for senses touch screen control circuit signal, mouse performance mode control module senses touch screen task in the following manner in the above-mentioned steps four:
Step 1: when at first touch screen control circuit detected touch-screen and presses, (X1 Y1), and started a timer to the current position coordinates of mouse performance mode control module record;
Step 2: when timer then the time, whether the senses touch screen is pressed again, if still press, write down its position and be coordinate (X2, Y2),
Step 3: if (X2, Y2) be not equal to (X1, Y1), then ((X2-X1), (Y2-Y1)), in conjunction with before the key information preserved issue the usb data line, restart timer, until touch-screen is upspring;
Step 4: computer is received this data, just thinks the mouse moving event.
Compared with prior art, after the mobile phone with mouse function provided by the invention passes through the usb data line and computer is connected, by in the communications electronics circuit of above-mentioned mobile phone, increasing the work of operating handset mode selection module and mouse performance mode control module, utilize the existing left and right press key of mobile phone to serve as left and right press key under the mouse performance pattern, utilize the existing touch-screen of mobile phone to serve as that cursor moves under the mouse performance pattern, need not additionally to increase the mobile phone hardware cost and just can realize mouse function.
Description of drawings
Fig. 1 has mouse function mobile module structural representation in the embodiment of the invention;
Fig. 2 is for having the implementation method flow chart of the mobile phone of mouse function in the embodiment of the invention;
Fig. 3 has the method flow diagram of the mobile phone of mouse function for computer Recognition in the embodiment of the invention;
Fig. 4 is the method flow diagram that the mouse performance mode control module detects the button task in the embodiment of the invention;
Fig. 5 be in the embodiment of the invention mouse performance mode control module senses touch screen task method flow diagram.
Embodiment
Embodiment describes in further detail the present invention below in conjunction with accompanying drawing.
One aspect of the present invention provides a kind of mobile phone with mouse function, it comprises casing, be arranged on the button on the casing, touch-screen, USB interface, the usb data line that matches and be connected with described USB interface, the communications electronics circuit that is equipped with in the casing, key control circuit, touch screen control circuit, usb control circuit, the communications electronics circuit comprises operating handset mode selection module and mouse performance mode control module at least, the input of operating handset mode selection module is connected with described usb control circuit, the output of described operating handset mode selection module is connected with described mouse performance mode control module, and described key control circuit and touch screen control circuit also are connected with described mouse performance mode control module, see for details shown in Figure 1.
Above-mentioned button with mobile phone of mouse function adopts conventional mobile phone key, and left button and right button when the present invention can utilize left and right press key on the conventional mobile phone as mobile phone mouse performance pattern are used for the button operation of analog mouse.
Above-mentioned mouse performance mode control module includes a touch-screen timer that is used to monitor the touch screen control circuit signal, like this cursor move operation that the touch-screen of mobile phone just can analog mouse.
Certainly, described operating handset mode selection module can also comprise mode of operations such as portable hard drive mode of operation, cell-phone charging mode of operation.
The present invention on the other hand, a kind of implementation method 1 with mobile phone of mouse function is provided, this method is suitable for usb control circuit and detects the usb data line be connected with USB interface and whether be connected to computer 10, in any case, when usb control circuit detect mobile phone with mouse function by the usb data line be connected with computer the time, mobile phone enters battery charger operation mode 11 immediately, and the operating handset mode selection module is given an operating state selective listing of user feedback menu information 12 by UI, this operating state selective listing menu information except the operating state pattern of routine (for example: the portable hard drive mode of operation, web camera mode of operation etc.) outside, more than a mouse performance model selection item, the operating handset mode selection module continues to judge whether the computer user has selected mouse performance pattern 13, if the computer user selects the mouse performance pattern, at this moment, handset starting communicates by letter 14 with computer, after machine identification mobile phone to be calculated was the mouse peripheral hardware, mobile phone entered mouse performance pattern 15; At this moment, the mouse performance mode control module starts button detection task 16, touch-screen detects task 17 and usb data line transformation task 18; And thereby detected key information, contact screen information be transferred to the operation of computer 19 control computers by the usb data line, see for details shown in Figure 2.
As Fig. 3, after the mobile phone with mouse function inserts computer by the usb data line, the method that computer Recognition has a mouse function mobile phone is a handset starting and 14 the method for communicating by letter of computer, start from the mobile phone USB interface control circuit dateout pin in the USB interface (being the DP pin) level is drawn high 141, the notice computer has peripheral hardware to insert, at this moment, the computer usb bus that resets, inquiry mobile phone peripheral hardware attribute 142; Mobile phone feeds back to computer 143 with the descriptor information of USB mouse; After the computer Recognition mobile phone is the USB mouse, call mouse driver 144 automatically, after the mouse driver installation, discerning mobile phone automatically is mouse peripheral hardware 145, and mobile phone enters the mouse performance pattern, finishes.Because the present above operating system of computer WIN2000 all has the USB mouse-driven, so just do not need to adorn extra software-driven on the computer.
The mouse performance mode control module detects the method for button task 16, whether start from key control circuit at first detects and has left and right press key to press or discharge 161, the key information 162 that the mouse performance mode control module is noted left and right press key is promptly: left button is pressed, and left button discharges, right button is pressed, right button discharges; The key information that the mouse performance mode control module will be noted left and right press key sends to touch screen control module and usb data line 163; After touch screen control circuit is received above-mentioned press key message, preserve the current state 164 of button, the usb data transformation task is issued computer 165 with key information, and computer is received this data, just thinks the mousebutton incident, sees for details shown in Figure 4.
As Fig. 5, the method of mouse performance mode control module senses touch screen task 17, whether start from touch-screen detects touch-screen and presses 171, when touch-screen is pressed, write down current position coordinates (X1, Y1) 172, and start a timer 173 of 10 milliseconds fast, when timer then the time, whether the senses touch screen presses 174 again, if still press, writing down its current position coordinates is (X2, Y2) 175, judge (whether X2 Y2) equals (X1, Y1) 176, if (X2, Y2) be not equal to (X1, Y1), then ((X2-X1), (Y2-Y1)), issue usb data transformation task 177 in conjunction with the key information of preserving before, the usb data transformation task sends to computer 178 with contact screen information, restart 10 milliseconds timer 179 then, until touch-screen is upspring, computer is received this data, just thinks the mouse moving event.
When the usb data line is extracted, when perhaps the user has phone to squeeze into, withdraw from USB mouse performance pattern, turn back to normal mobile phone mode of operation.