[go: up one dir, main page]

CN113238699B - Method for drawing linear mouse auxiliary function - Google Patents

Method for drawing linear mouse auxiliary function Download PDF

Info

Publication number
CN113238699B
CN113238699B CN202110603565.9A CN202110603565A CN113238699B CN 113238699 B CN113238699 B CN 113238699B CN 202110603565 A CN202110603565 A CN 202110603565A CN 113238699 B CN113238699 B CN 113238699B
Authority
CN
China
Prior art keywords
mouse
data
straight line
function
ysum
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.)
Active
Application number
CN202110603565.9A
Other languages
Chinese (zh)
Other versions
CN113238699A (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.)
Dongguan Togran Electronics Technology Co ltd
Original Assignee
Dongguan Togran Electronics Technology Co 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 Dongguan Togran Electronics Technology Co ltd filed Critical Dongguan Togran Electronics Technology Co ltd
Priority to CN202110603565.9A priority Critical patent/CN113238699B/en
Publication of CN113238699A publication Critical patent/CN113238699A/en
Application granted granted Critical
Publication of CN113238699B publication Critical patent/CN113238699B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction 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
    • G06F3/04845Interaction 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 for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0354Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of 2D relative movements between the device, or an operating part thereof, and a plane or surface, e.g. 2D mice, trackballs, pens or pucks
    • G06F3/03543Mice or pucks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction 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

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)
  • Position Input By Displaying (AREA)

Abstract

本发明公开一种画直线的鼠标辅助功能的方法,在鼠标标准按键之外,提供一个功能按键;当该功能按键松开时,鼠标就是标准鼠标;当该功能按键按下时,步骤1:鼠标进入直线模式,处于准备状态,等待方向判定;步骤2:当用户开始移动鼠标,收集前N次鼠标移动的数据,分析数据,进行方向判定,一旦判定完成,进入直线处理状态,并将该N次移动数据的方向处理结果发送给PC;步骤3:此后,用户移动鼠标得到的数据,都进行相应判定方向的修正处理,确保鼠标上报的数据是直线数据;步骤4:直到用户松开该功能按键,离开直线模式,回到标准鼠标功能。本发明通过收集多次移动数据,分析并进行方向检测,最后进行修正处理,保证鼠标直线轨迹无角度偏差。

Figure 202110603565

The invention discloses a method for a mouse auxiliary function for drawing a straight line. In addition to the standard mouse button, a function button is provided; when the function button is released, the mouse is a standard mouse; when the function button is pressed, step 1: The mouse enters the straight line mode and is in a ready state, waiting for the direction determination; Step 2: When the user starts to move the mouse, collect the data of the previous N mouse movements, analyze the data, and determine the direction. The direction processing result of the N times of moving data is sent to the PC; Step 3: After that, the data obtained by the user moving the mouse is corrected for the corresponding judgment direction to ensure that the data reported by the mouse is straight line data; Step 4: Until the user releases the Function button, leave the straight line mode, return to the standard mouse function. The present invention ensures that the mouse linear trajectory has no angle deviation by collecting multiple movement data, analyzing and performing direction detection, and finally performing correction processing.

Figure 202110603565

Description

一种画直线的鼠标辅助功能的方法A method of mouse auxiliary function for drawing a straight line

技术领域technical field

本发明涉及计算机设备领域技术,尤其是指一种画直线的鼠标辅助功能的方法。The invention relates to the technology in the field of computer equipment, in particular to a method for a mouse auxiliary function for drawing a straight line.

背景技术Background technique

在设计及编辑办公场景下,用户需要使用鼠标进行直线绘制。但是,鼠标绘制功能一般为手工自由绘制,因此,鼠标移动轨迹很难形成标准直线。一般情况下,用户进行图形绘制时,需要借助软件工具进行直线绘制;当计算机系统中未安装软件,用户则需要下载并安装软件,才能进行直线绘制,操作过程繁琐。加之,在使用软件时,用户无法确定绘制直线的角度偏差,可能造成工程设计或工业设计较大误差,甚至给后续工程实施带来一定的隐患。In designing and editing office scenarios, users need to use the mouse to draw straight lines. However, the mouse drawing function is generally free to draw manually, so it is difficult to form a standard straight line for the mouse movement track. Generally, when users draw graphics, they need to use software tools to draw straight lines; when the software is not installed in the computer system, users need to download and install the software to draw straight lines, and the operation process is cumbersome. In addition, when using the software, the user cannot determine the angle deviation of the drawn straight line, which may cause large errors in engineering design or industrial design, and even bring certain hidden dangers to the subsequent project implementation.

