CN103941887A - Motion sensing mouse software - Google Patents
Motion sensing mouse software Download PDFInfo
- Publication number
- CN103941887A CN103941887A CN201410132975.XA CN201410132975A CN103941887A CN 103941887 A CN103941887 A CN 103941887A CN 201410132975 A CN201410132975 A CN 201410132975A CN 103941887 A CN103941887 A CN 103941887A
- Authority
- CN
- China
- Prior art keywords
- mobile phone
- module
- socket
- computer end
- data
- 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.)
- Pending
Links
Landscapes
- Position Input By Displaying (AREA)
Abstract
Provided is motion sensing mouse software. The motion sensing mouse software achieves the purpose that a computer mouse is controlled through motion sensing, a cursor on a computer screen will point to where a user holding a mobile phone in hand points to in the air, and visually, the user can have control over the mouse cursor on the computer screen like a red light point projected on a screen by a laser pen. The motion sensing mouse software is composed of a mobile phone end and a computer end, wherein the mobile phone end is used for collecting mobile phone sensor data and sending the data to the computer, and the computer end is used for receiving the data, and controlling the mouse to move through a specific algorithm.
Description
Technical field:
The application relates to mouse field, is specifically related to mouse control software field.
Technical background:
Due to the good user-interaction experience of body sense mode of operation, body sense equipment is more and more subject to user's welcome.Microsoft has issued Kinect somatic sensation television game handle in 2010, application body sense technology has replaced the button operation of traditional game handle, uses simple, intuitive more, is therefore subject to favorable comment widely.In mouse field, conventional desktop mouse dominate all the time.Conventional mouse relies on spin or the movement on the table of infrared sensor detecting mouse, thereby simulates the movement of cursor on screen.Therefore, conventional mouse in use must keep contacting with desktop.And much do not having under the application scenarios of suitable desktop, conventional mouse is just difficult to should be right.In order to tackle without the demand that operates cursor under desktop condition, the concept of body sense mouse is suggested.Body sense mouse, as a kind of novel body sense input equipment, has broad application prospects.Body sense mouse can operate cursor more intuitively than conventional mouse, does not meanwhile rely on and desktop, therefore can be applicable under more scene.At present, there is multiple different body sense mouse solution.These schemes have made up the deficiency of conventional mouse to a certain extent, but still have certain room for promotion.Existing body sense mouse solution has all been taked hard-wired method, there is no software implement scheme.And hardware is realized and is often faced with that cost is high, the deficiency such as be not easy to carry, be inconvenient to upgrade.As " telepilot air mouse control system and its implementation " (application number CN201310376317) of Changhong company provides a kind of Hardware Implementation of body sense mouse, the method can be applied in TV operation, relies on the circuit taking gyro module as core to realize the body sense operation to TV.But the deficiency that this patent exists has (1) its application scenarios to be confined to specific TV, can not use on computers or miscellaneous equipment on use, application scenarios is narrower; (2) this patent only provides a kind of hardware solution, and user must buy and shake control body entity, could use, and use cost is higher.In sum, existing body sense mouse existence is not easy to carry, application scenarios is narrow, the high several respects deficiency of use cost.
Summary of the invention
Goal of the invention: for solving the existing hard-wired deficiency of body sense mouse, proposed a kind of body sense mouse software solution herein.Body sense mouse software downloads in mobile phone and both can use, and greatly reduces use cost.Meanwhile, this programme can be widely used in multiple computer.In addition, body sense mouse mouse is arranged in mobile phone, can carry, easy to use.
Technical scheme: body sense mouse software has realized by body sense control computer mouse, where user's handheld mobile phone is high up in the air points to, and where the cursor on computer screen will point to.Image, user can control the mouse of computer screen as control laser pen is thrown the red luminous point on screen.This software is made up of mobile phone terminal and computer end two parts.The effect of mobile phone terminal is to gather mobile phone sensing data, sends these data to computer; The effect of computer end is to accept these data, and moves by special algorithm mouse beacon.
Technology realizes: this software is made up of an Android mobile phone terminal and a computer end software.Carry out radio communication by Wi-Fi between the two.Below the compiling procedure of cell-phone customer terminal and computer end will be introduced respectively.
Body sense mouse, is made up of an Android mobile phone terminal and a computer end software, carries out radio communication between the two by Wi-Fi,
Described Android end is made up of three modules, is respectively primary module, and communication is from module and gyroscope from module; Primary module is program main thread, and the interface of having realized Android application builds and calling other modules; Communication module has realized data packing encapsulation, is pushed to computer end; Gyroscope (gyro sensor) is from module, for arranging, initialization sensor, and Returning sensor data; The operational scheme of whole Android program can be summarized and be embodied by following false code
As above code, the work period of program is set as 100ms, this be because the communication delay that Android end and computer end are passed through wifi between 0-90ms.This program Wi-Fi communication specifically has cover byte (socket) to realize.Cover byte is the packet of an encapsulation, determines sending destination by IP address and Port mouth value.Therefore, above-mentioned the 5th row false code, what in fact carry out should be the encapsulation of cover byte.
Computer end is made up of primary module, communication module, three modules of cursor control module, and program structure and Android end are similar.Primary module is used for generating interface, calls other module; Communication module mainly relies on java.net.socket bag, accepts the data from Android.Cursor control module has realized calculating and the control of cursor position.The operational scheme of program can be summarized and be embodied by following false code.
Mobile phone is converted into the motion of cursor at directions X around the slewing rate of X, and mobile phone is converted into the motion of cursor in Y-direction around the slewing rate of Z; Shown in gain in false code be amplification coefficient; Because the communication frequency of portable computer end is 10HZ, gain gets more than 20 or 20, will make cursor obtain suitable translational speed.
Beneficial effect: the body sense mouse being formed by described Android end and computer end, realize communicating by letter between mobile phone and computer, and the gyro data of embedded in mobile phone has effectively been converted into the movement of onscreen cursor.Because gyroscope is arranged in Android mobile phone widely, therefore body sense mouse has a wide range of applications environment.Because the mode of operation of described body sense mouse is intuitively easy-to-use, therefore more easily used by user admission again.
Brief description of the drawings
Fig. 1 is the coordinate system that Android mobile phone gyroscope adopts
Fig. 2, body sense mouse Android holds interface
Fig. 3 screen coordinate system
Embodiment;
One, Android end program
Android end is made up of three classes, is respectively MainActivity.java, TeleThread.java and GyroSensor.java.
MainActivity.java is program main thread, and the interface of having realized Android application builds and calling other classes;
GyroSensor.java is gyro sensor (gyro sensor) administration module, for setting, initialization sensor, and Returning sensor data.According to AndroidAPI, Android allows the selected multiple different working sensor frequency of programmer, comprises SENSOR_DELAY_NORMAL, SENSOR_DELAY_UI and SENSOR_DELAY_GAME.For meeting the fluency of body sense operation, answer the SENSOR_DELAY_GAME that selected frequency is the highest herein.
As shown in Figure 1, be the coordinate system that Android mobile phone gyroscope adopts.The value that gyroscope returns is the slewing rate around X, Y, Z, and unit is rad/s.GyroSensor.java provides the method for returning to X, Y, tri-data of Z, but in existing program, only has X, two data of Z to be utilized.Why also providing the method for returning to " Y ", is to provide convenience for subsequent development.Y-axis data can be as exploitation Premium Features, amplify and dwindle or further, zoom out visual angle, page turning etc. as controlled picture.
TeleThread.java is communication thread, has realized data packing encapsulation, is pushed to computer end.First, this thread will create a socket object after starting, for encapsulating the data that need transmission.Socket points to the IP(of computer end as 192.168.1.100), port is computer end idle port (as acquiescence selects 30000).
socket=newSocket(IPaddress,port);
Socket is as information carrier, by the data of returning for encapsulated sensor
This thread is by utilizing the continuous process that repeats to refresh packaging information in socket of timer, to ensure the communication between mobile phone terminal and computer end.
timer.schedule(Package?function(),100milliseconds);
Owing to using Wi-Fi as communication mode, and after tested, the delay of Wi-Fi between computer end and mobile phone terminal is in 0-90ms left and right herein, and it is comparatively safe therefore adopting the transmission cycle of 100ms.As the cycle that sends be worth lower than this, communication by the delay there will be in various degree.As shown in Figure 2.
Two, computer end program
Computer end is made up of three classes, Main.java, Cursor.java, tri-class compositions of TeleThread.java.
Main.java is program host process, and major function is for generating user interface.
TeleThread.java is the communication thread of computer end, mainly relies on java.net.socket bag, and realization is communicated by letter with mobile phone terminal.
Server?Socket=newServer?Socket(port);
socket=Server?Socket.accept();
Relocate after Cheng Kaiqi, by a first newly-built Server Socket, for receiving the socket packet from mobile phone terminal.Once ServerSocket captures the socket from mobile phone terminal, indicate that mobile phone terminal set up and communicated by letter with computer end.
Input?Stream=socket.get?Input?Stream
While(100milliseconds?passed){
Rotation?Rate[]=(double[])Input?Stream.read?Object();}
After connection setup, computer end, taking 100ms as the cycle, constantly reads the data from mobile phone terminal.
The effect of Cursor.java is to control cursor, mainly realizes by Java.awt.robot bag the function of controlling cursor.As shown in Figure 3, screen is set up to following coordinate system.
Cursor'sPosition?in?X?axis+=(int)(gain*Rotation?Rate?around?X);
Cursor's?Position?in?Yaxis-=(int)(gain*Rotation?Rate?around?Z);
In Fig. 1, mobile phone is converted into the motion of cursor directions X in Fig. 3 around the slewing rate of X, mobile phone around the slewing rate of Z be converted into cursor in Fig. 3-motion of Y-direction.Shown in gain in false code be amplification coefficient.Because the communication frequency of portable computer end is 10HZ, gain gets more than 20 or 20, will make cursor obtain suitable translational speed.
Claims (4)
1. body sense mouse, is made up of an Android mobile phone terminal and a computer end software, carries out radio communication between the two by Wi-Fi, it is characterized in that,
Described Android end is made up of three modules, is respectively primary module, and communication is from module and gyroscope from module; Primary module is program main thread, and the interface of having realized Android application builds and calling other modules; Communication module has realized data packing encapsulation, is pushed to computer end; Gyroscope (gyro sensor) is from module, for arranging, initialization sensor, and Returning sensor data;
Described computer end is made up of primary module, communication module, three modules of cursor control module, and program structure and Android end are similar; Primary module is used for generating interface, calls other module; Communication module mainly relies on java.net.socket bag, accepts the data from Android; Cursor control module has realized calculating and the control of cursor position.
2. body sense mouse according to claim 1, is characterized in that, the described communication module course of work is as follows:
This module will create a socket object after starting, for encapsulating the data that need transmission; Socket points to the IP of computer end, and port is computer end idle port;
Socket is as information carrier, by the data of returning for encapsulated sensor;
This thread is by utilizing the continuous process that repeats to refresh packaging information in socket of timer, to ensure the communication between mobile phone terminal and computer end.
3. body sense mouse according to claim 1 and 2, is characterized in that, the described communication module course of work is as follows:
After this thread is opened, by a first newly-built Server Socket, for receiving the socket packet from mobile phone terminal; Once Server Socket captures the socket from mobile phone terminal, indicate that mobile phone terminal set up and communicated by letter with computer end;
After connection setup, computer end, taking 100ms as the cycle, constantly reads the data from mobile phone terminal.
4. body sense mouse according to claim 1 and 2 is characterised in that, the principle of work of cursor control module is as follows:
Mobile phone around the slewing rate of X with 20 times of amplifications, the translational speed as cursor at directions X, mobile phone around the slewing rate of Z with 20 times of amplifications, the translational speed as cursor in Y-direction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410132975.XA CN103941887A (en) | 2014-04-03 | 2014-04-03 | Motion sensing mouse software |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410132975.XA CN103941887A (en) | 2014-04-03 | 2014-04-03 | Motion sensing mouse software |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103941887A true CN103941887A (en) | 2014-07-23 |
Family
ID=51189580
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410132975.XA Pending CN103941887A (en) | 2014-04-03 | 2014-04-03 | Motion sensing mouse software |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103941887A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104391134A (en) * | 2014-10-22 | 2015-03-04 | 陕西法士特齿轮有限责任公司 | Testing method based on mobile phone sensor |
CN105867657A (en) * | 2016-03-24 | 2016-08-17 | 青岛职业技术学院 | Method for remotely controlling computer mouse on the basis of mobile phone sensor |
CN106534917A (en) * | 2016-11-03 | 2017-03-22 | 深圳市天易联科技有限公司 | Information processing method and device |
CN107153457A (en) * | 2016-03-04 | 2017-09-12 | 中兴通讯股份有限公司 | Projection process method and device |
CN107791254A (en) * | 2016-09-06 | 2018-03-13 | 吴战车 | The mobile phone robot that can be moved can be walked |
CN107820110A (en) * | 2017-10-31 | 2018-03-20 | 北京四达时代软件技术股份有限公司 | A kind of method, client and the server of flying squirrel remote control |
-
2014
- 2014-04-03 CN CN201410132975.XA patent/CN103941887A/en active Pending
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104391134A (en) * | 2014-10-22 | 2015-03-04 | 陕西法士特齿轮有限责任公司 | Testing method based on mobile phone sensor |
CN107153457A (en) * | 2016-03-04 | 2017-09-12 | 中兴通讯股份有限公司 | Projection process method and device |
CN105867657A (en) * | 2016-03-24 | 2016-08-17 | 青岛职业技术学院 | Method for remotely controlling computer mouse on the basis of mobile phone sensor |
CN107791254A (en) * | 2016-09-06 | 2018-03-13 | 吴战车 | The mobile phone robot that can be moved can be walked |
CN106534917A (en) * | 2016-11-03 | 2017-03-22 | 深圳市天易联科技有限公司 | Information processing method and device |
CN107820110A (en) * | 2017-10-31 | 2018-03-20 | 北京四达时代软件技术股份有限公司 | A kind of method, client and the server of flying squirrel remote control |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103941887A (en) | Motion sensing mouse software | |
WO2017041557A1 (en) | Display control method and apparatus | |
CN104144184B (en) | A kind of method and electronic equipment for controlling remote equipment | |
US10572267B2 (en) | Bios user interface control using mobile device | |
KR102381433B1 (en) | Method and apparatus for session control support for angle-of-view virtual reality streaming | |
CN108700941A (en) | For in reality environment to the method and apparatus of prospective component | |
CN110083324A (en) | Method, apparatus, electronic equipment and the computer storage medium of Image Rendering | |
EP2930937A1 (en) | Method, apparatus, and system for transferring digital media content playback | |
CN104866083B (en) | Gesture recognition method, device and system | |
CN106990964A (en) | A kind of wireless screen transmission method and wireless screen transmission system | |
CN107870666B (en) | Terminal control method and terminal | |
CN104093053B (en) | Method, equipment and the system of playing video file | |
CN106095136A (en) | A kind of wearable device controls the method for intelligent terminal | |
US20230273812A1 (en) | Display Method and Device | |
CN105094839A (en) | Method for achieving running of Android system applications based on PC machine | |
US11188144B2 (en) | Method and apparatus to navigate a virtual content displayed by a virtual reality (VR) device | |
JP2013084029A (en) | Display control device | |
CN104765550B (en) | A kind of cross-terminal application control method, user terminal and system | |
CN111176764B (en) | Display control method and terminal equipment | |
WO2023165370A1 (en) | Information exchange method and apparatus, display device, and storage medium | |
CN101577759A (en) | Mobile phone internally provided with game control device as well as game control system and method thereof | |
CN108920069A (en) | A kind of touch operation method, device, mobile terminal and storage medium | |
CN112121406A (en) | Object control method and device, storage medium and electronic device | |
WO2022088796A1 (en) | Control method and apparatus for handheld intelligent terminal, and electronic device and storage medium | |
CN205302186U (en) | Virtual reality control system based on external input |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20140723 |
|
RJ01 | Rejection of invention patent application after publication |