[go: up one dir, main page]

CN103399662B - A kind of touch-screen that processes reports the method for coordinate event, system and mobile terminal - Google Patents

A kind of touch-screen that processes reports the method for coordinate event, system and mobile terminal Download PDF

Info

Publication number
CN103399662B
CN103399662B CN201310282514.6A CN201310282514A CN103399662B CN 103399662 B CN103399662 B CN 103399662B CN 201310282514 A CN201310282514 A CN 201310282514A CN 103399662 B CN103399662 B CN 103399662B
Authority
CN
China
Prior art keywords
coordinate
sliding
slope
point coordinate
terminal point
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.)
Expired - Fee Related
Application number
CN201310282514.6A
Other languages
Chinese (zh)
Other versions
CN103399662A (en
Inventor
张强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201310282514.6A priority Critical patent/CN103399662B/en
Publication of CN103399662A publication Critical patent/CN103399662A/en
Application granted granted Critical
Publication of CN103399662B publication Critical patent/CN103399662B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

本发明公开了一种处理触摸屏上报坐标事件的方法、系统及移动终端,该方法包括以下步骤:判断当前使用的应用程序是否支持横向滑动列表操作;若支持,则采集用户在触摸屏上进行滑动操作时滑动轨迹的起点坐标和终点坐标,采集过后,先不上报终点坐标;计算滑动轨迹的斜率;当滑动轨迹的斜率的绝对值大于设定值时,则将终点坐标的横坐标修改为起点坐标的横坐标,上报修正后的终点坐标;当应用层接收到修正后的终点坐标时,则做出纵向滑动的反应。本发明能够避免应用层将用户在触摸屏上进行的纵向滑动操作误认为是横向滑动操作,同时,当这些修正与规范过后的坐标上报到应用层时,就不会因为不同的应用层处理原则不一样导致不一样的结果。

The invention discloses a method, system and mobile terminal for processing a coordinate event reported by a touch screen. The method includes the following steps: judging whether the currently used application program supports horizontal sliding list operation; if it supports, collecting the user's sliding operation on the touch screen When the coordinates of the starting point and end point of the sliding track are collected, the end point coordinates are not reported first; the slope of the sliding track is calculated; when the absolute value of the slope of the sliding track is greater than the set value, the abscissa of the end point coordinates is changed to the starting point coordinates , and report the corrected end coordinates; when the application layer receives the corrected end coordinates, it responds to vertical sliding. The present invention can prevent the application layer from mistaking the user's vertical sliding operation on the touch screen as a horizontal sliding operation. The same leads to different results.

Description

一种处理触摸屏上报坐标事件的方法、系统及移动终端A method, system and mobile terminal for processing coordinate events reported by a touch screen

技术领域technical field

本发明涉及通讯技术领域,更具体地说,是涉及一种处理触摸屏上报坐标事件的方法、系统及移动终端。The present invention relates to the technical field of communication, and more specifically, relates to a method, a system and a mobile terminal for processing a coordinate event reported by a touch screen.

背景技术Background technique

触摸屏给用户的操作带来了很大的便利,但是个人使用方式有所不同,有的人喜欢用左手握手机,有的人喜欢用右手握手机。当我们用左手操作触摸屏进行滑动的时候,我们手指的滑动轨迹通常都是图1这样的,而当我们用右手操作触摸屏进行滑动的时候,我们手指的滑动轨迹通常都是图2这样的,不管是往左滑动还是往右滑动,只要是单手操作,往往都是一道弧线,不同的人滑动的时候弧线的弧度也许不一样,但是趋势肯定是一样的。The touch screen brings great convenience to the user's operation, but there are differences in personal use methods. Some people like to hold the mobile phone with their left hand, and some people like to hold their mobile phone with their right hand. When we use the left hand to operate the touch screen to slide, the sliding track of our finger is usually like Figure 1, and when we use the right hand to operate the touch screen to slide, the sliding track of our finger is usually like Figure 2, no matter Swipe left or right, as long as it is operated with one hand, it is often an arc. When different people swipe, the arc may be different, but the trend is definitely the same.

目前,在很多应用程序(比如说搜狐新闻、3G新闻、QQ)等界面下,都是支持横向滑动以及纵向滑动操作的,也就是当手指上下滑动的时候,会操作纵向的内容滚动条,当手指左右滑动的时候,会切换横向滑动列表(比如说从IT切换到体育或者娱乐),如下图3所示。At present, many applications (such as Sohu News, 3G News, QQ) and other interfaces support horizontal sliding and vertical sliding operations, that is, when the finger slides up and down, the vertical content scroll bar will be operated. When the finger slides left and right, it will switch the horizontal sliding list (for example, switch from IT to sports or entertainment), as shown in Figure 3 below.

正如图1以及图2讲述的,我们单手操作的轨迹往往都是一道弧线,也就是坐标在x轴方向上有较大的移动,同时在y轴方向上也有较大的移动,那么当这样的坐标上报上去的时候,有时候就会引起这样的问题:我的本意是向下滑动,但是应用界面实际上却横向滑动了(大多数用户在上下滑动的时候比较随意,而横向操作的时候比较规范),而且不同的应用程序,情况也有所区别。As described in Figure 1 and Figure 2, the trajectory of our one-handed operation is often an arc, that is, the coordinates have a large movement in the x-axis direction and a large movement in the y-axis direction, then when When such coordinates are reported up, sometimes it will cause such a problem: my original intention is to slide down, but the application interface actually slides horizontally (most users are more casual when sliding up and down, while horizontal operation Time is more standardized), and different applications, the situation is also different.

发明内容Contents of the invention

本发明的目的在于克服现有技术中的上述缺陷,提供一种处理触摸屏上报坐标事件的方法。The purpose of the present invention is to overcome the above-mentioned defects in the prior art, and provide a method for processing a coordinate event reported by a touch screen.

为实现上述目的,本发明提供的技术方案如下:一种处理触摸屏上报坐标事件的方法,其包括以下步骤:In order to achieve the above object, the technical solution provided by the present invention is as follows: a method for processing a coordinate event reported by a touch screen, which includes the following steps:

判断当前使用的应用程序是否支持横向滑动列表操作;Determine whether the currently used application supports horizontal sliding list operations;

当应用程序支持横向滑动列表操作时,则采集用户在触摸屏上进行滑动操作时滑动轨迹的起点坐标和终点坐标,采集过后,先不上报终点坐标;When the application supports horizontal sliding list operations, collect the starting point coordinates and end point coordinates of the sliding track when the user performs a sliding operation on the touch screen, and do not report the end point coordinates after collection;

根据起点坐标和终点坐标计算滑动轨迹的斜率;Calculate the slope of the sliding trajectory based on the starting point coordinates and the ending point coordinates;

将滑动轨迹的斜率的绝对值与设定值进行对比;Compare the absolute value of the slope of the sliding track with the set value;

当滑动轨迹的斜率的绝对值大于设定值时,则将终点坐标的横坐标修改为起点坐标的横坐标,上报修正后的终点坐标;When the absolute value of the slope of the sliding track is greater than the set value, modify the abscissa of the end point coordinates to the abscissa of the starting point coordinates, and report the corrected end point coordinates;

当应用层接收到修正后的终点坐标时,则做出纵向滑动的反应。When the application layer receives the corrected end point coordinates, it responds to vertical sliding.

进一步而言,所述判断当前使用的应用程序是否支持横向滑动列表操作的步骤之后还包括:Further, after the step of judging whether the currently used application supports horizontal sliding list operation, it also includes:

当应用程序不支持横向滑动列表操作时,则采用正常的上报坐标处理。When the application does not support the horizontal sliding list operation, the normal reporting coordinate processing is adopted.

进一步而言,所述将滑动轨迹的斜率的绝对值与设定值进行对比的步骤之后还包括:Further, after the step of comparing the absolute value of the slope of the sliding track with the set value, it also includes:

当滑动轨迹的斜率的绝对值小于设定值时,则上报正常的终点坐标;When the absolute value of the slope of the sliding track is less than the set value, the normal end point coordinates are reported;

当应用层接收到正常的终点坐标时,则做出横向滑动的反应。When the application layer receives the normal end point coordinates, it responds to horizontal sliding.

进一步而言,所述滑动轨迹的斜率通过起点坐标和终点坐标的纵坐标之差除以起点坐标和终点坐标的横坐标之差得到。Further, the slope of the sliding track is obtained by dividing the difference between the ordinates of the start point coordinates and the end point coordinates by the difference between the abscissa coordinates of the start point coordinates and the end point coordinates.

进一步而言,所述判断当前使用的应用程序是否支持横向滑动列表操作的步骤之前还包括:Further, before the step of judging whether the currently used application supports horizontal sliding list operation, it also includes:

预先设置与滑动轨迹的斜率的绝对值相对比的设定值。A set value relative to the absolute value of the slope of the slide trajectory is set in advance.

进一步而言,所述当应用层接收到修正后的终点坐标时,则做出纵向滑动的反应的步骤之后还包括:Further, when the application layer receives the corrected coordinates of the end point, the step of responding to vertical sliding further includes:

当退出支持横向滑动列表操作的应用程序时,则退出触摸屏上报坐标修正,采用正常的上报坐标处理。When exiting the application program that supports horizontal sliding list operation, exit the touch screen to report the coordinate correction, and adopt the normal reporting coordinate processing.

本发明的另一目的在于,提供一种处理触摸屏上报坐标事件的系统,其包括:Another object of the present invention is to provide a system for processing coordinate events reported by a touch screen, which includes:

判断模块,用于判断当前使用的应用程序是否支持横向滑动列表操作;Judging module, used for judging whether the currently used application program supports horizontal sliding list operation;

坐标采集模块,用于当所述判断模块判断到当前使用的应用程序支持横向滑动列表操作时,采集用户在触摸屏上进行滑动操作时滑动轨迹的起点坐标和终点坐标,采集过后,先不上报终点坐标;Coordinate acquisition module, used for collecting the starting point coordinates and end point coordinates of the sliding track when the user performs a sliding operation on the touch screen when the judging module judges that the currently used application program supports the horizontal sliding list operation, and does not report the end point after the collection coordinate;

斜率计算模块,用于根据所述坐标采集模块采集到的起点坐标和终点坐标计算滑动轨迹的斜率;A slope calculation module, configured to calculate the slope of the sliding track according to the starting point coordinates and end point coordinates collected by the coordinate collection module;

对比模块,用于将所述斜率计算模块计算得到的滑动轨迹的斜率的绝对值与设定值进行对比;A comparison module, configured to compare the absolute value of the slope of the sliding trajectory calculated by the slope calculation module with a set value;

坐标修正模块,用于读取所述对比模块的对比结果,当滑动轨迹的斜率的绝对值大于设定值时,将终点坐标的横坐标修改为起点坐标的横坐标,上报修正后的终点坐标;The coordinate correction module is used to read the comparison result of the comparison module. When the absolute value of the slope of the sliding track is greater than the set value, modify the abscissa of the end point coordinates to the abscissa of the start point coordinates, and report the corrected end point coordinates ;

应用层模块,用于当接收到经所述坐标修正模块修正后的终点坐标时,做出纵向滑动的反应。The application layer module is configured to respond to vertical sliding when receiving the end point coordinates corrected by the coordinate correction module.

进一步而言,该系统还包括:Further, the system also includes:

设置模块,用于预先设置与滑动轨迹的斜率的绝对值相对比的设定值。The setting module is used to preset a setting value relative to the absolute value of the slope of the sliding track.

进一步而言,所述应用层模块还用于当接收到滑动轨迹的斜率的绝对值小于设定值时上报的正常的终点坐标时,做出横向滑动的反应。Further, the application layer module is also configured to respond to horizontal sliding when receiving the normal end point coordinates reported when the absolute value of the slope of the sliding track is less than the set value.

本发明的另一目的在于,提供一种移动终端,其包括如上述技术方案所述的处理触摸屏上报坐标事件的系统。Another object of the present invention is to provide a mobile terminal, which includes the system for processing the coordinate event reported by the touch screen according to the above technical solution.

与现有技术相比,本发明的有益效果在于:Compared with prior art, the beneficial effect of the present invention is:

本发明在一些支持横向滑动列表操作的应用程序中,采集用户在触摸屏上进行滑动操作时滑动轨迹的起点坐标和终点坐标,通过起点坐标和终点坐标计算滑动轨迹的斜率并将滑动轨迹的斜率的绝对值与设定值进行对比来判断滑动轨迹的斜率的绝对值是否大于设定值从而对终点坐标进行修正与规范,避免应用层将用户在触摸屏上进行的纵向滑动操作误认为是横向滑动操作,同时,当这些修正与规范过后的坐标上报到应用层时,就不会因为不同的应用层处理原则不一样导致不一样的结果。In some application programs that support horizontal sliding list operations, the present invention collects the starting point coordinates and end point coordinates of the sliding track when the user performs a sliding operation on the touch screen, calculates the slope of the sliding track through the starting point coordinates and the end point coordinates, and calculates the slope of the sliding track. The absolute value is compared with the set value to determine whether the absolute value of the slope of the sliding track is greater than the set value, so as to correct and standardize the coordinates of the end point, so as to prevent the application layer from mistaking the vertical sliding operation performed by the user on the touch screen as a horizontal sliding operation , and at the same time, when these corrected and standardized coordinates are reported to the application layer, different results will not be caused by different application layer processing principles.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are For some embodiments of the present invention, those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1是左手操作时的滑动轨迹图;Fig. 1 is a slide trajectory diagram during left-hand operation;

图2是右手操作时的滑动轨迹图;Fig. 2 is a sliding trajectory diagram during right-hand operation;

图3是支持横向滑动列表操作的应用程序的界面示意图;FIG. 3 is a schematic diagram of an interface of an application program supporting horizontal sliding list operations;

图4是本发明实施一中所提供的一种处理触摸屏上报坐标事件的方法的流程图;Fig. 4 is a flow chart of a method for processing a coordinate event reported by a touch screen provided in Embodiment 1 of the present invention;

图5是本发明实施二中所提供的一种处理触摸屏上报坐标事件的方法的流程图;5 is a flowchart of a method for processing a coordinate event reported by a touch screen provided in Embodiment 2 of the present invention;

图6是本发明实施三中所提供的一种处理触摸屏上报坐标事件的的系统的结构示意图。FIG. 6 is a schematic structural diagram of a system for processing a coordinate event reported by a touch screen provided in Embodiment 3 of the present invention.

具体实施方式detailed description

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

实施例一Embodiment one

本发明的实施例一提供了一种处理触摸屏上报坐标事件的方法,下面结合附图对本实施例进行详细说明。Embodiment 1 of the present invention provides a method for processing a coordinate event reported by a touch screen, and this embodiment will be described in detail below with reference to the accompanying drawings.

图4是本发明实施例一的方法流程图,参考图4,本发明实施例的方法包括以下步骤:Fig. 4 is a flow chart of the method of Embodiment 1 of the present invention. With reference to Fig. 4, the method of the embodiment of the present invention includes the following steps:

步骤S101、判断当前使用的应用程序是否支持横向滑动列表操作;Step S101, judging whether the currently used application supports horizontal sliding list operation;

步骤S102、当应用程序支持横向滑动列表操作时,则采集用户在触摸屏上进行滑动操作时滑动轨迹的起点坐标和终点坐标,采集过后,先不上报终点坐标;Step S102, when the application program supports horizontal sliding list operation, collect the starting point coordinates and end point coordinates of the sliding track when the user performs sliding operation on the touch screen, and do not report the end point coordinates after the collection;

步骤S103、根据起点坐标和终点坐标计算滑动轨迹的斜率;Step S103, calculating the slope of the sliding track according to the starting point coordinates and the ending point coordinates;

步骤S104、将滑动轨迹的斜率的绝对值与设定值进行对比;Step S104, comparing the absolute value of the slope of the sliding track with the set value;

步骤S105、当滑动轨迹的斜率的绝对值大于设定值时,则将终点坐标的横坐标修改为起点坐标的横坐标,上报修正后的终点坐标;Step S105, when the absolute value of the slope of the sliding track is greater than the set value, modify the abscissa of the end point coordinates to the abscissa of the start point coordinates, and report the corrected end point coordinates;

步骤S106、当应用层接收到修正后的终点坐标时,则做出纵向滑动的反应。Step S106, when the application layer receives the corrected coordinates of the end point, respond to vertical sliding.

本发明在一些支持横向滑动列表操作的应用程序中,采集用户在触摸屏上进行滑动操作时滑动轨迹的起点坐标和终点坐标,通过起点坐标和终点坐标计算滑动轨迹的斜率并将滑动轨迹的斜率的绝对值与设定值进行对比来判断滑动轨迹的斜率的绝对值是否大于设定值从而对终点坐标进行修正与规范,避免应用层将用户在触摸屏上进行的纵向滑动操作误认为是横向滑动操作,同时,当这些修正与规范过后的坐标上报到应用层时,就不会因为不同的应用层处理原则不一样导致不一样的结果。In some application programs that support horizontal sliding list operations, the present invention collects the starting point coordinates and end point coordinates of the sliding track when the user performs a sliding operation on the touch screen, calculates the slope of the sliding track through the starting point coordinates and the end point coordinates, and calculates the slope of the sliding track. The absolute value is compared with the set value to determine whether the absolute value of the slope of the sliding track is greater than the set value, so as to correct and standardize the coordinates of the end point, so as to prevent the application layer from mistaking the vertical sliding operation performed by the user on the touch screen as a horizontal sliding operation , and at the same time, when these corrected and standardized coordinates are reported to the application layer, different results will not be caused by different application layer processing principles.

实施例二Embodiment two

本发明实施例二提供了一种处理触摸屏上报坐标事件的方法,是在实施例一的基础之上进行的改进。Embodiment 2 of the present invention provides a method for processing a coordinate event reported by a touch screen, which is an improvement on the basis of Embodiment 1.

图5是本发明实施例二的方法流程图,参考图5,本发明实施例的方法包括以下步骤:Fig. 5 is a method flow chart of the second embodiment of the present invention, referring to Fig. 5, the method of the embodiment of the present invention includes the following steps:

步骤S201、预先设置与滑动轨迹的斜率的绝对值相对比的设定值;Step S201, preset a set value compared with the absolute value of the slope of the sliding track;

步骤S202、判断当前使用的应用程序是否支持横向滑动列表操作,当应用程序不支持横向滑动列表操作时,则执行步骤S203,当应用程序支持横向滑动列表操作时,则执行步骤S204;Step S202, judging whether the currently used application program supports the horizontal sliding list operation, if the application program does not support the horizontal sliding list operation, then perform step S203, and when the application program supports the horizontal sliding list operation, then perform step S204;

步骤S203、不进行触摸屏上报坐标修正,采用正常的上报坐标处理;Step S203, do not correct the reported coordinates of the touch screen, and adopt the normal reported coordinate processing;

步骤S204、采集用户在触摸屏上进行滑动操作时滑动轨迹的起点坐标和终点坐标,采集过后,先不上报终点坐标;Step S204, collect the starting point coordinates and end point coordinates of the sliding track when the user performs a sliding operation on the touch screen, and do not report the end point coordinates after the collection;

触摸屏设备可以采集手指的坐标数据,比如说采集2个坐标点数据,即该次滑动轨迹的起点以及终点坐标,从(x0,y0)到(x1,y1),其中x代表横向,y代表纵向。另外,采集坐标数据过后,终点坐标先不上报给应用层,这样应用层就不会认为该次滑动已经结束了。The touch screen device can collect the coordinate data of the finger, for example, collect 2 coordinate point data, that is, the coordinates of the starting point and the end point of the sliding track, from (x0, y0) to (x1, y1), where x represents the horizontal direction and y represents the vertical direction . In addition, after the coordinate data is collected, the coordinates of the end point are not reported to the application layer, so that the application layer will not think that the sliding has ended.

步骤S205、根据起点坐标和终点坐标计算滑动轨迹的斜率;Step S205, calculating the slope of the sliding track according to the starting point coordinates and the ending point coordinates;

进一步而言,滑动轨迹的斜率通过起点坐标和终点坐标的纵坐标之差除以起点坐标和终点坐标的横坐标之差得到,即该次滑动轨迹的斜率就是k=(y1-y0)/(x1-x0)。Further, the slope of the sliding track is obtained by dividing the difference between the ordinate of the starting point and the end point by the difference between the abscissa of the starting point and the end point, that is, the slope of the sliding track is k=(y1-y0)/( x1-x0).

步骤S206、将滑动轨迹的斜率的绝对值与设定值进行对比,当滑动轨迹的斜率的绝对值大于设定值时,则依次执行步骤S207和步骤S208,当滑动轨迹的斜率的绝对值小于设定值时,则依次执行步骤S209和步骤S210;Step S206, comparing the absolute value of the slope of the sliding track with the set value, when the absolute value of the slope of the sliding track is greater than the set value, then perform steps S207 and S208 in sequence, and when the absolute value of the slope of the sliding track is less than When setting the value, then execute step S209 and step S210 in sequence;

步骤S207、将终点坐标的横坐标修改为起点坐标的横坐标,上报修正后的终点坐标;Step S207, modifying the abscissa of the end point coordinates to the abscissa of the starting point coordinates, and reporting the corrected end point coordinates;

步骤S208、应用层接收到修正后的终点坐标时,做出纵向滑动的反应;Step S208, when the application layer receives the corrected coordinates of the end point, it responds by sliding vertically;

步骤S209、上报正常的终点坐标;Step S209, reporting the normal end point coordinates;

步骤S210、应用层接收到正常的终点坐标时,做出横向滑动的反应。Step S210, when the application layer receives the normal coordinates of the end point, it makes a horizontal sliding response.

步骤S211、当退出支持横向滑动列表操作的应用程序时,则退出触摸屏上报坐标修正,采用正常的上报坐标处理。Step S211 , when exiting the application program that supports horizontal sliding list operation, exit the touch screen to report coordinate correction, and adopt the normal process of reporting coordinates.

为便于理解,以实际应用为例进行说明,例如:该支持横向滑动列表操作的应用程序为3G新闻,将设定值设置为0.5,如果滑动轨迹的斜率的绝对值小于设定值0.5,那么触摸屏的驱动层会认定是横向滑动,此时上报正常的终点坐标,应用层接收到这些坐标之后,也会认为是横向滑动,从而做出相应的反应,即可以切换横向滑动列表,如图3所示,从IT切换到体育或者娱乐;如果滑动轨迹的斜率的绝对值大于设定值0.5,触摸屏的驱动层就认定是纵向滑动,修改终点坐标为(x0,y1),当应用层接收到修改的终点坐标的时候,是一定会认为纵向滑动的,从而做出纵向滑动的反应,即操作纵向的内容滚动条。For ease of understanding, let’s take a practical application as an example. For example, the application that supports horizontal sliding list operation is 3G news, and the setting value is set to 0.5. If the absolute value of the slope of the sliding track is less than the setting value 0.5, then The driver layer of the touch screen will recognize that it is a horizontal slide, and report the normal end point coordinates at this time. After receiving these coordinates, the application layer will also consider it a horizontal slide and make a corresponding response, that is, the list of horizontal slides can be switched, as shown in Figure 3 As shown, switch from IT to sports or entertainment; if the absolute value of the slope of the sliding track is greater than the set value of 0.5, the driver layer of the touch screen will be considered as vertical sliding, and the coordinates of the end point will be modified to (x0, y1). When the application layer receives When modifying the coordinates of the end point, it must be regarded as vertical sliding, so as to respond to vertical sliding, that is, to operate the vertical content scroll bar.

在此需要说明的是,不同的应用层处理方式也不一样,例如:在搜狐新闻中,如果滑动轨迹的斜率在1的时候(大概45度的滑动方向),会认为是横向滑动;但是网易新闻等,在滑动轨迹的斜率是0.5的时候,才认为是横向滑动。本发明的优点在于可以将滑动轨迹的斜率的绝对值与设定值进行对比来判断滑动轨迹的斜率的绝对值是否大于设定值从而对终点坐标进行修正与规范,当这些修正与规范过后的坐标上报到应用层时,就不会因为不同的应用层处理原则不一样导致不一样的结果。What needs to be explained here is that different application layers have different processing methods. For example, in Sohu News, if the slope of the sliding track is 1 (about 45 degrees in the sliding direction), it will be considered as a horizontal sliding; but NetEase For news, etc., when the slope of the sliding track is 0.5, it is considered to be a horizontal sliding. The advantage of the present invention is that the absolute value of the slope of the sliding track can be compared with the set value to judge whether the absolute value of the slope of the sliding track is greater than the set value so as to correct and standardize the coordinates of the end point. When the coordinates are reported to the application layer, different results will not be caused by different application layer processing principles.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for realizing the above-mentioned method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the It includes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.

实施例三Embodiment three

本实施例三提供了一种处理触摸屏上报坐标事件的系统,如图6所示,该系统包括:Embodiment 3 provides a system for processing coordinate events reported by the touch screen, as shown in FIG. 6 , the system includes:

判断模块301,用于判断当前使用的应用程序是否支持横向滑动列表操作;Judging module 301, for judging whether the currently used application supports horizontal sliding list operation;

坐标采集模块302,用于当判断模块301判断到当前使用的应用程序支持横向滑动列表操作时,采集用户在触摸屏上进行滑动操作时滑动轨迹的起点坐标和终点坐标,采集过后,先不上报终点坐标;The coordinate collection module 302 is used to collect the starting point coordinates and end point coordinates of the sliding track when the user performs a sliding operation on the touch screen when the judging module 301 judges that the currently used application program supports the horizontal sliding list operation. After the collection, the end point is not reported first. coordinate;

斜率计算模块303,用于根据坐标采集模块302采集到的起点坐标和终点坐标计算滑动轨迹的斜率;The slope calculation module 303 is used to calculate the slope of the sliding track according to the starting point coordinates and the end point coordinates collected by the coordinate collection module 302;

对比模块304,用于将斜率计算模块303计算得到的滑动轨迹的斜率的绝对值与设定值进行对比;The comparison module 304 is used to compare the absolute value of the slope of the sliding trajectory calculated by the slope calculation module 303 with the set value;

坐标修正模块305,用于读取对比模块304的对比结果,当滑动轨迹的斜率的绝对值大于设定值时,将终点坐标的横坐标修改为起点坐标的横坐标,上报修正后的终点坐标;The coordinate correction module 305 is used to read the comparison result of the comparison module 304. When the absolute value of the slope of the sliding track is greater than the set value, modify the abscissa of the end point coordinates to the abscissa of the start point coordinates, and report the corrected end point coordinates ;

应用层模块306,用于当接收到经坐标修正模块305修正后的终点坐标时,做出纵向滑动的反应。The application layer module 306 is configured to respond to vertical sliding when receiving the coordinates of the end point corrected by the coordinate correction module 305 .

进一步而言,该系统还包括:Further, the system also includes:

设置模块307,用于预先设置与滑动轨迹的斜率的绝对值相对比的设定值。The setting module 307 is configured to preset a set value compared with the absolute value of the slope of the sliding track.

进一步而言,应用层模块306还用于当接收到滑动轨迹的斜率的绝对值小于设定值时上报的正常的终点坐标时,做出横向滑动的反应。Furthermore, the application layer module 306 is also configured to respond to horizontal sliding when receiving the normal end point coordinates reported when the absolute value of the slope of the sliding track is less than the set value.

需要说明的是,上述实施例提供的一种处理触摸屏上报坐标事件的系统,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将系统的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。It should be noted that the system for processing the coordinate event reported by the touch screen provided by the above embodiment is only illustrated by the division of the above functional modules. In practical applications, the above function allocation can be completed by different functional modules according to needs. , which divides the internal structure of the system into different functional modules to complete all or part of the functions described above.

实施例四Embodiment Four

本实施例四提供了一种移动终端,其包括如实施例三的处理触摸屏上报坐标事件的系统,该系统的各组成模块如上面所述,在此不再赘述。Embodiment 4 provides a mobile terminal, which includes the system for processing the coordinate event reported by the touch screen as in Embodiment 3. The components of the system are as described above and will not be repeated here.

需要说明的是,本实施例四所述的一种移动终端可以是手机、电子书、个人数字助理(PDA)、掌上电脑、人机交互终端或其他具有显示功能的手持式终端设备。在本实施例四中,当所述移动终端为手机时,所述手机可以进一步包括:外壳、电路板、处理器、触摸屏和一个或多个应用程序等。It should be noted that the mobile terminal described in Embodiment 4 may be a mobile phone, an electronic book, a personal digital assistant (PDA), a palmtop computer, a human-computer interaction terminal or other handheld terminal devices with a display function. In Embodiment 4, when the mobile terminal is a mobile phone, the mobile phone may further include: a casing, a circuit board, a processor, a touch screen, and one or more application programs.

上述实施例为本发明较佳的实施方式,但本发明的实施方式并不受上述实施例的限制,其他的任何未背离本发明的精神实质与原理下所作的改变、修饰、替代、组合、简化,均应为等效的置换方式,都包含在本发明的保护范围之内。The above-mentioned embodiment is a preferred embodiment of the present invention, but the embodiment of the present invention is not limited by the above-mentioned embodiment, and any other changes, modifications, substitutions, combinations, Simplifications should be equivalent replacement methods, and all are included in the protection scope of the present invention.

Claims (10)

1. process the method that touch-screen reports coordinate event, it is characterized in that, the method comprises the following steps:
Judge whether the application program of current use supports that horizontal sliding list operates;
When the horizontal sliding list operation of application program support, then gather starting point coordinate and the terminal point coordinate of sliding trace when user carries out slide on the touchscreen, after collection, first do not report terminal point coordinate;
The slope of sliding trace is calculated according to starting point coordinate and terminal point coordinate;
The absolute value of the slope of sliding trace and setting value are contrasted;
When the absolute value of the slope of sliding trace is greater than setting value, then the horizontal ordinate of terminal point coordinate is revised as the horizontal ordinate of starting point coordinate, reports revised terminal point coordinate;
When application layer receives revised terminal point coordinate, then make the reaction of longitudinal sliding motion.
2. process touch-screen according to claim 1 reports the method for coordinate event, it is characterized in that, describedly judges the application program of current use also comprises after whether supporting the step that horizontal sliding list operates:
When application program does not support that horizontal sliding list operates, then adopt and report coordinate process normally.
3. process touch-screen according to claim 1 reports the method for coordinate event, it is characterized in that, described the absolute value of the slope of sliding trace and setting value are carried out the step contrasted after also comprise:
When the absolute value of the slope of sliding trace is less than setting value, then report normal terminal point coordinate;
When application layer receives normal terminal point coordinate, then make the reaction of laterally sliding.
4. process touch-screen according to claim 1 reports the method for coordinate event, it is characterized in that, the slope of described sliding trace is obtained by the difference of the ordinate of starting point coordinate and the terminal point coordinate difference divided by the horizontal ordinate of starting point coordinate and terminal point coordinate.
5. process touch-screen according to claim 1 reports the method for coordinate event, it is characterized in that, describedly judges the application program of current use also comprises before whether supporting the step that horizontal sliding list operates:
Pre-set the setting value compared with the absolute value of the slope of sliding trace.
6. process touch-screen according to claim 1 reports the method for coordinate event, it is characterized in that, described when application layer receives revised terminal point coordinate, then also comprise after making the step of the reaction of longitudinal sliding motion:
When exiting the application program supporting the operation of horizontal sliding list, then exit touch-screen and report coordinate modification, adopt and report coordinate process normally.
7. process the system that touch-screen reports coordinate event, it is characterized in that, this system comprises:
Judge module, for judging whether the application program of current use supports that horizontal sliding list operates;
Coordinate acquisition module, when the horizontal sliding list of application program support for determining current use when described judge module operates, gather starting point coordinate and the terminal point coordinate of sliding trace when user carries out slide on the touchscreen, after collection, first do not report terminal point coordinate;
Slope computing module, calculates the slope of sliding trace for the starting point coordinate that collects according to described coordinate acquisition module and terminal point coordinate;
Contrast module, contrasts for the absolute value of the slope of sliding trace that calculated by described slope computing module and setting value;
Coordinate modification module, for reading the comparing result of described contrast module, when the absolute value of the slope of sliding trace is greater than setting value, being revised as the horizontal ordinate of starting point coordinate, reporting revised terminal point coordinate by the horizontal ordinate of terminal point coordinate;
Application layer module, for when receiving terminal point coordinate revised through described coordinate modification module, makes the reaction of longitudinal sliding motion.
8. process touch-screen according to claim 7 reports the system of coordinate event, it is characterized in that, this system also comprises:
Module is set, for pre-setting the setting value compared with the absolute value of the slope of sliding trace.
9. process touch-screen according to claim 7 reports the system of coordinate event, it is characterized in that, described application layer module also for report when the absolute value of the slope receiving sliding trace is less than setting value normal terminal point coordinate time, make the reaction of laterally sliding.
10. a mobile terminal, is characterized in that, this mobile terminal comprises as the process touch-screen in claim 7 to 9 as described in any one reports the system of coordinate event.
CN201310282514.6A 2013-07-06 2013-07-06 A kind of touch-screen that processes reports the method for coordinate event, system and mobile terminal Expired - Fee Related CN103399662B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310282514.6A CN103399662B (en) 2013-07-06 2013-07-06 A kind of touch-screen that processes reports the method for coordinate event, system and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310282514.6A CN103399662B (en) 2013-07-06 2013-07-06 A kind of touch-screen that processes reports the method for coordinate event, system and mobile terminal

Publications (2)

Publication Number Publication Date
CN103399662A CN103399662A (en) 2013-11-20
CN103399662B true CN103399662B (en) 2016-04-06

Family

ID=49563302

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310282514.6A Expired - Fee Related CN103399662B (en) 2013-07-06 2013-07-06 A kind of touch-screen that processes reports the method for coordinate event, system and mobile terminal

Country Status (1)

Country Link
CN (1) CN103399662B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105528160A (en) 2014-09-28 2016-04-27 中兴通讯股份有限公司 Touch screen operation method and apparatus
CN106126073A (en) * 2016-06-12 2016-11-16 天脉聚源(北京)教育科技有限公司 A kind of method and device of mobile destination object
CN109099921B (en) * 2018-08-03 2020-06-05 重庆电子工程职业学院 Robot compensation positioning method and device
CN110658974B (en) * 2019-08-01 2022-08-16 平安科技(深圳)有限公司 Page sliding method and device, electronic equipment and storage medium
CN113791411B (en) * 2021-09-07 2024-05-28 北京航空航天大学杭州创新研究院 Millimeter wave radar gesture recognition method and device based on track judgment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101614552A (en) * 2009-07-24 2009-12-30 深圳市凯立德计算机系统技术有限公司 Gesture command input judging method of navigation system and device
CN102981755A (en) * 2012-10-24 2013-03-20 深圳市深信服电子科技有限公司 Gesture control method and gesture control system based on remote application
CN103116446A (en) * 2013-02-26 2013-05-22 浙江大学 List interactive method for touch portable device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101634929B (en) * 2008-07-23 2012-06-20 鸿富锦精密工业(深圳)有限公司 Method for utilizing controlled media conversion on digital photo frame

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101614552A (en) * 2009-07-24 2009-12-30 深圳市凯立德计算机系统技术有限公司 Gesture command input judging method of navigation system and device
CN102981755A (en) * 2012-10-24 2013-03-20 深圳市深信服电子科技有限公司 Gesture control method and gesture control system based on remote application
CN103116446A (en) * 2013-02-26 2013-05-22 浙江大学 List interactive method for touch portable device

Also Published As

Publication number Publication date
CN103399662A (en) 2013-11-20

Similar Documents

Publication Publication Date Title
US20230266860A1 (en) Application association processing method and apparatus
CN102760026B (en) A kind of touch screen interface display packing, display device and a kind of touch panel device
US9535576B2 (en) Touchscreen apparatus user interface processing method and touchscreen apparatus
CN107247538B (en) Touch operation processing method and terminal device
CN106125984B (en) A touch processing method for a mobile terminal and the mobile terminal
CN103399662B (en) A kind of touch-screen that processes reports the method for coordinate event, system and mobile terminal
EP3002664A1 (en) Text processing method and touchscreen device
CN103268184A (en) Method and device for moving text cursor
CN107329644B (en) Icon moving method and device
CN103577068A (en) Method for dynamically adjusting size of desktop icon, and mobile terminal
US20150286283A1 (en) Method, system, mobile terminal, and storage medium for processing sliding event
CN107704157B (en) A multi-screen interface operation method, device and storage medium
CN102117165A (en) Touch input processing method and mobile terminal
CN104808930A (en) Operating element control method
JP2014527673A (en) Widget processing method and apparatus, and mobile terminal
CN105892927A (en) Mobile terminal control method and device
CN104657077A (en) Cursor positioning method
CN103092412B (en) Mobile terminal and the display packing of mobile terminal operation object
CN103197931A (en) Interface layout method and interface layout device based on touch screen
CN103500055B (en) Positioning method and system of display content of touch screen
CN102279667A (en) Method and device for responding screen touch event and communication terminal
CN107577404B (en) Information processing method and device and electronic equipment
CN104777978A (en) Terminal
CN104820550A (en) Terminal
CN105487801B (en) Progress bar adjusting method and mobile terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CP01 Change in the name or title of a patent holder
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160406

CF01 Termination of patent right due to non-payment of annual fee