因此,需要研究一种新的技术方案来解决上述问题。Therefore, it is necessary to study a new technical solution to solve the above problems.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本发明针对现有技术存在之缺失,其主要目的是提供一种画直线的鼠标辅助功能的方法,通过特定按键即可触发直线模式,其操作简单;同时,该方法通过收集使用者的多次移动数据,分析并进行方向检测,最后对数据进行修正处理,保证鼠标直线轨迹无角度偏差。In view of this, the present invention is aimed at the deficiencies existing in the prior art, and its main purpose is to provide a method for the mouse auxiliary function of drawing a straight line, the straight line mode can be triggered by a specific button, and its operation is simple; The user's multiple movement data is analyzed and the direction detection is performed, and finally the data is corrected to ensure that the mouse linear trajectory has no angular deviation.

为实现上述目的,本发明采用如下之技术方案:To achieve the above object, the present invention adopts the following technical scheme:

一种画直线的鼠标辅助功能的方法,在鼠标标准按键之外,提供一个功能按键;当该功能按键松开时,鼠标就是标准鼠标;当该功能按键按下时,A method for the auxiliary function of a mouse for drawing a straight line, in addition to the standard button of the mouse, a function button is provided; when the function button is released, the mouse is a standard mouse; when the function button is pressed, the mouse is a standard mouse.

步骤1:鼠标进入直线模式,处于准备状态,等待方向判定;Step 1: The mouse enters the straight line mode and is in the ready state, waiting for the direction determination;

步骤2:当用户开始移动鼠标,收集前N次鼠标移动的数据,分析数据,进行方向判定,一旦判定完成,进入直线处理状态,并将该N次移动数据的方向处理结果发送给PC;其中,方向判定算法为:Step 2: When the user starts to move the mouse, collect the data of the previous N mouse movements, analyze the data, and determine the direction. Once the determination is completed, enter the straight line processing state, and send the direction processing results of the N times of movement data to the PC; , the direction determination algorithm is:

步骤2-1:收集鼠标移动的N次X和Y方向的移动数据;Step 2-1: Collect movement data in X and Y directions for N times of mouse movement;

步骤2-2:对X和Y方向的移动数据分别求和,得到Xsum和Ysum,再计算绝对值得到|Xsum|和|Ysum|;Step 2-2: Sum the movement data in the X and Y directions respectively to obtain Xsum and Ysum, and then calculate the absolute values to obtain |Xsum| and |Ysum|;

步骤2-3:计算得到两者之差Diff=||Xsum|-|Ysum||;Step 2-3: Calculate the difference Diff=||Xsum|-|Ysum||;

步骤2-4:计算得到判定因子Factor=Max(|Xsum|/2,|Ysum|/2);Step 2-4: Calculate the decision factor Factor=Max (|Xsum|/2, |Ysum|/2);

若(Diff>Factor)情况,则认定值X或Y方向,其中,若(|Xsum|>|Ysum|),则判定为X轴直线方向,反之(|Ysum|>|Xsum|),则判定为Y轴直线方向;In the case of (Diff>Factor), the value X or Y direction is determined, and if (|Xsum|>|Ysum|), it is determined as the X-axis linear direction, otherwise (|Ysum|>|Xsum|), it is determined is the straight line direction of the Y-axis;

若(Diff<Factor)情况,则认定值XY方向,需要进一步判定是XY45度还是XY135度;其中,若Xsum和Ysum极性相反,即一个为正数,一个为负数,则为XY45度方向,反之,Xsum和Ysum极性相同,即同时为整数或为负数,则为XY135度方向;In the case of (Diff<Factor), the XY direction of the value is determined, and it is necessary to further determine whether it is XY45 degrees or XY135 degrees; among them, if the polarities of Xsum and Ysum are opposite, that is, one is positive and the other is negative, then it is the XY45 degree direction, On the contrary, if Xsum and Ysum have the same polarity, that is, they are both integers or negative numbers, they are in the XY135 degree direction;

步骤3:此后,用户移动鼠标得到的数据,都进行相应判定方向的修正处理,确保鼠标上报的数据是直线数据;Step 3: After that, the data obtained by the user moving the mouse is corrected in the corresponding judgment direction to ensure that the data reported by the mouse is straight line data;

