CN107656681A - A kind of method and device of slide on simulated touch screen - Google Patents
A kind of method and device of slide on simulated touch screen Download PDFInfo
- Publication number
- CN107656681A CN107656681A CN201610594431.4A CN201610594431A CN107656681A CN 107656681 A CN107656681 A CN 107656681A CN 201610594431 A CN201610594431 A CN 201610594431A CN 107656681 A CN107656681 A CN 107656681A
- Authority
- CN
- China
- Prior art keywords
- tilt
- tilting
- angle
- touch screen
- terminal
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0487—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
- Position Input By Displaying (AREA)
Abstract
本发明提供一种用于模拟触摸屏上的滑动操作的方法及装置,该方法包括:检测终端的倾斜动作的倾斜方向及倾斜角度;若所述倾斜动作期间不存在针对所述终端的触摸屏的触摸操作,将所述倾斜方向映射为用户在触摸屏上的滑动方向,将所述倾斜角度映射为用户在触摸屏上的滑动距离;以映射得到的滑动方向和滑动距离,生成所述触摸屏的触摸事件。本发明实施例利用倾斜动作的倾斜方向和倾斜角度来模拟用户的触摸行为使得用户无需用户触摸终端的触摸屏则能够实现触摸操作,优化用户体验。
The present invention provides a method and device for simulating a sliding operation on a touch screen. The method includes: detecting the tilt direction and tilt angle of a tilting action of a terminal; if there is no touch on the touch screen of the terminal during the tilting action, Operation, mapping the tilt direction to the user's sliding direction on the touch screen, and mapping the tilt angle to the user's sliding distance on the touch screen; generating a touch event on the touch screen with the mapped sliding direction and sliding distance. The embodiments of the present invention use the tilting direction and tilting angle of the tilting action to simulate the user's touch behavior, so that the user can realize the touch operation without the user touching the touch screen of the terminal, and optimize the user experience.
Description
技术领域technical field
本发明涉及通信技术领域,特别是指一种用于模拟触摸屏上的滑动操作的方法及装置。The invention relates to the field of communication technology, in particular to a method and device for simulating a sliding operation on a touch screen.
背景技术Background technique
目前在使用终端过程中用户找到要打开的软件非常麻烦,常常需要来回滑动屏幕好多次,才能找到要打开的应用图标;用户在看电子书、浏览图片或是浏览网页时,也经常需要左右上下来回滑动触摸屏,用户觉得很麻烦。At present, it is very troublesome for users to find the software to open when using the terminal. They often need to swipe the screen back and forth many times to find the application icon to open; Sliding the touch screen back and forth is very troublesome for users.
现有技术中用户只能通过在触摸屏上上下左右滑动来让显示内容上翻、下翻、左翻、右翻。目前很多游戏有使用传感器数据来作为用户输入的判断,例如神庙逃亡、地铁跑酷等。在玩这些游戏的时候,用户不再需要滑动屏幕,只需要左右倾斜终端,游戏安装包APK便可以做出相应的动作。现有技术一般使用Android系统自带的感应检测管理(SensorManager)接口来判断终端倾斜方向,但是用户不可关闭其倾斜功能,且该功能使用有局限性,只能在特定的游戏中使用。In the prior art, the user can only scroll up, down, left, and right on the display content by sliding up, down, left, and right on the touch screen. At present, many games use sensor data as user input judgments, such as Temple Run, Subway Surfers, etc. When playing these games, users no longer need to swipe the screen, but only need to tilt the terminal left and right, and the game installation package APK can make corresponding actions. The prior art generally uses the sensor management (SensorManager) interface that comes with the Android system to determine the tilt direction of the terminal, but the user cannot turn off the tilt function, and this function has limitations and can only be used in specific games.
发明内容Contents of the invention
本发明的目的在于提供一种用于模拟触摸屏上的滑动操作的方法及装置,解决了现有技术中对触摸屏的滑动操作需用户用手操作且可能需要多次滑动,由此造成了对用户的不便的问题。The object of the present invention is to provide a method and device for simulating the sliding operation on the touch screen, which solves the problem that the sliding operation on the touch screen in the prior art requires the user to operate by hand and may need to slide multiple times, thus causing inconvenience to the user. problem of inconvenience.
为了达到上述目的,本发明提供一种用于模拟触摸屏上的滑动操作的方法,包括:In order to achieve the above object, the present invention provides a method for simulating a sliding operation on a touch screen, including:
检测终端的倾斜动作的倾斜方向及倾斜角度;Detect the tilt direction and tilt angle of the tilt action of the terminal;
若所述倾斜动作期间不存在针对所述终端的触摸屏的触摸操作,将所述倾斜方向映射为用户在触摸屏上的滑动方向,将所述倾斜角度映射为用户在触摸屏上的滑动距离;If there is no touch operation on the touch screen of the terminal during the tilting action, mapping the tilting direction to a sliding direction of the user on the touch screen, and mapping the tilting angle to a sliding distance of the user on the touch screen;
以映射得到的滑动方向和滑动距离,生成所述触摸屏的触摸事件。A touch event of the touch screen is generated by using the sliding direction and the sliding distance obtained from the mapping.
其中,以映射得到的滑动方向和滑动距离模拟在所述触摸屏上的滑动操作之后,所述方法还包括:Wherein, after simulating the sliding operation on the touch screen with the sliding direction and sliding distance obtained through mapping, the method further includes:
根据所述触摸事件对所述终端进行操作。Operate the terminal according to the touch event.
其中,检测终端的倾斜动作的倾斜方向及倾斜角度之后,所述方法还包括:Wherein, after detecting the tilting direction and tilting angle of the tilting action of the terminal, the method further includes:
若所述倾斜动作期限存在针对所述终端的触摸屏的触摸操作,则响应所述触摸操作,并结束流程。If there is a touch operation on the touch screen of the terminal within the tilt action period, respond to the touch operation, and end the process.
其中,检测终端的倾斜动作的倾斜方向及倾斜角度的步骤,包括:Wherein, the step of detecting the tilting direction and tilting angle of the tilting action of the terminal includes:
接收用户触发的开启指令,获取接收所述开启指令的时刻所述终端所在的第一位置的数据信息;receiving an opening instruction triggered by the user, and obtaining data information of the first position where the terminal is located at the moment when the opening instruction is received;
获取所述终端的倾斜动作之后,所述终端所在的第二位置的数据信息;After acquiring the tilting action of the terminal, the data information of the second position where the terminal is located;
根据所述第一位置的数据信息和所述第二位置的数据信息,确定所述倾斜动作的倾斜方向及倾斜角度。According to the data information of the first position and the data information of the second position, the tilting direction and tilting angle of the tilting action are determined.
其中,将所述倾斜方向映射为用户在触摸屏上的滑动方向,将所述倾斜角度映射为用户在触摸屏上的滑动距离的步骤,包括:Wherein, the step of mapping the tilting direction as the sliding direction of the user on the touch screen, and mapping the tilting angle as the sliding distance of the user on the touch screen includes:
若所述倾斜角度大于预设角度,确定所述倾斜动作为有效倾斜;否则结束流程;If the tilt angle is greater than a preset angle, determine that the tilt action is an effective tilt; otherwise, end the process;
确定有效倾斜的倾斜动作的倾斜方向为用户在触摸屏上的滑动方向;Determine the tilting direction of the tilting action of valid tilting as the sliding direction of the user on the touch screen;
根据有效倾斜的倾斜动作的倾斜角度和预先设置的倾斜灵敏度参数,确定用户在触摸屏上的滑动距离。According to the tilt angle of the tilt action of the effective tilt and the preset tilt sensitivity parameter, the sliding distance of the user on the touch screen is determined.
其中,若所述倾斜角度大于预设角度,确定所述倾斜动作为有效倾斜;否则结束流程的步骤,包括:Wherein, if the tilt angle is greater than the preset angle, it is determined that the tilt action is an effective tilt; otherwise, the step of ending the process includes:
若所述倾斜角度与预先设置的响应灵敏度参数之积大于一阈值,确定所述倾斜角度大于预设角度,所述倾斜动作为有效倾斜;If the product of the tilt angle and the preset response sensitivity parameter is greater than a threshold, it is determined that the tilt angle is greater than a preset angle, and the tilt action is an effective tilt;
若所述倾斜角度与预先设置的响应灵敏度参数之积小于或者等于所述阈值,确定所述倾斜角度小于或者等于预设角度,结束流程。If the product of the inclination angle and the preset response sensitivity parameter is less than or equal to the threshold, it is determined that the inclination angle is less than or equal to the preset angle, and the process ends.
其中,根据有效倾斜的倾斜动作的倾斜角度和预先设置的倾斜灵敏度参数,确定用户在触摸屏上的滑动距离的步骤,包括:Wherein, the step of determining the sliding distance of the user on the touch screen according to the tilt angle of the tilt action of the effective tilt and the preset tilt sensitivity parameters includes:
确定所述有效倾斜的倾斜动作的倾斜角度与所述预先设置的倾斜灵敏度参数之积为用户在触摸屏上的滑动距离。It is determined that the product of the tilt angle of the tilt action of the effective tilt and the preset tilt sensitivity parameter is the sliding distance of the user on the touch screen.
本发明实施例还提供一种用于模拟触摸屏上的滑动操作的装置,包括:An embodiment of the present invention also provides a device for simulating a sliding operation on a touch screen, including:
检测模块,用于检测终端的倾斜动作的倾斜方向及倾斜角度;The detection module is used to detect the tilting direction and tilting angle of the tilting action of the terminal;
映射模块,用于若所述倾斜动作期间不存在针对所述终端的触摸屏的触摸操作,将所述倾斜方向映射为用户在触摸屏上的滑动方向,将所述倾斜角度映射为用户在触摸屏上的滑动距离;A mapping module, configured to map the tilting direction to the sliding direction of the user on the touch screen if there is no touch operation on the touch screen of the terminal during the tilting action, and map the tilting angle to the sliding direction of the user on the touch screen sliding distance;
生成模块,用于以映射得到的滑动方向和滑动距离,生成所述触摸屏的触摸事件。A generating module, configured to generate a touch event on the touch screen by using the sliding direction and sliding distance obtained from the mapping.
其中,所述装置还包括:Wherein, the device also includes:
操作模块,用于根据所述触摸事件对所述终端进行操作。An operating module, configured to operate the terminal according to the touch event.
其中,所述装置还包括:Wherein, the device also includes:
响应模块,用于若所述倾斜动作期限存在针对所述终端的触摸屏的触摸操作,则响应所述触摸操作,并结束流程。A response module, configured to respond to the touch operation and end the process if there is a touch operation on the touch screen of the terminal within the tilt action period.
其中,所述检测模块包括:Wherein, the detection module includes:
第一获取子模块,用于接收用户触发的开启指令,获取接收所述开启指令的时刻所述终端所在的第一位置的数据信息;The first acquiring submodule is configured to receive an opening instruction triggered by a user, and acquire data information of the first location where the terminal is located at the time when the opening instruction is received;
第二获取子模块,用于获取所述终端的倾斜动作之后,所述终端所在的第二位置的数据信息;The second acquiring submodule is used to acquire the data information of the second position where the terminal is located after the tilting action of the terminal;
确定子模块,用于根据所述第一位置的数据信息和所述第二位置的数据信息,确定所述倾斜动作的倾斜方向及倾斜角度。The determining submodule is configured to determine the tilting direction and tilting angle of the tilting action according to the data information of the first position and the data information of the second position.
其中,所述映射模块包括:Wherein, the mapping module includes:
判断子模块,用于若所述倾斜角度大于预设角度,确定所述倾斜动作为有效倾斜;否则结束流程;A judging submodule, configured to determine that the tilting action is an effective tilting if the tilting angle is greater than a preset angle; otherwise, end the process;
方向确定子模块,用于确定有效倾斜的倾斜动作的倾斜方向为用户在触摸屏上的滑动方向;A direction determining submodule, configured to determine that the tilting direction of the tilting action of an effective tilt is the sliding direction of the user on the touch screen;
距离确定子模块,用于根据有效倾斜的倾斜动作的倾斜角度和预先设置的倾斜灵敏度参数,确定用户在触摸屏上的滑动距离。The distance determination sub-module is configured to determine the sliding distance of the user on the touch screen according to the tilt angle of the tilt action of the effective tilt and the preset tilt sensitivity parameters.
其中,判断子模块包括:Among them, the judgment sub-module includes:
第一判断单元,用于若所述倾斜角度与预先设置的响应灵敏度参数之积大于一阈值,确定所述倾斜角度大于预设角度,所述倾斜动作为有效倾斜;A first judging unit, configured to determine that the tilt angle is greater than a preset angle if the product of the tilt angle and a preset response sensitivity parameter is greater than a threshold, and the tilt action is an effective tilt;
第二判断单元,用于若所述倾斜角度与预先设置的响应灵敏度参数之积小于或者等于所述阈值,确定所述倾斜角度小于或者等于预设角度,结束流程。The second judging unit is configured to determine that the tilt angle is less than or equal to a preset angle if the product of the tilt angle and a preset response sensitivity parameter is less than or equal to the threshold, and end the process.
其中,所述距离确定子模块包括:Wherein, the distance determination submodule includes:
距离确定单元,用于确定所述有效倾斜的倾斜动作的倾斜角度与所述预先设置的倾斜灵敏度参数之积为用户在触摸屏上的滑动距离。The distance determination unit is configured to determine that the product of the tilt angle of the tilt action of the effective tilt and the preset tilt sensitivity parameter is the sliding distance of the user on the touch screen.
本发明的上述技术方案至少具有如下有益效果:The technical solution of the present invention has at least the following beneficial effects:
本发明实施例的用于模拟触摸屏上的滑动操作的方法及装置,利用倾斜动作的倾斜方向和倾斜角度来模拟用户的触摸行为,并上报上下左右滑动的操作;从而使得用户无需滑动屏幕也可实现模拟人为触摸输入;即通过软件模拟人的触摸行为,将终端的倾斜作为一种触摸输入操作;并且本发明实施例提供这种模拟操作并不局限于某个特定的应用程序,而是可以被应用在终端的各个应用程序中,应用范围广,实用性强。The method and device for simulating the sliding operation on the touch screen in the embodiment of the present invention simulates the user's touch behavior by using the tilting direction and tilting angle of the tilting action, and reports the operation of sliding up, down, left, and right; so that the user does not need to slide the screen. Realize the simulation of human touch input; that is, simulate the human touch behavior through software, and use the tilt of the terminal as a touch input operation; and the embodiment of the present invention provides that this simulation operation is not limited to a specific application program, but can It is applied in various application programs of the terminal, and has a wide range of applications and strong practicability.
附图说明Description of drawings
图1表示本发明实施例提供的用于模拟触摸屏上的滑动操作的方法的基本步骤流程图;FIG. 1 shows a flowchart of basic steps of a method for simulating a sliding operation on a touch screen provided by an embodiment of the present invention;
图2表示本发明实施例提供的用于模拟触摸屏上的滑动操作的方法中终端倾斜翻页模拟触摸屏报点图;FIG. 2 shows a point diagram for simulating a touch screen report by tilting a page of a terminal in a method for simulating a sliding operation on a touch screen provided by an embodiment of the present invention;
图3表示本发明实施例提供的用于模拟触摸屏上的滑动操作的装置的结构示意图。FIG. 3 shows a schematic structural diagram of a device for simulating a sliding operation on a touch screen provided by an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明要解决的技术问题、技术方案和优点更加清楚,下面将结合附图及具体实施例进行详细描述。In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will describe in detail with reference to the drawings and specific embodiments.
如图1所示,本发明实施例提供一种用于模拟触摸屏上的滑动操作的方法,包括:As shown in FIG. 1, an embodiment of the present invention provides a method for simulating a sliding operation on a touch screen, including:
步骤11,检测终端的倾斜动作的倾斜方向及倾斜角度;Step 11, detecting the tilting direction and tilting angle of the tilting action of the terminal;
步骤12,若所述倾斜动作期间不存在针对所述终端的触摸屏的触摸操作,将所述倾斜方向映射为用户在触摸屏上的滑动方向,将所述倾斜角度映射为用户在触摸屏上的滑动距离;Step 12, if there is no touch operation on the touch screen of the terminal during the tilting action, map the tilting direction to the user's sliding direction on the touch screen, and map the tilting angle to the user's sliding distance on the touch screen ;
步骤13,以映射得到的滑动方向和滑动距离,生成所述触摸屏的触摸事件。Step 13, generate a touch event on the touch screen by using the sliding direction and sliding distance obtained from the mapping.
本发明的上述实施例中用户可通过倾斜终端的倾斜动作来实现模拟人为触摸终端的触摸屏的触摸事件,具体的,可通过终端上的传感器上报的数据来确定终端的倾斜方向及倾斜角度。终端上的传感器有陀螺仪、加速度传感器等,在此不一一举例。例如面向终端,此时终端正面上边框、下边框、左边框、右边框远离用户的倾斜,称为相应的上倾斜、下倾斜、左倾斜、右倾斜,即倾斜方向分别为上、下、左、右。In the above-mentioned embodiments of the present invention, the user can realize a touch event simulating an artificial touch on the touch screen of the terminal by tilting the tilting action of the terminal. Specifically, the tilting direction and tilting angle of the terminal can be determined through the data reported by the sensor on the terminal. The sensors on the terminal include a gyroscope, an acceleration sensor, etc., which are not listed here. For example, facing the terminal, when the upper frame, lower frame, left frame, and right frame on the front of the terminal are tilted away from the user, it is called the corresponding upward tilt, downward tilt, left tilt, and right tilt, that is, the tilt directions are up, down, and left, respectively. ,right.
进一步的,本发明的上述实施例中为了不影响终端的正常使用,若用户倾斜终端期间,用户在触摸屏上没有触摸行为,则将倾斜方向和倾斜角度映射为滑动方向和滑动距离,自动实现终端的触摸操作。若检测终端的倾斜动作的倾斜方向及倾斜角度之后,所述方法还包括:Further, in the above-mentioned embodiments of the present invention, in order not to affect the normal use of the terminal, if the user does not touch the touch screen while the user is tilting the terminal, the tilting direction and tilting angle are mapped to the sliding direction and sliding distance, and the terminal automatically realizes touch operation. After detecting the tilt direction and tilt angle of the tilt action of the terminal, the method further includes:
若所述倾斜动作期限存在针对所述终端的触摸屏的触摸操作,则响应所述触摸操作,并结束流程。If there is a touch operation on the touch screen of the terminal within the tilt action period, respond to the touch operation, and end the process.
即本发明的上述实施例中在所述倾斜动作期间,如果用户手指在触摸屏上触摸,则终端会优先响应人为的触摸行为,不响应终端的倾斜动作。That is, in the above-mentioned embodiments of the present invention, during the tilting action, if the user's finger touches the touch screen, the terminal will give priority to responding to the artificial touch behavior, and will not respond to the tilting action of the terminal.
具体的,本发明的上述实施例中步骤13之后所述方法还包括:Specifically, the method described after step 13 in the above-mentioned embodiments of the present invention also includes:
步骤14,根据所述触摸事件对所述终端进行操作。Step 14, operate the terminal according to the touch event.
即根据步骤12中映射得到的触摸事件的滑动方向和滑动距离对终端进行操作,例如触摸事件的滑动方向为右滑,滑动距离为1cm,则终端自动向右滑动1cm。That is, operate the terminal according to the sliding direction and sliding distance of the touch event mapped in step 12. For example, if the sliding direction of the touch event is right and the sliding distance is 1 cm, the terminal will automatically slide 1 cm to the right.
进一步的,本发明实施例中步骤11包括:Further, step 11 in the embodiment of the present invention includes:
步骤111,接收用户触发的开启指令,获取接收所述开启指令的时刻所述终端所在的第一位置的数据信息;Step 111, receiving an opening instruction triggered by the user, and obtaining data information of the first location where the terminal is located at the moment when the opening instruction is received;
步骤112,获取所述终端的倾斜动作之后,所述终端所在的第二位置的数据信息;Step 112, acquiring the data information of the second position where the terminal is located after the tilting action of the terminal;
步骤113,根据所述第一位置的数据信息和所述第二位置的数据信息,确定所述倾斜动作的倾斜方向及倾斜角度。Step 113, according to the data information of the first position and the data information of the second position, determine the tilting direction and tilting angle of the tilting action.
本发明实施例中为了避免倾斜动作产生误操作,故设置一打开该模拟滑动操作的功能按键,该功能按键可以为实体按键,也可以为虚拟按键。进一步的,为了描述方便,将该功能简称为“倾向功能”。倾向功能打开时,终端接收到用户触发的开启指令,则将终端的当前倾斜位置(即第一位置)设置为参考原点。则用户将终端倾斜之后,获取终端所在的第二位置,则将第二位置与参考原点比较,则能够得出倾斜动作的倾斜方向及倾斜角度。In the embodiment of the present invention, in order to avoid misoperation caused by the tilting action, a function button is set to enable the simulated sliding operation. The function button can be a physical button or a virtual button. Further, for the convenience of description, this function is simply referred to as "inclination function". When the inclination function is turned on, the terminal will set the current inclination position of the terminal (ie, the first position) as the reference origin after receiving the turn-on instruction triggered by the user. After the user tilts the terminal, the second position where the terminal is located is obtained, and the second position is compared with the reference origin to obtain the tilting direction and tilting angle of the tilting action.
具体的,本发明实施例中步骤12,包括:Specifically, step 12 in the embodiment of the present invention includes:
步骤121,若所述倾斜角度大于预设角度,确定所述倾斜动作为有效倾斜;否则结束流程;Step 121, if the tilt angle is greater than a preset angle, determine that the tilt action is an effective tilt; otherwise, end the process;
步骤122,确定有效倾斜的倾斜动作的倾斜方向为用户在触摸屏上的滑动方向;Step 122, determining that the tilting direction of the tilting action of valid tilting is the sliding direction of the user on the touch screen;
步骤123,根据有效倾斜的倾斜动作的倾斜角度和预先设置的倾斜灵敏度参数,确定用户在触摸屏上的滑动距离。Step 123: Determine the sliding distance of the user on the touch screen according to the tilt angle of the tilt action of the effective tilt and the preset tilt sensitivity parameters.
为了进一步避免误倾斜导致的误操作,预先设置一角度,大于该角度的倾斜角度则为有效倾斜;小于或者等于该角度的倾斜角度则为误操作,不予处理。即步骤121包括:In order to further avoid misoperation caused by wrong tilt, an angle is set in advance, and the tilt angle greater than this angle is effective tilt; the tilt angle less than or equal to this angle is misoperation and will not be processed. That is, step 121 includes:
若所述倾斜角度与预先设置的响应灵敏度参数之积大于一阈值,确定所述倾斜角度大于预设角度,所述倾斜动作为有效倾斜;If the product of the tilt angle and the preset response sensitivity parameter is greater than a threshold, it is determined that the tilt angle is greater than a preset angle, and the tilt action is an effective tilt;
若所述倾斜角度与预先设置的响应灵敏度参数之积小于或者等于所述阈值,确定所述倾斜角度小于或者等于预设角度,结束流程。If the product of the inclination angle and the preset response sensitivity parameter is less than or equal to the threshold, it is determined that the inclination angle is less than or equal to the preset angle, and the process ends.
具体的,其滑动方向与倾斜方向一致,而其滑动距离与倾斜角度和预先设置的倾斜灵敏度参数确定。具体的,所述有效倾斜的倾斜动作的倾斜角度与所述预先设置的倾斜灵敏度参数之积为用户在触摸屏上的滑动距离。Specifically, the sliding direction is consistent with the tilting direction, and the sliding distance is determined by the tilting angle and preset tilting sensitivity parameters. Specifically, the product of the tilt angle of the tilt action of the effective tilt and the preset tilt sensitivity parameter is the sliding distance of the user on the touch screen.
需要说明的是,上述预先设置的响应灵敏度参数以及预先设置的倾斜灵敏度参数可以是终端的系统设置的,也可以是用户自行设置的,在此不作具体限定。It should be noted that, the preset response sensitivity parameter and the preset tilt sensitivity parameter may be set by the system of the terminal, or may be set by the user themselves, which are not specifically limited here.
综上,本发明实施例提供的模拟触摸屏上的滑动操作的方法中,终端具有如下功能或参数:To sum up, in the method for simulating the sliding operation on the touch screen provided by the embodiment of the present invention, the terminal has the following functions or parameters:
复位:将终端的当时倾斜位置设置为参考原点。Reset: Set the current tilt position of the terminal as the reference origin.
响应速度参数:倾向功能打开时,每间隔多长时间检测一次终端的倾斜方向与倾斜角度。Response speed parameter: When the inclination function is turned on, how long does it take to detect the tilt direction and tilt angle of the terminal every time.
响应灵敏度参数:对倾斜方向做修改,即当终端倾斜时,倾斜多少才认为一次有效倾斜。Response sensitivity parameter: Modify the tilt direction, that is, when the terminal is tilted, how much tilt is considered an effective tilt.
倾斜灵敏度参数:对倾斜角度做修正,即倾斜角度很小时,也可变换为较长的触摸行为。Tilt sensitivity parameter: Correct the tilt angle, that is, when the tilt angle is small, it can also be transformed into a longer touch behavior.
倾斜方向:从终端传感器中直接获取数据,通过对比x,y,z方向数据,便可得出倾斜方向。Tilt direction: Obtain data directly from the terminal sensor, and compare the data in the x, y, and z directions to obtain the tilt direction.
倾斜角度*倾斜灵敏度参数=长度值,即将倾斜动作模拟为从(0,0)点划到了(0,长度值)。Tilt angle*tilt sensitivity parameter=length value, that is, the tilt action is simulated as a stroke from (0, 0) point to (0, length value).
其具体工作流程如下:Its specific workflow is as follows:
该功能打开后,倾向功能模块会一直检测终端当前状态与参考原点的值,并得出实时的倾斜方向数据。如果终端当前的状态值*响应灵敏度参数>阈值,则进一步判断终端当前的状态与参考原点倾斜角度,再根据得出的倾斜方向,得出从哪个点划到了哪个点。After this function is turned on, the inclination function module will always detect the current status of the terminal and the value of the reference origin, and obtain real-time inclination direction data. If the terminal's current state value*response sensitivity parameter>threshold, then further judge the terminal's current state and the reference origin tilt angle, and then obtain which point to draw from which point according to the obtained tilt direction.
如果终端认为此时有人手指在触摸屏幕,触摸屏则不响应倾斜模块的软件中断。否则触摸屏从倾斜模块获取到滑动的起点位置和终点位置,并上报;系统响应上报的输入事件并做出相应的动作。If the terminal thinks that someone's finger is touching the screen at this time, the touch screen will not respond to the software interrupt of the tilt module. Otherwise, the touch screen acquires the start position and end position of the slide from the tilt module, and reports it; the system responds to the reported input event and takes corresponding actions.
具体的,举例说明其软件实现流程:Specifically, give an example to illustrate its software implementation process:
其中,从(0,0)点划到了(0,high),或者从(0,high)点划到了(0,0),或者length,0)点划到了(0,0),或者从(0,0)点划到了(0,length)的示意图如图2所示。Among them, from (0, 0) to (0, high), or from (0, high) to (0, 0), or length, 0) to (0, 0), or from ( 0, 0) to (0, length) is shown in Figure 2.
为了进一步丰富本申请的内容,下面结合具体应用实例对本申请提供的用于模拟触摸屏上的滑动操作的方法进行描述:In order to further enrich the content of this application, the method for simulating a sliding operation on a touch screen provided by this application is described below in conjunction with specific application examples:
终端处于水平方位,要使用该功能时。首先将终端置于水平位置,然后在设置中进行复位操作。这时终端会以水平位置为参考点进行倾斜方向与倾斜角度判断。也可在终端垂直位置进行复位设置,这样终端便以垂直位置为参考点进行倾斜方向与倾斜角度判断。When the terminal is in a horizontal orientation, this function is to be used. First place the terminal in a horizontal position, then perform a reset operation in the settings. At this time, the terminal will use the horizontal position as a reference point to judge the tilt direction and tilt angle. The reset setting can also be performed at the vertical position of the terminal, so that the terminal can use the vertical position as a reference point to judge the tilt direction and tilt angle.
应用实例1:当倾斜翻页功能打开时,浏览网页、查看图片、看电子书倾斜终端,画面会自动翻页。Application example 1: When the tilting page turning function is turned on, browse the web, view pictures, and read e-books by tilting the terminal, the screen will automatically turn pages.
应用实例2:当倾斜翻页功能打开时,在终端的所有使用场景,Application example 2: When the tilt page turning function is turned on, in all usage scenarios of the terminal,
向上倾斜终端,相当于一次人在触摸屏上的向上滑动。Tilting the terminal upwards is equivalent to one swipe upwards on the touch screen.
向下倾斜终端,相当于一次人在触摸屏上的向下滑动。Tilting the terminal down is equivalent to one swipe down on the touch screen.
向左倾斜终端,相当于一次人在触摸屏上的向左滑动。Tilting the terminal to the left is equivalent to swiping left on the touch screen.
向右倾斜终端,相当于一次人在触摸屏上的向右滑动。Tilting the terminal to the right is equivalent to swiping right on the touch screen.
并且滑动的长度,根据倾斜角度及预先设置的倾斜灵敏度参数的不同而不同。And the sliding length is different according to the tilt angle and the preset tilt sensitivity parameters.
应用实例3:在网页浏览界面,用户向下倾斜终端,但画面向下只刷新了几行。这时可在设置中将倾斜灵敏度参数改大,便可实现在同样的倾斜角度下,多刷新几行数据。反之亦然;Application example 3: In the web browsing interface, the user tilts the terminal downward, but only a few lines are refreshed downward on the screen. At this time, you can increase the tilt sensitivity parameter in the settings, and you can refresh a few more lines of data at the same tilt angle. vice versa;
应用实例4:在图片浏览界面,用户向左、向右倾斜终端,图片会不断更新。如果出现倾斜但图片不刷新,可在设置中将倾斜灵敏度参数改大,然后用同样的倾斜角度,图片实现更新。Application example 4: In the picture browsing interface, the user tilts the terminal left and right, and the picture will be updated continuously. If there is a tilt but the picture does not refresh, you can increase the tilt sensitivity parameter in the settings, and then use the same tilt angle to update the picture.
综上,本发明的上述实施例使用传感器数据来判断终端的倾斜方向与倾斜角度,并将倾斜方向映射为人在触摸屏上的触摸方向,将倾斜角度映射为人在触摸屏上的触摸长短;进一步模拟触摸屏事件上报流程,这样便可以根据终端的倾斜方向及倾斜角度来自动的实现人为的简单触摸操作。且用户可自行打开、关闭该倾斜翻页功能。该功能打开后,适用于终端的所有使用场景。In summary, the above embodiments of the present invention use sensor data to determine the tilt direction and tilt angle of the terminal, and map the tilt direction to the touch direction of a person on the touch screen, and map the tilt angle to the touch length of a person on the touch screen; further simulating the touch screen Event reporting process, so that the human-made simple touch operation can be automatically realized according to the tilt direction and tilt angle of the terminal. And the user can turn on and off the inclined page turning function by himself. After this function is enabled, it is applicable to all usage scenarios of the terminal.
具体的,通过终端倾斜,传感器检测到不同的倾斜方向与程度,然后将该数据通过计算、分析,得出倾斜的方向与程度,然后使用该数据,模拟人在触摸屏上的上下左右滑动,且该功能打开后,不影响触摸屏的正常使用;进一步的用户可配置响应速度参数、响应灵敏度参数、倾斜灵敏度参数等,符合人性化的设计。Specifically, through the tilt of the terminal, the sensor detects different tilt directions and degrees, and then calculates and analyzes the data to obtain the direction and degree of tilt, and then uses the data to simulate people sliding up, down, left, and right on the touch screen, and After this function is turned on, it will not affect the normal use of the touch screen; further users can configure the response speed parameters, response sensitivity parameters, tilt sensitivity parameters, etc., in line with humanized design.
为了更好的实现上述目的,如图3所示,本发明实施还提供一种用于模拟触摸屏上的滑动操作的装置,包括:In order to better achieve the above purpose, as shown in Figure 3, the implementation of the present invention also provides a device for simulating a sliding operation on a touch screen, including:
检测模块31,用于检测终端的倾斜动作的倾斜方向及倾斜角度;A detection module 31, configured to detect the tilting direction and tilting angle of the tilting action of the terminal;
映射模块32,用于若所述倾斜动作期间不存在针对所述终端的触摸屏的触摸操作,将所述倾斜方向映射为用户在触摸屏上的滑动方向,将所述倾斜角度映射为用户在触摸屏上的滑动距离;The mapping module 32 is configured to map the tilt direction to the user's sliding direction on the touch screen if there is no touch operation on the touch screen of the terminal during the tilt action, and map the tilt angle to the user's sliding direction on the touch screen. the sliding distance;
生成模块33,用于以映射得到的滑动方向和滑动距离,生成所述触摸屏的触摸事件。The generating module 33 is configured to generate a touch event of the touch screen by using the sliding direction and sliding distance obtained through the mapping.
具体的,本发明的上述实施例中所述装置还包括:Specifically, the device described in the above-mentioned embodiments of the present invention also includes:
操作模块,用于根据所述触摸事件对所述终端进行操作。An operating module, configured to operate the terminal according to the touch event.
具体的,本发明的上述实施例中所述装置还包括:Specifically, the device described in the above-mentioned embodiments of the present invention also includes:
响应模块,用于若所述倾斜动作期限存在针对所述终端的触摸屏的触摸操作,则响应所述触摸操作,并结束流程。A response module, configured to respond to the touch operation and end the process if there is a touch operation on the touch screen of the terminal within the tilt action period.
具体的,本发明的上述实施例中所述检测模块包括:Specifically, the detection module described in the above-mentioned embodiments of the present invention includes:
第一获取子模块,用于接收用户触发的开启指令,获取接收所述开启指令的时刻所述终端所在的第一位置的数据信息;The first acquiring submodule is configured to receive an opening instruction triggered by a user, and acquire data information of the first location where the terminal is located at the time when the opening instruction is received;
第二获取子模块,用于获取所述终端的倾斜动作之后,所述终端所在的第二位置的数据信息;The second acquiring submodule is used to acquire the data information of the second position where the terminal is located after the tilting action of the terminal;
确定子模块,用于根据所述第一位置的数据信息和所述第二位置的数据信息,确定所述倾斜动作的倾斜方向及倾斜角度。The determining submodule is configured to determine the tilting direction and tilting angle of the tilting action according to the data information of the first position and the data information of the second position.
具体的,本发明的上述实施例中所述映射模块包括:Specifically, the mapping module described in the above-mentioned embodiments of the present invention includes:
判断子模块,用于若所述倾斜角度大于预设角度,确定所述倾斜动作为有效倾斜;否则结束流程;A judging submodule, configured to determine that the tilting action is an effective tilting if the tilting angle is greater than a preset angle; otherwise, end the process;
方向确定子模块,用于确定有效倾斜的倾斜动作的倾斜方向为用户在触摸屏上的滑动方向;A direction determining submodule, configured to determine that the tilting direction of the tilting action of an effective tilt is the sliding direction of the user on the touch screen;
距离确定子模块,用于根据有效倾斜的倾斜动作的倾斜角度和预先设置的倾斜灵敏度参数,确定用户在触摸屏上的滑动距离。The distance determination sub-module is configured to determine the sliding distance of the user on the touch screen according to the tilt angle of the tilt action of the effective tilt and the preset tilt sensitivity parameters.
具体的,本发明的上述实施例中判断子模块包括:Specifically, the judging submodule in the above-mentioned embodiment of the present invention includes:
第一判断单元,用于若所述倾斜角度与预先设置的响应灵敏度参数之积大于一阈值,确定所述倾斜角度大于预设角度,所述倾斜动作为有效倾斜;A first judging unit, configured to determine that the tilt angle is greater than a preset angle if the product of the tilt angle and a preset response sensitivity parameter is greater than a threshold, and the tilt action is an effective tilt;
第二判断单元,用于若所述倾斜角度与预先设置的响应灵敏度参数之积小于或者等于所述阈值,确定所述倾斜角度小于或者等于预设角度,结束流程。The second judging unit is configured to determine that the tilt angle is less than or equal to a preset angle if the product of the tilt angle and a preset response sensitivity parameter is less than or equal to the threshold, and end the process.
具体的,本发明的上述实施例中所述距离确定子模块包括:Specifically, the distance determination submodule in the above-mentioned embodiments of the present invention includes:
距离确定单元,用于确定所述有效倾斜的倾斜动作的倾斜角度与所述预先设置的倾斜灵敏度参数之积为用户在触摸屏上的滑动距离。The distance determination unit is configured to determine that the product of the tilt angle of the tilt action of the effective tilt and the preset tilt sensitivity parameter is the sliding distance of the user on the touch screen.
综上,本发明的上述实施例利用倾斜动作的倾斜方向和倾斜角度来模拟用户的触摸行为,并上报上下左右滑动的操作;从而使得用户无需滑动屏幕也可实现模拟人为触摸输入;即通过软件模拟人的触摸行为,将终端的倾斜作为一种触摸输入操作;并且本发明实施例提供这种模拟操作并不局限于某个特定的应用程序,而是可以被应用在终端的各个应用程序中,应用范围广,实用性强。To sum up, the above embodiments of the present invention use the tilting direction and tilting angle of the tilting action to simulate the user's touch behavior, and report the operation of sliding up, down, left, and right; so that the user can simulate human touch input without sliding the screen; that is, through software Simulate human touch behavior, and use the tilt of the terminal as a touch input operation; and the embodiment of the present invention provides that this simulation operation is not limited to a specific application, but can be applied to various applications of the terminal , Wide range of applications, strong practicability.
需要说明的是,本发明实施例提供的用于模拟触摸屏上的滑动操作的装置是应用上述用于模拟触摸屏上的滑动操作的方法的装置,则上述用于模拟触摸屏上的滑动操作的方法的所有实施例均适用于该装置,且均能达到相同或相似的有益效果。It should be noted that the device for simulating the sliding operation on the touch screen provided by the embodiment of the present invention is a device applying the above-mentioned method for simulating the sliding operation on the touch screen, then the above-mentioned method for simulating the sliding operation on the touch screen All the embodiments are applicable to the device, and all can achieve the same or similar beneficial effects.
以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明所述原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is a preferred embodiment of the present invention, it should be pointed out that for those of ordinary skill in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, these improvements and modifications It should also be regarded as the protection scope of the present invention.
Claims (14)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610594431.4A CN107656681A (en) | 2016-07-26 | 2016-07-26 | A kind of method and device of slide on simulated touch screen |
| PCT/CN2017/089011 WO2018019053A1 (en) | 2016-07-26 | 2017-06-19 | Method and device for simulating slide operation on touchscreen |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610594431.4A CN107656681A (en) | 2016-07-26 | 2016-07-26 | A kind of method and device of slide on simulated touch screen |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN107656681A true CN107656681A (en) | 2018-02-02 |
Family
ID=61016823
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610594431.4A Pending CN107656681A (en) | 2016-07-26 | 2016-07-26 | A kind of method and device of slide on simulated touch screen |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN107656681A (en) |
| WO (1) | WO2018019053A1 (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109324740A (en) * | 2018-09-30 | 2019-02-12 | 联想(北京)有限公司 | A kind of processing method and processing terminal |
| CN111966264A (en) * | 2020-10-21 | 2020-11-20 | 深圳华声医疗技术股份有限公司 | Medical ultrasonic apparatus, control method thereof, and computer storage medium |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120540568B (en) * | 2025-07-25 | 2025-09-26 | 江苏锦花电子股份有限公司 | Slide bar running state management system and method for on-screen touch |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103218158A (en) * | 2013-03-08 | 2013-07-24 | 东莞宇龙通信科技有限公司 | Method and device for controlling page display |
| CN103729119A (en) * | 2012-10-16 | 2014-04-16 | 北京千橡网景科技发展有限公司 | Method and device used for simulating sliding operation on touch screen of electronic product |
| CN103777859A (en) * | 2012-10-17 | 2014-05-07 | Sap股份公司 | Method and apparatus using mobile to navigate time and time scale |
| CN104516663A (en) * | 2013-09-29 | 2015-04-15 | 华为技术有限公司 | Method and device for turning pages for browsing |
| CN104808856A (en) * | 2015-05-04 | 2015-07-29 | 深圳市欧珀通信软件有限公司 | Method and device for simulating sliding of touch screen and mobile terminal |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20120084467A (en) * | 2011-01-20 | 2012-07-30 | 삼성전자주식회사 | Method for changing page in e-book reader and device thereof |
| CN102156555A (en) * | 2011-03-08 | 2011-08-17 | 惠州Tcl移动通信有限公司 | Page browsing method and electronic equipment using same |
| CN104850332B (en) * | 2015-03-19 | 2018-10-09 | 惠州Tcl移动通信有限公司 | Intelligent terminal control method and intelligent terminal |
-
2016
- 2016-07-26 CN CN201610594431.4A patent/CN107656681A/en active Pending
-
2017
- 2017-06-19 WO PCT/CN2017/089011 patent/WO2018019053A1/en not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103729119A (en) * | 2012-10-16 | 2014-04-16 | 北京千橡网景科技发展有限公司 | Method and device used for simulating sliding operation on touch screen of electronic product |
| CN103777859A (en) * | 2012-10-17 | 2014-05-07 | Sap股份公司 | Method and apparatus using mobile to navigate time and time scale |
| CN103218158A (en) * | 2013-03-08 | 2013-07-24 | 东莞宇龙通信科技有限公司 | Method and device for controlling page display |
| CN104516663A (en) * | 2013-09-29 | 2015-04-15 | 华为技术有限公司 | Method and device for turning pages for browsing |
| CN104808856A (en) * | 2015-05-04 | 2015-07-29 | 深圳市欧珀通信软件有限公司 | Method and device for simulating sliding of touch screen and mobile terminal |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109324740A (en) * | 2018-09-30 | 2019-02-12 | 联想(北京)有限公司 | A kind of processing method and processing terminal |
| CN109324740B (en) * | 2018-09-30 | 2022-07-26 | 联想(北京)有限公司 | Processing method and processing terminal |
| CN111966264A (en) * | 2020-10-21 | 2020-11-20 | 深圳华声医疗技术股份有限公司 | Medical ultrasonic apparatus, control method thereof, and computer storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2018019053A1 (en) | 2018-02-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20240137462A1 (en) | Display apparatus and control methods thereof | |
| US10514842B2 (en) | Input techniques for virtual reality headset devices with front touch screens | |
| CN105183284B (en) | A kind of method and user terminal for checking short message | |
| US10042546B2 (en) | Systems and methods to present multiple frames on a touch screen | |
| EP2907020B1 (en) | Multi-modal user expressions and user intensity as interactions with an application | |
| US9864498B2 (en) | Automatic scrolling based on gaze detection | |
| CN103677569B (en) | Method for processing user interface of electronic equipment and electronic equipment | |
| CN103645844A (en) | Page displaying method and device | |
| US10488918B2 (en) | Analysis of user interface interactions within a virtual reality environment | |
| US9400575B1 (en) | Finger detection for element selection | |
| CN109240495B (en) | Method and equipment for controlling automatic page turning | |
| TWI610220B (en) | Automatic control device and method for displaying screen density | |
| US10248307B2 (en) | Virtual reality headset device with front touch screen | |
| CN107656681A (en) | A kind of method and device of slide on simulated touch screen | |
| US9958946B2 (en) | Switching input rails without a release command in a natural user interface | |
| KR102175853B1 (en) | Method for controlling operation and an electronic device thereof | |
| US9898183B1 (en) | Motions for object rendering and selection | |
| US10318131B2 (en) | Method for scaling down effective display area of screen, and mobile terminal | |
| US10222866B2 (en) | Information processing method and electronic device | |
| CN105630204A (en) | Mouse simulation system and method | |
| CN104915095B (en) | A kind of method and terminal of the information display state for adjusting terminal display interface | |
| KR20180091085A (en) | Information presentation method and terminal device | |
| CN104122980A (en) | Electronic device and touch feedback method | |
| BR112018013735B1 (en) | DISPLAY APPARATUS, AND METHOD OF CONTROLLING A DISPLAY APPARATUS | |
| KR20110093509A (en) | Presentation control method and system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180202 |