This application claims priority to Chinese Patent Application No. 201410594774.1 filed on Oct. 29, 2014 in the China Intellectual Property Office, the contents of which are incorporated by reference herein.
The subject matter herein generally relates to simulation technology, and particularly to an electronic device and a mouse simulation method.
A user may need to use a computing device without a mouse when they are away from the office. Manipulation of the cursor exactly without a mouse is difficult.
Many aspects of the disclosure can be better understood with reference to the following drawings. The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the disclosure. Moreover, in the drawings, like reference numerals designate corresponding parts throughout the several views.
It will be appreciated that for simplicity and clarity of illustration, where appropriate, reference numerals have been repeated among the different figures to indicate corresponding or analogous elements. In addition, numerous specific details are set forth in order to provide a thorough understanding of the embodiments described herein. However, it will be understood by those of ordinary skill in the art that the embodiments described herein can be practiced without these specific details. In other instances, methods, procedures, and components have not been described in detail so as not to obscure the related relevant feature being described. The drawings are not necessarily to scale and the proportions of certain parts may be exaggerated to better illustrate details and features. The description is not to be considered as limiting the scope of the embodiments described herein.
The present disclosure, including the accompanying drawings, is illustrated by way of examples and not by way of limitation. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one”.
The term “module”, as used herein, refers to logic embodied in computing or firmware, or to a collection of software instructions, written in a programming language, such as, Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware, such as in an erasable programmable read only memory (EPROM). The modules described herein may be implemented as either software and/or computing modules and may be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives. The term “comprising” means “including, but not necessarily limited to”; it specifically indicates open-ended inclusion or membership in a so-described combination, group, series and the like.
The electronic device 1 further includes, but is not limited to, a camera module 12, a touch screen 13, at least one processor 14, a storage device 15, and a sensor 16. The computing device 2 further includes, but is not limited to, a display device 22. The electronic device 1 can be a mobile phone, a personal digital assistant (PDA), or any other suitable electronic device. The computing device 2 can be a computer, a notebook computer or any other device which includes a display device.
The camera module 12 can be a front-facing camera. The touch screen 13 can be touch panels, which support multi-touch, such as resistive touch screens or capacitive touch screens. In at least one embodiment, the at least one processor 14 can be a central processing unit (CPU), a microprocessor, or other data processor chip that performs functions of the electronic device 1. The storage device 15 can include various type(s) of non-transitory computer-readable storage medium. For example, the storage device 15 can be an internal storage system, such as a flash memory, a random access memory (RAM) for temporary storage of information, and/or a read-only memory (ROM) for permanent storage of information. The storage device 15 can also be an external storage system, such as a hard disk, a storage card, or a data storage medium. The sensor 16 is used to detect a rotation angle of the electronic device 1, such as a gyroscope.
The mouse simulation system 10 captures images at predetermined time intervals using the camera module 12, calculates movement information of the electronic device 1 based on analyses of the captured images, and controls movements of a cursor displayed on the display device 22 of the computing device 2. The mouse simulation system 10 can also detect one or more touch signals on at least one predetermined touch areas on the touch screen 13, and send a command to the computing device 2 according to the one or more touch signals.
In at least one embodiment, the mouse simulation system 10 can include a connection module 101, a setting module 102, a calculation module 103, a movement module 104, a clicking module 105, and an input module 106. The function modules 101-106 can include computerized codes in the form of one or more programs, which are stored in the storage device 15. The at least one processor 14 executes the computerized codes to provide functions of the function modules 101-106.
The connection module 101 can connect the electronic device 1 to the computing device 2 through the first wireless device 11 and the second wireless device 21. In at least one embodiment, the first wireless device 11 and the second wireless device 21 are Bluetooth devices.
The setting module 102 can set a virtual mouse by designating at least one touch area of the touch screen 13 through a setting interface. The at least one touch area includes a virtual left mouse button corresponding to a first touch area of the touch screen, a virtual right mouse button corresponding to a second touch area of the touch screen, a virtual mouse wheel corresponding to a third touch area of the touch screen. The setting module 102 also sets a precision of the virtual mouse and a background of the virtual mouse. The precision of the virtual mouse represents a ratio between a movement distance of the electronic device 1 and pixels of the cursor that moves on the display device 22. The movement distance of the electronic device 1 may be pixel distance. For example, when the precision of the virtual mouse is S, it means that the cursor moves S pixels when the electronic device 1 moves per unit pixel (the unit pixel can be 10 pixels, for example). The setting module 102 also displays the virtual mouse on the touch screen 13.
The calculation module 103 can capture images at predetermined time intervals using the camera module 12, and calculates movement information of the electronic device 1 according to the captured images. In at least one embodiment, the calculation module 103 acquires two consecutive images, which include a first image and a second image, from the captured images. The calculation module 103 further calculates movement information of the electronic device 1 by comparing the first image and the second image.
The calculation module 103 extracts at least one specified feature in both of the first image and the second image, and calculates the movement information of the electronic device 1 by calculating movement information of the specified feature. In some embodiments, the specified feature can be represented by dots in a two-dimensional Cartesian coordinate system as shown in
In at least one embodiment, the calculation module 103 can calculate the movement information of the electronic device 1 by determining one specified feature that is closest to a center of the first image 50, and calculating the movement information of the specified feature that is closest to the center of the first image 50.
The movement module 104 moves a cursor displayed the display device 22 of the computing device 2 according to the movement information of the electronic device 1. The movement module 104 first determines the movement information of the cursor according to the movement information of the electronic device 1 and the precision of the virtual mouse. Then the movement module 104 moves the cursor displayed on the display device 22 of the computing device 2 according to the movement information of the cursor.
The calculation module 103 can further determine whether the captured images are mirror images. In one embodiment, when the captured images are mirror images, the feature A is moved upwards in X pixels, and moved leftwards in Y pixels, the calculation module 103 determines that the electronic device 1 moves downwards in X pixels, and moves rightwards in Y pixels. And the movement module 104 determines that the cursor moves downwards in X*S pixels, and moves rightwards in Y*S pixels. When the captured images are not mirror images, the feature A is moved upwards in X pixels, and moved leftwards in Y pixels, the calculation module 103 determines that the electronic device 1 moves downwards in X pixels, and moves leftwards in Y pixels. And the movement module 104 determines that the cursor moves downwards in X*S pixels, and moves leftwards in Y*S pixels.
The clicking module 105 detects one or more touch signals on the at least one touch area of the touch screen, and controls the cursor on the display device 22 to execute one or more operations by sending a command to the computing device 2 according to the one or more touch signals. The clicking module 105 determines an operation of a user according to the one or more touch signals, and sends a command to the computing device 2 according to the operation. The operation of the user can be, but is not limited to a left click, a right click, a double left click, a double right click, a scroll up or a scroll down.
In other embodiments, the input module 106 can display a virtual keyboard on the touch screen 13 when a predetermined invoking signal is detected. In at least one embodiment, the predetermined invoking signal is triggered when the electronic device 1 rotates more than a preset angle within a time interval. The input module 106 detects a rotated angle using the sensor 16, and displays a virtual key board on the touch screen 13 when the rotated angle is greater than the preset angle.
Referring to
At block 201, a connection module connects an electronic device to a computing device through a first wireless device and a second wireless device. In at least one embodiment, the first wireless device and the second wireless device are Bluetooth devices.
At block 202, a setting module sets a virtual mouse by designating at least one touch area of a touch screen through a setting interface. The at least one touch area includes a virtual left mouse button corresponding to a first touch area of the touch screen, a virtual right mouse button corresponding to a second touch area of the touch screen, a virtual mouse wheel corresponding to a third touch area of the touch screen. The setting module also sets a precision of the virtual mouse and a background of the virtual mouse. The precision of the virtual mouse represents a ratio between a movement distance of the electronic device and pixels of the cursor that moves on a display device of the computing device. The movement distance of the electronic device may be pixel distance. For example, when the precision of the virtual mouse is S, it means that the cursor moves S pixels when the electronic device moves per unit pixel (the unit pixel can be 10 pixels, for example). The setting module also displays the virtual mouse on the touch screen.
At block 203, a calculation module captures images at predetermined time intervals using a camera module, and calculates movement information of the electronic device according to the captured images. In at least one embodiment, the calculation module acquires two consecutive images, which include a first image and a second image, from the captured images. The calculation module further calculates movement information of the electronic device by comparing the first image and the second image.
The calculation module extracts at least one specified feature in both of the first image and the second image, and calculates the movement information of the electronic device by calculating movement information of the specified feature. In some embodiments, the specified feature can be represented by dots in a two-dimensional Cartesian coordinate system as shown in
In at least one embodiment, the calculation module can calculate the movement information of the electronic device by determining one specified feature that is closest to a center of the first image 50, and calculating the movement information of the specified feature that is closest to the center of the first image 50.
At block 204, a movement module moves a cursor displayed the display device of the computing device according to the movement information of the electronic device. The movement module first determines the movement information of the cursor according to the movement information of the electronic device and the precision of the virtual mouse. Then the movement module moves the cursor displayed on the display device of the computing device according to the movement information of the cursor.
The calculation module can further determine whether the captured images are mirror images. In one embodiment, when the captured images are mirror images, the feature A is moved upwards in X pixels, and moved leftwards in Y pixels, the calculation module determines that the electronic device moves downwards in X pixels, and moves rightwards in Y pixels. And the movement module determines that the cursor moves downwards in X*S pixels, and moves rightwards in Y*S pixels. When the captured images are not mirror images, the feature A is moved upwards in X pixels, and moved leftwards in Y pixels, the calculation module determines that the electronic device moves downwards in X pixels, and moves leftwards in Y pixels. And the movement module determines that the cursor moves downwards in X*S pixels, and moves leftwards in Y*S pixels.
At block 205, a clicking module determines whether one or more touch signals are detected from the at least one touch area of the touch screen. If one or more touch signals are detected from the at least one touch area of the touch screen, block 206 is executed. If no signal is detected from the at least one touch area of the touch screen, block 207 is executed.
At block 206, the clicking module controls the cursor on the display device to execute one or more operations by sending a command to the computing device according to the one or more touch signals. The clicking module determines an operation of a user according to the one or more touch signals, and sends a command to the computing device according to the operation. The operation of the user can be, but is not limited to a left click, a right click, a double left click, a double right click, a scroll up or a scroll down.
At block 207, a input module determines whether a predetermined invoking signal is detected. If the predetermined invoking signal is detected, at block 208, the input module displays a virtual keyboard on the touch screen. If no predetermined invoking signal is detected, process ends. In at least one embodiment, the predetermined invoking signal is triggered when the electronic device rotates more than a preset angle within a time interval. The input module detects a rotated angle using a sensor, and displays a virtual key board on the touch screen when the rotated angle is greater than the preset angle.
Block 203-207 is a loop of the method.
The embodiments shown and described above are only examples. Even though numerous characteristics and advantages of the present technology have been set forth in the foregoing description, together with details of the structure and function of the present disclosure, the disclosure is illustrative only, and changes may be made in the detail, including in particular the matters of shape, size and arrangement of parts within the principles of the present disclosure, up to and including the full extent established by the broad general meaning of the terms used in the claims.
Number | Date | Country | Kind |
---|---|---|---|
201410594774.1 | Oct 2014 | CN | national |