步骤4:直到用户松开该功能按键,离开直线模式,回到标准鼠标功能。Step 4: Until the user releases the function button, leaves the straight line mode, and returns to the standard mouse function.

作为一种优选方案,所述N取值为16至20中任一整数。As a preferred solution, the value of N is any integer from 16 to 20.

作为一种优选方案,步骤3中,在判定直线方向之后,对鼠标移动的X和Y方向的移动数据进行直线处理,根据四种方向,其对应的处理算法如下:As a preferred solution, in step 3, after determining the direction of the straight line, perform straight line processing on the movement data in the X and Y directions of the mouse movement. According to the four directions, the corresponding processing algorithms are as follows:

若判定的直线方向为X轴方向,则丢弃Y方向的移动数据,只把X方向移动的数据上报给PC,上报数据为[X,0];If the determined straight line direction is the X-axis direction, discard the movement data in the Y-direction, and report only the X-direction movement data to the PC, and the reported data is [X, 0];

若判定的直线方向为Y轴方向,则丢弃X方向移动数据,只把Y方向移动的数据上报给PC,上报数据为[0,Y];If the determined straight line direction is the Y-axis direction, discard the movement data in the X direction, and only report the data moved in the Y direction to the PC, and the reported data is [0, Y];

若判定的直线方向为XY45度方向,则用X方向移动数据的反方向,也就是-X替换Y方向移动数据上报给PC,上报数据为[X,-X];If the determined straight line direction is XY45 degree direction, then use the X direction to move the data in the opposite direction, that is, -X replaces the Y direction movement data and report it to the PC, and the reported data is [X, -X];

若判定的直线方向为XY135度方向,则用X方向移动数据替换Y方向移动数据数据上报给PC,上报数据为[X,X]。If the determined straight line direction is XY135 degree direction, replace the Y-direction movement data with the X-direction movement data and report the data to the PC, and the reported data is [X, X].

作为一种优选方案,所述鼠标是二维指针设备,其上报数据包含X和Y轴的移动数据,该数据来自鼠标的传感器,X和Y都是有符号整数。As a preferred solution, the mouse is a two-dimensional pointing device, and the reported data includes the movement data of the X and Y axes, the data comes from the sensor of the mouse, and both X and Y are signed integers.

作为一种优选方案,所述X轴方向为横向,所述Y轴方向为纵向,所述XY45度方向为汉字笔画撇方向,所述XY135度方向为汉字笔画捺方向。As a preferred solution, the X-axis direction is horizontal, the Y-axis direction is vertical, the XY45 degree direction is the stroke direction of Chinese characters, and the XY135 degree direction is the stroke direction of Chinese characters.

作为一种优选方案,所述功能按键设置于鼠标;或者,所述功能按键是独立于鼠标、键盘外部的按键。As a preferred solution, the function buttons are provided on the mouse; or, the function buttons are independent buttons outside the mouse and keyboard.

作为一种优选方案,鼠标上报的数据,由PC相应控制显示器上呈现鼠标绘制直线轨迹。As a preferred solution, for the data reported by the mouse, the PC correspondingly controls the display to present the mouse to draw a straight line trajectory.

作为一种优选方案,绘制不同方向直线时,先绘制一方向直线,再通过用户松开该功能按键离开直线模式回到标准鼠标功能,再次按下该功能按键,再次经步骤1、步骤2、步骤3、步骤4完成另一方向直线绘制。As a preferred solution, when drawing straight lines in different directions, first draw straight lines in one direction, then release the function button to leave the straight line mode and return to the standard mouse function, press the function button again, and go through steps 1, 2, Step 3 and Step 4 complete the straight line drawing in the other direction.

本发明与现有技术相比具有明显的优点和有益效果,具体而言,由上述技术方案可知,其主要是通过特定按键即可触发直线模式,其操作简单;同时,该方法通过收集使用者的多次移动数据,分析并进行方向检测,最后对数据进行修正处理,保证鼠标直线轨迹无角度偏差;Compared with the prior art, the present invention has obvious advantages and beneficial effects. Specifically, it can be seen from the above technical solutions that the straight line mode can be triggered mainly through a specific button, and the operation is simple; The data of multiple movements is analyzed and detected, and finally the data is corrected to ensure that the mouse linear trajectory has no angular deviation;

其次是,在判定直线方向之后,根据四种方向,对鼠标移动的X和Y方向的移动数据进行直线处理,从数据源头上,保证用户得到完美的直线,完全没有角度偏差的问题;Secondly, after determining the direction of the straight line, according to the four directions, the movement data in the X and Y directions of the mouse movement is processed in a straight line, from the data source, to ensure that the user gets a perfect straight line, and there is no problem of angle deviation at all;

以及,鼠标移动数据来自标准鼠标传感器,保留用户使用习惯,符合人性化需求。In addition, the mouse movement data comes from the standard mouse sensor, which retains the user's usage habits and meets humanized needs.

为更清楚地阐述本发明的结构特征和功效,下面结合附图与具体实施例来对本发明进行详细说明。In order to illustrate the structural features and effects of the present invention more clearly, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

附图说明Description of drawings

图1是本发明的事件处理流程图。FIG. 1 is a flow chart of the event processing of the present invention.

具体实施方式Detailed ways

请参照图1所示,其显示出了本发明的事件处理流程图。Please refer to FIG. 1 , which shows the event processing flow chart of the present invention.

一种画直线的鼠标辅助功能的方法,在鼠标标准按键之外,提供一个功能按键;当该功能按键松开时,鼠标就是标准鼠标;当该功能按键按下时,A method for the auxiliary function of a mouse for drawing a straight line, in addition to the standard button of the mouse, a function button is provided; when the function button is released, the mouse is a standard mouse; when the function button is pressed, the mouse is a standard mouse.

步骤1:鼠标进入直线模式,处于准备状态,等待方向判定;Step 1: The mouse enters the straight line mode and is in the ready state, waiting for the direction determination;

步骤2:当用户开始移动鼠标,收集前N次鼠标移动的数据(所述N取值为16至20中任一整数),分析数据,进行方向判定,一旦判定完成,进入直线处理状态,并将该N次移动数据的方向处理结果发送给PC;其中,方向判定算法为:Step 2: When the user starts to move the mouse, collect the data of the previous N mouse movements (the N value is any integer from 16 to 20), analyze the data, and determine the direction. Send the direction processing results of the N times of movement data to the PC; wherein, the direction determination algorithm is:

步骤2-1:收集鼠标移动的N次X和Y方向的移动数据;Step 2-1: Collect movement data in X and Y directions for N times of mouse movement;

步骤2-2:对X和Y方向的移动数据分别求和,得到Xsum和Ysum,再计算绝对值得到|Xsum|和|Ysum|;Step 2-2: Sum the movement data in the X and Y directions respectively to obtain Xsum and Ysum, and then calculate the absolute values to obtain |Xsum| and |Ysum|;

步骤2-3:计算得到两者之差Diff=||Xsum|-|Ysum||;Step 2-3: Calculate the difference Diff=||Xsum|-|Ysum||;

步骤2-4:计算得到判定因子Factor=Max(|Xsum|/2,|Ysum|/2);Step 2-4: Calculate the decision factor Factor=Max (|Xsum|/2, |Ysum|/2);

若(Diff>Factor)情况,则认定值X或Y方向,其中,若(|Xsum|>|Ysum|),则判定为X轴直线方向,反之(|Ysum|>|Xsum|),则判定为Y轴直线方向;In the case of (Diff>Factor), the value X or Y direction is determined, and if (|Xsum|>|Ysum|), it is determined as the X-axis linear direction, otherwise (|Ysum|>|Xsum|), it is determined is the straight line direction of the Y-axis;

若(Diff<Factor)情况,则认定值XY方向,需要进一步判定是XY45度还是XY135度;其中,若Xsum和Ysum极性相反,即一个为正数,一个为负数,则为XY45度方向,反之,Xsum和Ysum极性相同,即同时为整数或为负数,则为XY135度方向;In the case of (Diff<Factor), the XY direction of the value is determined, and it is necessary to further determine whether it is XY45 degrees or XY135 degrees; among them, if the polarities of Xsum and Ysum are opposite, that is, one is positive and the other is negative, then it is the XY45 degree direction, On the contrary, if Xsum and Ysum have the same polarity, that is, they are both integers or negative numbers, they are in the XY135 degree direction;

步骤3:此后,用户移动鼠标得到的数据,都进行相应判定方向的修正处理,确保鼠标上报的数据是直线数据;Step 3: After that, the data obtained by the user moving the mouse is corrected in the corresponding judgment direction to ensure that the data reported by the mouse is straight line data;

步骤4:直到用户松开该功能按键,离开直线模式,回到标准鼠标功能。Step 4: Until the user releases the function button, leaves the straight line mode, and returns to the standard mouse function.

优选地,步骤3中,在判定直线方向之后,对鼠标移动的X和Y方向的移动数据进行直线处理,根据四种方向,其对应的处理算法如下:Preferably, in step 3, after determining the direction of the straight line, linear processing is performed on the movement data in the X and Y directions of the mouse movement. According to the four directions, the corresponding processing algorithms are as follows:

若判定的直线方向为X轴方向,则丢弃Y方向的移动数据,只把X方向移动的数据上报给PC,上报数据为[X,0];If the determined straight line direction is the X-axis direction, discard the movement data in the Y-direction, and report only the X-direction movement data to the PC, and the reported data is [X, 0];

若判定的直线方向为Y轴方向,则丢弃X方向移动数据,只把Y方向移动的数据上报给PC,上报数据为[0,Y];If the determined straight line direction is the Y-axis direction, discard the movement data in the X direction, and only report the data moved in the Y direction to the PC, and the reported data is [0, Y];

若判定的直线方向为XY45度方向,则用X方向移动数据的反方向,也就是-X替换Y方向移动数据上报给PC,上报数据为[X,-X];If the determined straight line direction is XY45 degree direction, then use the X direction to move the data in the opposite direction, that is, -X replaces the Y direction movement data and report it to the PC, and the reported data is [X, -X];

若判定的直线方向为XY135度方向,则用X方向移动数据替换Y方向移动数据数据上报给PC,上报数据为[X,X]。If the determined straight line direction is XY135 degree direction, replace the Y-direction movement data with the X-direction movement data and report the data to the PC, and the reported data is [X, X].

所述鼠标是二维指针设备,其上报数据包含X和Y轴的移动数据,该数据来自鼠标的传感器,X和Y都是有符号整数。所述X轴方向为横向,所述Y轴方向为纵向,所述XY45度方向为汉字笔画撇方向,所述XY135度方向为汉字笔画捺方向。所述功能按键设置于鼠标;或者,所述功能按键是独立于鼠标、键盘外部的按键。鼠标上报的数据,由PC相应控制显示器上呈现鼠标绘制直线轨迹。The mouse is a two-dimensional pointing device, and the reported data includes the movement data of the X and Y axes, the data comes from the sensor of the mouse, and both X and Y are signed integers. The X-axis direction is the horizontal direction, the Y-axis direction is the vertical direction, the XY45 degree direction is the stroke direction of Chinese characters, and the XY135 degree direction is the stroke direction of the Chinese character. The function buttons are arranged on the mouse; or, the function buttons are independent buttons outside the mouse and keyboard. The data reported by the mouse is controlled by the PC to display the mouse and draw a straight line on the display.

需要绘制不同方向直线时,先绘制一方向直线,再通过用户松开该功能按键离开直线模式回到标准鼠标功能,再次按下该功能按键,再次经步骤1、步骤2、步骤3、步骤4完成另一方向直线绘制。When you need to draw straight lines in different directions, first draw a straight line in one direction, then release the function button to leave the straight line mode and return to the standard mouse function, press the function button again, and go through steps 1, 2, 3, and 4 again. Complete the straight line drawing in the other direction.

一种采用画直线的鼠标辅助功能的方法的装置,包括鼠标装置。所述鼠标装置内部设置有微控制器,并且,所述微控制器装有鼠标嵌入式软件鼠标嵌入式软件。优选地,在鼠标装置上设有独立按键功能按键,与鼠标装置内部固件(Firmware,也指写入的程序)相连接。并且,所述鼠标装置设置有鼠标传感器,以反馈鼠标移动数据。A device using the method for the mouse auxiliary function of drawing a straight line includes a mouse device. The mouse device is internally provided with a microcontroller, and the microcontroller is equipped with mouse embedded software and mouse embedded software. Preferably, independent key function keys are provided on the mouse device, which are connected with the internal firmware (Firmware, also refers to a written program) of the mouse device. Moreover, the mouse device is provided with a mouse sensor to feed back mouse movement data.

所述功能按键为鼠标进入直线绘制模式功能键位,在所述嵌入式软件上提供鼠标直线绘制模式的功能。该功能通过处理正常的鼠标传感器数据,实现鼠标沿直线绘制轨迹的功能。使用者可利用功能按键,实现直线绘制模式与自由活动模式的切换。The function key is the function key for the mouse to enter the line drawing mode, and the function of the mouse line drawing mode is provided on the embedded software. This function realizes the function of drawing a trajectory of the mouse along a straight line by processing normal mouse sensor data. Users can use the function keys to switch between the straight line drawing mode and the free movement mode.

所述功能按键未被触压时,鼠标处于标准状态。当功能按键被触压时,鼠标进入直线绘制模式,鼠标嵌入式软件等待接收移动数据。使用者移动鼠标,鼠标嵌入式软件接收来自鼠标传感器的移动数据,其中,鼠标嵌入式软件收集并存储前N次移动的数据。鼠标嵌入式软件将前N次收集到的移动数据进行方向判定,分析移动方向。计算机完成方向判定后,进行直线修正处理,将该N次移动数据的直线修正处理结果传送至鼠标嵌入式软件,鼠标嵌入式软件将直线修正处理结果存储,并将直线轨迹呈现于显示器。When the function button is not pressed, the mouse is in a standard state. When the function button is pressed, the mouse enters the line drawing mode, and the embedded software of the mouse waits to receive movement data. The user moves the mouse, and the mouse embedded software receives the movement data from the mouse sensor, wherein the mouse embedded software collects and stores the data of the previous N movements. The mouse embedded software determines the direction of the movement data collected in the first N times, and analyzes the movement direction. After the computer completes the direction determination, it performs straight line correction processing, and transmits the straight line correction processing results of the N times of movement data to the mouse embedded software, and the mouse embedded software stores the straight line correction processing results and presents the straight line trajectory on the display.

此后,使用者移动鼠标,鼠标嵌入式软件接收到移动数据后,进行方向判断处理后,调取鼠标嵌入式软件内存储的直线修正处理结果,直接将直线轨迹呈现于显示器。After that, when the user moves the mouse, the mouse embedded software receives the movement data, performs direction judgment processing, and retrieves the straight line correction processing result stored in the mouse embedded software, and directly presents the straight line trajectory on the display.

本发明的设计重点在于,通过特定按键即可触发直线模式,其操作简单;同时,该方法通过收集使用者的多次移动数据,分析并进行方向检测,最后对数据进行修正处理,保证鼠标直线轨迹无角度偏差;The key point of the design of the present invention is that the straight line mode can be triggered by a specific button, and its operation is simple; at the same time, the method collects the user's multiple movement data, analyzes and performs direction detection, and finally corrects the data to ensure the straight line of the mouse. The trajectory has no angle deviation;

其次是,在判定直线方向之后,根据四种方向,对鼠标移动的X和Y方向的移动数据进行直线处理,从数据源头上,保证用户得到完美的直线,完全没有角度偏差的问题;Secondly, after determining the direction of the straight line, according to the four directions, the movement data in the X and Y directions of the mouse movement is processed in a straight line, from the data source, to ensure that the user gets a perfect straight line, and there is no problem of angle deviation at all;

以及,鼠标移动数据来自标准鼠标传感器,保留用户使用习惯,符合人性化需求。In addition, the mouse movement data comes from the standard mouse sensor, which retains the user's usage habits and meets humanized needs.

Claims (6)

1. A method for drawing a linear mouse auxiliary function is characterized by comprising the following steps: providing a function key outside the standard mouse key; when the function key is loosened, the mouse is a standard mouse; when the function key is pressed down, the function key is pressed,
step 1: the mouse enters a linear mode, is in a preparation state and waits for direction judgment;
step 2: when a user starts to move the mouse, collecting data of previous N times of mouse movement, analyzing the data, judging the direction, entering a linear processing state once the judgment is finished, and sending a direction processing result of the N times of movement data to the PC; the direction judgment algorithm is as follows:
step 2-1: collecting the movement data of the mouse in X and Y directions for N times;
step 2-2: respectively summing the moving data in the X direction and the Y direction to obtain Xsum and Ysum, and then calculating absolute values to obtain | Xsum | and | Ysum |;
step 2-3: calculating to obtain the difference Diff = | | Xsum | - | Ysum |;
step 2-4: calculating to obtain a judgment Factor = Max (| Xsum |/2, | Ysum |/2);
if Diff > Factor, the direction is determined to be the X or Y direction, wherein if | Xsum | > | Ysum |, the direction is determined to be the X-axis linear direction, and otherwise, | Ysum | > | Xsum |, the direction is determined to be the Y-axis linear direction;
if Diff < Factor, the direction is determined to be XY direction, and further judgment is needed to be made as to whether the direction is XY45 degrees or XY135 degrees; wherein, if the polarities of Xsum and Ysum are opposite, namely one is positive number and the other is negative number, the direction is XY45 degrees, otherwise, the polarities of Xsum and Ysum are the same, namely both positive numbers or both negative numbers, the direction is XY135 degrees;
wherein the X direction is a transverse direction, the Y direction is a longitudinal direction, the XY45 degree direction is a left falling direction of Chinese character strokes, and the XY135 degree direction is a right falling direction of Chinese character strokes;
and 3, step 3: after that, the data obtained by the mouse moved by the user is corrected in the corresponding judgment direction, so that the data reported by the mouse is ensured to be linear data; after the linear direction is judged, linear processing is carried out on the movement data of the mouse in the X and Y directions, and according to the four directions, the corresponding processing algorithm is as follows:
if the determined linear direction is the X-axis direction, discarding the moving data in the Y direction, and only reporting the moving data in the X direction to the PC, wherein the reported data is [ X, 0 ];
if the determined linear direction is the Y-axis direction, discarding the moving data in the X direction, and only reporting the moving data in the Y direction to the PC, wherein the reported data is [0, Y ];
if the determined straight line direction is XY45 degrees, the opposite number of the moving data in the X direction, namely-X replaces the moving data in the Y direction to report to the PC, and the reported data is [ X, -X ];
if the determined straight line direction is XY135 degrees, replacing the mobile data in the Y direction with the mobile data in the X direction, and reporting to the PC, wherein the reported data is [ X, X ];
x and y are both signed integers;
and 4, step 4: until the user releases the function button, leaves the straight-line mode, and returns to the standard mouse function.
2. The method of claim 1, wherein the method comprises: the value of N is any integer from 16 to 20.
3. The method of claim 1, wherein the method comprises: the mouse is a two-dimensional pointing device whose reported data contains X and Y axis movement data from the sensors of the mouse.
4. The method of claim 1, wherein the method comprises: the function keys are arranged on the mouse or the keyboard; or the function keys are external keys independent of a mouse and a keyboard.
5. The method of claim 1, wherein the method comprises: and (3) reporting data by the mouse, and controlling a corresponding display to present a linear track drawn by the mouse by the PC.
6. The method of claim 1, wherein the method comprises: when drawing straight lines in different directions, firstly drawing a straight line in one direction, then releasing the function key by a user, leaving the straight line mode, returning to the standard mouse function, pressing the function key again, and finishing drawing a straight line in another direction through the steps 1, 2, 3 and 4.
CN202110603565.9A 2021-05-31 2021-05-31 Method for drawing linear mouse auxiliary function Active CN113238699B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110603565.9A CN113238699B (en) 2021-05-31 2021-05-31 Method for drawing linear mouse auxiliary function

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110603565.9A CN113238699B (en) 2021-05-31 2021-05-31 Method for drawing linear mouse auxiliary function

Publications (2)

Publication Number Publication Date
CN113238699A CN113238699A (en) 2021-08-10
CN113238699B true CN113238699B (en) 2022-07-01

Family

ID=77135913

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110603565.9A Active CN113238699B (en) 2021-05-31 2021-05-31 Method for drawing linear mouse auxiliary function

Country Status (1)

Country Link
CN (1) CN113238699B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102253731A (en) * 2010-05-17 2011-11-23 致伸科技股份有限公司 Multifunctional mouse device
CN206848966U (en) * 2015-08-28 2018-01-05 肖湘茂 A kind of mouse for meeting ergonomics
CN108170288A (en) * 2018-01-22 2018-06-15 广东虹勤通讯技术有限公司 Notebook computer and keyboard
CN110858103A (en) * 2018-08-23 2020-03-03 原相科技股份有限公司 Pen type mouse with track compensation function
CN112650402A (en) * 2020-12-25 2021-04-13 广州市博大电子设备有限公司 Control method of mouse and application thereof

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2191453Y (en) * 1994-01-25 1995-03-08 段西京 X axis and Y axis locking device for mouse or track ball
US7773100B2 (en) * 2006-04-10 2010-08-10 Roland Wescott Montague Extended rotation and sharpening of an object viewed from a finite number of angles
CN101493752A (en) * 2009-02-26 2009-07-29 郑松平 Cursor operating system, mobile phone and palm computer
US9678662B2 (en) * 2010-04-23 2017-06-13 Handscape Inc. Method for detecting user gestures from alternative touchpads of a handheld computerized device
WO2012049899A1 (en) * 2010-10-15 2012-04-19 株式会社図研 Input information processing device, input information processing method, program and computer-readable recording medium
CN102566868A (en) * 2010-12-24 2012-07-11 北京普源精电科技有限公司 Method and device for treating mouse drawn wave
EP2767888A3 (en) * 2013-02-19 2014-10-01 Handscape Inc. Method for user input from alternative touchpads of a handheld computerized device
EP2770413A3 (en) * 2013-02-22 2017-01-04 Samsung Electronics Co., Ltd. An apparatus for providing a cursor in electronic devices and a method thereof
TW201433945A (en) * 2013-02-26 2014-09-01 Hon Hai Prec Ind Co Ltd Electronic device and human-computer interaction method
CN103941982B (en) * 2014-05-12 2016-08-24 腾讯科技(深圳)有限公司 A kind of method sharing interface processing and terminal
CN107066173B (en) * 2017-03-28 2018-06-05 腾讯科技(深圳)有限公司 Method of controlling operation thereof and device
CN207542121U (en) * 2017-12-11 2018-06-26 东莞市铭冠电子科技有限公司 a keyboard switch

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102253731A (en) * 2010-05-17 2011-11-23 致伸科技股份有限公司 Multifunctional mouse device
CN206848966U (en) * 2015-08-28 2018-01-05 肖湘茂 A kind of mouse for meeting ergonomics
CN108170288A (en) * 2018-01-22 2018-06-15 广东虹勤通讯技术有限公司 Notebook computer and keyboard
CN110858103A (en) * 2018-08-23 2020-03-03 原相科技股份有限公司 Pen type mouse with track compensation function
CN112650402A (en) * 2020-12-25 2021-04-13 广州市博大电子设备有限公司 Control method of mouse and application thereof

Also Published As

Publication number Publication date
CN113238699A (en) 2021-08-10

Similar Documents

Publication Publication Date Title
CN104331154B (en) Realize the man-machine interaction method and system of non-contact type mouse control
CN101408824A (en) Method for recognizing mouse gesticulation
CN107300997B (en) Frame pressure touch device of mobile terminal and touch identification method
CN102768595B (en) A kind of method and device identifying touch control operation instruction on touch-screen
CN103354581B (en) Method and system for automatically adjusting mobile phone control with left or right hand
CN103218044B (en) A kind of touching device of physically based deformation feedback and processing method of touch thereof
CN107132986A (en) A kind of method and device of virtual key Intelligent adjustment touch-control response region
CN101963851A (en) Mobile equipment and implementation method, receiving host and implementation method as well as communication system
CN103870071B (en) One kind touches source discrimination and system
WO2012041183A1 (en) Method and system for recognizing operation track input on mobile terminal interface
CN101183284A (en) Mobile terminal hand-written inputting method, device and mobile terminal
CN110069133A (en) Demo system control method and control system based on gesture identification
WO2014146516A1 (en) Interactive device and method for left and right hands
CN113238699B (en) Method for drawing linear mouse auxiliary function
WO2011118313A1 (en) Coordinate input device, and program
CN1315024C (en) Video recognition input system
CN103399687B (en) The execution processing method that a kind of single-point touch window shows
CN104731396B (en) A kind of magic pen and its display control method
CN109976621A (en) Shortcut menu control method and system
CN100541409C (en) A touch button setting method and touch scanning device thereof
CN100547532C (en) An input method and system based on an infrared touch screen
CN115471852A (en) Touch recognition method, touch device, storage medium and computer device
CN113515190A (en) Mouse function implementation method based on human body gestures
CN106547402A (en) A kind of touch control method, touch frame and smart pen
CN105204627B (en) A digital input method based on gesture

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
GR01 Patent grant
GR01 Patent grant