[go: up one dir, main page]

HK1163867A - An inertial movement method for a window object and an implementation device - Google Patents

An inertial movement method for a window object and an implementation device Download PDF

Info

Publication number
HK1163867A
HK1163867A HK12104297.8A HK12104297A HK1163867A HK 1163867 A HK1163867 A HK 1163867A HK 12104297 A HK12104297 A HK 12104297A HK 1163867 A HK1163867 A HK 1163867A
Authority
HK
Hong Kong
Prior art keywords
velocity
initial
window object
period
timer1
Prior art date
Application number
HK12104297.8A
Other languages
Chinese (zh)
Inventor
任旻
张强
高舜东
Original Assignee
腾讯科技(深圳)有限公司
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of HK1163867A publication Critical patent/HK1163867A/en

Links

Description

Window object inertia moving method and implementation device
Technical Field
The invention relates to a design technology of a software operation interface of touch screen equipment, in particular to a method for moving a window object through inertia and an implementation device.
Background
The network instant messaging tool is developed to present, is accepted by most netizens, becomes an indispensable software tool for users, and is widely used not only in leisure entertainment at ordinary times but also in the work of the users. Therefore, users have high requirements on the aspects of usability, stability, safety and the like of Instant Messaging (IM) software.
With the development of technology, touch products such as iPhone are gradually popularized. Designs that utilize inertia to achieve pseudomaterialization are becoming mainstream.
In the existing design for realizing the simulation by using inertia, a user can realize content scrolling based on the list of linear velocity and the inertia effect of a webpage through linear touch operation, but cannot process the inertia effect based on the angular velocity under the rotation condition.
Disclosure of Invention
In view of the above, the main objective of the present invention is to provide an inertial moving method and an implementation apparatus for a window object, which are used to implement an inertial moving effect of the window object based on linear velocity and angular velocity.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a method of inertial movement of a window object, the method comprising:
A. monitoring the initial contact operation of the input device, recording initial contact coordinates and contact time, and starting a first Timer 1;
B. in the process of dragging the window object, the Timer1 regularly triggers and acquires an event relative to the displacement and the rotation of the user on the screen through the input device at the previous time point, and transmits the acquired displacement and rotation to the window object;
C. when the user releases the window object, the initial speed of the linear velocity and the initial speed of the angular velocity of the window object are obtained, and a second Timer2 is started;
D. based on the initial velocity of the linear velocity and the initial velocity of the angular velocity, Timer2 triggers an event for acquiring the current displacement and the current rotation of the window object at regular time according to the deceleration of the linear velocity and the deceleration of the angular velocity, and transmits the acquired displacement and the acquired rotation to the window object;
E. when the initial velocity of the linear velocity and the initial velocity of the angular velocity corresponding to the current Timer2 cycle are equal to or less than 0, the window object inertial movement processing is terminated.
Further, the method according to claim 1, wherein the user drags the window object by an input device with one touch point or a plurality of touch points, and in the case of a plurality of touch points, the amount of displacement and the amount of rotation are acquired with two touch points having the smallest device number.
Based on the above method, the present invention further provides a window object inertial moving device, which includes:
the touch point capturing unit is used for capturing the operation of dragging the window object on the screen by the input equipment and generating corresponding control information;
the dragging processing unit is used for realizing the dragging effect of the window object according to the control information sent by the contact capturing unit; when the input equipment releases the window object, acquiring the initial velocity of the linear velocity and the initial velocity of the angular velocity, and sending the acquired initial velocity of the linear velocity and the initial velocity of the angular velocity to the inertial processing unit;
and the inertia processing unit is used for realizing an inertia movement effect according to the linear velocity deceleration and the angular velocity deceleration based on the initial velocity of the linear velocity and the initial velocity of the angular velocity transmitted by the dragging processing unit.
Further, the control information generated by the contact point capturing unit includes:
inputting initial control information when the equipment initially contacts the window object, wherein the initial control information comprises a position, time, an equipment number and an identifier of the initial contact window object;
inputting current control information when the equipment moves the window object, wherein the current control information comprises position, time, equipment number and identification of a dragging window object;
the release control information when the input device releases the window object includes the position, time, device number, and the identifier of the release window object.
Further, the drag processing unit includes:
the touch control device comprises a first movement processing unit, a second movement processing unit and a touch control unit, wherein the first movement processing unit is used for starting a first Timer1 when initial control information sent by a touch capture unit is received, acquiring the displacement and the rotation of a window object corresponding to the current period of the Timer1 according to the current control information sent by the touch capture unit under the triggering of the first Timer, and sending the acquired displacement and the acquired rotation to the window object;
and the initial velocity processing unit is used for acquiring the initial velocity of the linear velocity and the initial velocity of the angular velocity after receiving the release control information sent by the contact capture unit and sending the acquired initial velocity of the linear velocity and the acquired initial velocity of the angular velocity to the inertia processing unit.
By applying the technical scheme provided by the invention, the inertial moving effect of the window object is realized, the touch operation is convenient, and the usability of the mobile terminal software is improved through the interface and the operation of the simulation.
Drawings
FIG. 1 is a schematic structural diagram of an apparatus for implementing an inertial movement effect of a window object according to the present invention;
FIG. 2 is a vector diagram of displacement and rotation obtained for a single touch;
FIG. 3 is a vector diagram of the displacement and rotation obtained for a multi-touch situation;
fig. 4 is a flowchart illustrating a method for moving a window object according to the present invention.
Detailed Description
The invention has the basic idea that the process of moving the window object by the mouse or the finger of the user is executed with the simulation processing, and after the user finishes the dragging operation, the inertia processing unit realizes the inertia moving effect of the moving object according to the linear velocity and the angular velocity when the mouse releases the dragging key or the finger lifts.
The mobile object in the invention refers to a window object instance capable of responding to mouse or finger dragging operation based on a touch screen, wherein the window object has self interface attribute, method attribute and data attribute and can respond to a trigger event of a window interface; for example, taking the Window operating system as an example, the Window object may be a Window object displaying contact information, and the Window object includes interface attributes such as an event function responding to a user click and move operation, a Window having a Width (Width), a Height (Height), a rotation Angle (Angle) around a center point of the Window, a horizontal coordinate (CenterX) of the center point of the Window, a vertical coordinate (CenterY) of the center point of the Window, and the like.
For convenience of description, in the following description, the operation scenario is that a user moves a window object example (hereinafter, referred to as a window object for convenience of description) representing an instant messaging contact by a finger or a mouse, when the window object is moved at a certain speed, the finger is suddenly lifted or a mouse button is released, the window object moves and rotates continuously along the original motion trajectory under the action of inertia, and slowly becomes a static state under the action of friction (deceleration).
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings by way of examples.
Fig. 1 is a schematic structural diagram of an apparatus for implementing an inertial movement effect of a window object according to the present invention, the apparatus includes a contact point capturing unit 101, a dragging processing unit 102, and an inertial processing unit 103;
the touch point capturing unit 101 is used for capturing the operation of dragging a window object on a screen by an input device and generating corresponding control information;
the input device comprises a touch screen, a mouse, a tablet and other devices capable of realizing window movement;
the control information includes: (1) inputting initial control information when the equipment initially contacts the window object, wherein the initial control information comprises position, time, equipment number, identification of the initial contact window object and the like; (2) inputting current control information when the device moves the window object, wherein the current control information comprises position, time, device number, identification of dragging the window object and the like; (3) the input device releases the window object, and the release control information when finishing dragging the window object comprises position, time, device number, mark for marking the release window object, and the like;
the contact capture unit 101 is an interface unit between the device and the operating system, and monitors the operation of the operating system on the window object in real time, obtains the control information generated by the input device, and transmits the control information to the drag processing unit, and the drag processing unit realizes the drag effect on the window object.
For example: when a mouse or a finger is pressed and moved, the touch point capturing unit 101 captures a mouse pressing or finger touching event, and sends initial control information to the drag processing unit 102, wherein the initial control information includes: the position coordinates of a contact point, the current time, the equipment number, an identifier for marking the left button pressing of a mouse or the identifier for pressing a finger to drag a window object and the like; the device numbers are used for distinguishing different input devices, and under the condition of multi-point touch, for example, a user simultaneously uses two fingers to touch a window object, and the device numbers corresponding to the fingers touching the touch screen at different times are different.
A dragging processing unit 102, configured to implement a dragging effect of the window object according to the control information sent by the contact capturing unit 101;
the drag processing unit includes: a first mobile processing unit and an initial velocity calculating unit;
the touch control device comprises a first movement processing unit, a second movement processing unit and a touch control unit, wherein the first movement processing unit is used for starting a first Timer1 when initial control information sent by a touch capture unit is received, acquiring the displacement and the rotation of a window object corresponding to the current period of the Timer1 according to the current control information sent by the touch capture unit under the triggering of the first Timer, and sending the acquired displacement and the acquired rotation to the window object;
and the initial velocity processing unit is used for acquiring the initial velocity of the linear velocity and the initial velocity of the angular velocity after receiving the release control information sent by the contact capture unit and sending the acquired initial velocity of the linear velocity and the acquired initial velocity of the angular velocity to the inertia processing unit.
The method for realizing the dragging effect of the window object specifically comprises the following steps:
(1) after the initial control information sent by the contact point capturing unit 101 is received by the drag processing unit 102, the position coordinate information (X) of the initial contact point is recorded0,Y0) Initial contact time T0And a device number;
(2) when the mouse or finger moves after being pressed, the drag processing unit 102 records the position (X) of the mouse or finger every period Δ ti,Yi) Time T of the current timeiThe equipment number is used for acquiring the displacement and the rotation amount relative to the previous recording time point, and sending the relative displacement and the rotation amount to the window object, and the window object sets the attribute value of the window object to realize the dragging effect;
for example, when the center coordinate attribute of the window object is (CenterX, CenterY), the rotation Angle attribute is Angle, and the window object is in the period TiWhen the current displacement is obtained as (Δ X, Δ Y) and the rotation amount is α, the window object sets its own center coordinate attribute value and rotation angle attribute value as:
CenterX=CenterX+ΔX
CenterY=CenterY+ΔY
Angle=Angle+α
and the window object triggers an interface redrawing function of the window object by setting the central coordinate attribute value and the rotation angle attribute value, and displays the window object at a new coordinate position and with a new rotation angle.
(3) When the input device releases the window object, that is, when the mouse or finger is lifted, the contact capture unit sends release control information to the drag processing unit, and the drag processing unit acquires an initial velocity of the linear velocity and an initial velocity of the angular velocity from the displacement amount and the rotation amount acquired in the last cycle of the Timer1 before the release;
and acquiring the displacement, the rotation amount, the initial velocity of the linear velocity and the initial velocity of the angular velocity, namely, two conditions of single-point contact and multi-point contact.
(1) As shown in fig. 2, the method for acquiring the displacement amount, the rotation amount, the initial velocity of the linear velocity, and the initial velocity of the angular velocity in the case of single-point contact includes:
Ti-1to TiThe displacement amount therebetween is: (Δ X, Δ Y) ═ Xi-Xi-1,Yi-Yi-1)
Wherein (X)i,Yi) Is the Tth time of Timer1iCoordinate vector of the corresponding contact of period, (X)i-1,Yi-1) Is the Tth time of Timer1i-1Coordinate vectors of corresponding contacts in a period;
Ti-1to TiThe amount of rotation between: α ═ arcos [ u ]i.vi/(|ui||vi|)]
Wherein, the rotation center coordinate is the center coordinate of the window object: (C)x,Cy),uiIs the Tth time of Timer1iThe vector between the coordinates of the periodically corresponding contact and the coordinates of the center of rotation, i.e. ui=(Xi-Cx,Yi-Cy);viIs the Tth time of Timer1i-1Vectors between the periodically corresponding coordinates of the contact and the coordinates of the center of rotation, i.e. vi=(Xi-1-Cx,Yi-1-Cy);
The initial velocity V of the linear velocity when the input device releases the window object is:
V=(Xn-Xn-1,Yn-Yn-1)/(Tn-Tn-1)=(Xn-Xn-1,Yn-Yn-1)/Δt
wherein (X)n,Yn) The last period T of Timer1 when a window object is released for an input devicenCoordinate vectors of corresponding contacts; (X)n-1,Yn-1) Is Tn-1Coordinate vectors of corresponding contacts in a period;
if Δ t is a standard unit time, the above equation can be simplified as follows:
V=(Xn-Xn-1,Yn-Yn-1)
the method for acquiring the initial velocity Va of the angular velocity when the input device releases the window object includes:
Va=arcos[un.vn/(|un||vn|)]/(Tn-Tn-1)=arcos[un.vn/(|un||vn|)]/Δt
wherein u isnIs the Tth time of Timer1nPeriodically corresponding contact coordinates (X)n,Yn) And the coordinate (C) of the center of rotationx,Cy) A vector of between, i.e. un=(Xn-Cx,Yn-Cy);vnIs the Tth time of Timer1n-1Vectors between the periodically corresponding coordinates of the contact and the coordinates of the center of rotation, i.e. vn=(Xn-1-Cx,Yn-1-Cy);
If Δ t is set as a standard unit time, the above equation can be simplified as:
Va=arcos[un.vn/(|un||vn|)]
(2) as shown in fig. 3, in the case of multipoint contact, only two points with the smallest device number are considered, and the displacement amount, the rotation amount, the initial velocity of the linear velocity, and the initial velocity of the angular velocity are obtained by:
suppose that the two contacts with the smallest device number are at time T of Timer1i-1The corresponding coordinate of the period is (X)i-1,d0,Yi-1,d0) And (X)i-1,d1,Yi-1,d1) No. TiThe corresponding coordinate of the period is (X)i,d0,Yi,d0) And (X)i,d1,Yi,d1) Wherein d0 and d1 are equipment numbers; the two points are in the period Ti-1And period TiThe coordinate vectors of the centers of (a) are respectively:
(CXi,CYi)=((Xi,d0+Xi,d1)/2,(Yi,d0+Yi,d1)/2)
(CXi-1,CYi-1)=((Xi-1,d0+Xi-1,d1)/2,(Yi-1,d0+Yi-1,d1)/2)
Ti-1to TiThe displacement amount therebetween is:
(ΔX,ΔY)=(CXi-CXi-1,CYi-CYi-1)
the period T of Timer1 when the input device releases the window objectnThe initial velocity of the corresponding linear velocity is:
V=(CXn-CXn-1,CYn-CYn-1)/(Tn-Tn-1)
=(CXn-CXn-1,CYn-CYn-1)/Δt
wherein (CX)n,CYn)、(CXn-1,CYn-1) When the window objects are respectively released for the input devices, the two contacts with the smallest device numbers are in the last period T of the Timer1nAnd period Tn-1Forming the coordinates of the center point of the vector; Δ t is the timing period of Timer 1;
if Δ t is set to a standard unit time, the formula can be simplified as:
V=(CXn-CXn-1,CYn-CYn-1)
at a plurality ofIn the case of the point touch, when the rotation amount is acquired, only two points with the smallest device number are considered, and the period T is set to be two pointsi-1And during the period TiThe intersection point of the connecting lines is the central point for acquiring the rotation amount, and the period TiThe corresponding coordinates of the two points are (X)i,d0,Yi,d0) And (X)i,d1,Yi,d1) Period T ofi-1The coordinates of the corresponding two points are (X)i-1,d0,Yi-1,d0) And (X)i-1,d1,Yi-1,d1),
The coordinates of the rotation center point of the rotation amount are acquired as follows:
(Cx,Cy)=((Xi,d0+Xi,d1)/2,(Yi,d0+Yi,d1)/2)
Ti-1to TiThe amount of rotation between: alpha is alphai=arcos[ui.vi/(|ui||vi)]
Wherein u isiT for Timer1iVector (X) formed by two points with minimum equipment numbers corresponding to periodsi,d0-Xi,d1,Yi,d0-Yi,d1),viT for Timer1i-1Vector (X) formed by two points with minimum equipment numbers corresponding to periodsi-1,d0-Xi-1,d1,Yi-1,d0-Yi-1,d1)。
T of Timer1 when the input device releases the window objectnThe initial velocity Va of the rotation amount angular velocity corresponding to the cycle is:
Va=arcos[un.vn/(|un||vn|)]/(Tn-Tn-1)=arcos[un.vn/(|un||vn|)]/Δt
wherein u isnThe last period T of Timer1 when a window object is released for an input devicenVector (X) formed by two points with minimum corresponding equipment numbersn,d0-Xn,d1,Yn,d0-Yn,d1),vnIs a period Tn-1Vector (X) formed by two points with minimum corresponding equipment numbersn-1,d0-Xn-1,d1,Yn-1,d0-Yn-1,d1)。
If Δ t is set as a standard unit time, the formula can be simplified as:
Va=arcos[un.vn/(|un||vn|)]
the inertia processing unit 103 is configured to implement an inertia moving effect after the input device releases the window object, that is, after the user finishes the dragging operation; after receiving the release control information sent by the drag processing unit, the inertia processing unit 103 starts a second Timer2, triggers a Timer processing function once every Tg time period, obtains the displacement and rotation amount in the current period in the Timer processing function at the linear velocity initial speed and angular velocity initial speed corresponding to the current Timer2 period, and then sends the obtained displacement and rotation amount in the current period to the window object, and the window object sets its own attribute to realize the inertia movement effect.
Timer 2TiThe method for acquiring the initial velocity of the linear velocity corresponding to the period comprises the following steps:
Vi=Vi-1-Vdec*Tg;
wherein, VdecThe deceleration is the linear velocity deceleration, which can be preset by a user or a system according to the actual situation, and is equivalent to adjusting the friction coefficient of the linear velocity; the first Timer2 period, V, after the input device releases the window object1The linear velocity initial velocity V is sent by the dragging processing module; tg is the period of Timer2, which may be preset by the user or the system;
timer 2TiThe method for acquiring the initial angular velocity corresponding to the period comprises the following steps:
Vai=Vai-1-Vadec*Tg
wherein the content of the first and second substances,Vadecthe value of the angular speed deceleration can be preset by a user or a system according to actual conditions, and is equivalent to adjusting the friction coefficient of the angular speed; the first Timer2 cycle, Va, after the input device releases the window object1An initial angular velocity Va sent by the dragging processing module;
timer 2TiThe displacement corresponding to the cycle is:
(ΔX,ΔY)=(Vi-Vdec*Tg)*Tg=(Vi.X-Vdec*Tg,Vi.Y-Vdec*Tg)*Tg
wherein Vi is a linear velocity initial velocity vector corresponding to the Ti-th period of the Timer2, and Tg is a Timer2 timing period;
timer 2TiThe rotation amount corresponding to the period is:
αi=(Vai-Vadec*Tg)*Tg
wherein, VaiIs the Tth time of Timer2iAngular velocity initial velocity corresponding to the period;
if Tg is equal to Δ t, and Δ t is set as the standard unit time, the above equation can be simplified as:
(ΔX,ΔY)=(Vi.X-Vdec,Vi.Y-Vdec)
αi=(Vai-Vadec)
that is, taking Tg ═ Δ t as the unit time of the velocity sampling, the inertia processing, and the window object position refreshing can greatly simplify the amount of calculation.
When the displacement amount and the rotation amount of the inertial movement of the current time period window object obtained by the above equations are equal to or less than 0, the inertial processing is ended.
After the window object receives the displacement amount and the rotation amount sent by the inertia processing unit 103 each time, the center coordinate attribute value and the rotation angle attribute value of the window object are set as follows:
CenterX=CenterX+ΔX
CenterY=CenterY+ΔY
Angle=Angle+α
and triggering an interface redrawing function by setting the center coordinate attribute value and the rotation angle attribute value, and displaying the window object at a new coordinate position and a new rotation angle, thereby realizing the inertial moving effect.
Fig. 4 is a processing flow chart of the window object moving method of the present invention, which includes the following specific steps:
step 401: monitoring initial contact operation of input equipment to acquire initial control information;
in the step, the initial contact operation of the input equipment is monitored by the contact capture unit, and after the initial contact operation is monitored, initial control information is sent to the dragging processing unit;
the input devices include input devices with a window object moving function, such as a mouse, a touch screen, a tablet, and the like, and the input devices are different, and the types of the generated system messages are also different. For example, the system message of mouse-triggered window object movement may be a mouse left button press and move, the system message of touch screen-triggered window object movement may be a finger press and move, etc.
The initial contact operation finger is used for initially pressing a left mouse button or initially pressing a finger on a touch screen by a user to prepare for clicking operation of a moving window object;
the initial control information includes: the position, time, equipment number, key code and the like of the initial contact point;
step 402: recording initial control information, starting a first Timer1, setting a timing period to be delta t, and presetting the delta t by a user or a system according to an actual condition;
after receiving the initial control information sent by the contact point capturing unit, the dragging processing unit records the initial control information and starts the Timer1, wherein the Timer1 is used for periodically triggering the event function of calculating the displacement amount (Δ X, Δ Y) and the rotation amount α of the window object, so as to obtain the displacement amount and the rotation amount generated on the screen by the current period input device.
Step 403: the Timer1 counts the time period, acquires the current control information, and acquires the displacement and the rotation of the user on the screen through the input device in the current time period;
the precondition for executing the step is that a user keeps the pressing operation of the input device, the window object is static or dragged, the contact capture unit converts the monitored system message generated by the input device into current control information (including position, time, device number and the like) and continuously sends the current control information to the dragging processing unit, the dragging processing unit updates the locally cached current control information in real time and records the current control information when the timing period of each Timer1 is up, so as to form a historical record of the control information, and the track of the input device moving on the screen can be reflected through the historical record, which can also be called as a gesture;
step 404: the window object adjusts the position and the rotation angle of the window object on the screen according to the obtained displacement amount and the obtained rotation amount;
the dragging processing unit transmits the displacement amount and the rotation amount of the current time point to the window object after obtaining the displacement amount and the rotation amount of the current time point; the window object triggers a window redrawing method by setting the self central point coordinate and the attribute value of the rotating angle relative to the self central point coordinate, thereby realizing the dragging effect;
step 405: judging whether the input equipment releases the window object, namely whether the user lifts a mouse button or a finger, and ending the dragging operation, if so, executing step 406; otherwise, go to step 403;
in the step, a contact capture unit monitors whether an input device releases a window object, and immediately sends a release control message to a dragging processing unit after detecting a release message, wherein the release control message comprises information such as position, time, device number and the like of a release moment;
step 406: at the end of the drag operation, the last period T of Timer1 is obtainednStopping the Timer1 according to the initial velocity V of the linear velocity and the initial velocity Va of the angular velocity;
the dragging processing unit obtains the last period T of the Timer1 when the window object is released by the input device according to the history of the control informationnThe corresponding initial velocity V of the linear velocity and the initial velocity Va of the angular velocity are obtained by the methods described above, and are not described herein again; the dragging processing unit sends the obtained initial velocity V and the initial velocity Va of the angular velocity to the inertia processing unit;
step 407: starting a second Timer2 with the timing period set to Tg;
in the step, after the inertial processing unit receives V and Va, a second timer is started, wherein the second timer is used for realizing the inertial movement effect of the input equipment after the window object is released;
step 408: each time the Timer2 timing cycle expires, the deceleration V is based on the linear velocitydecAnd angular velocity deceleration VadecAcquiring the current displacement and rotation amount of a window object, recording the position of the current moment, and calculating the initial velocity V of a linear velocity and the initial velocity Va of an angular velocity for the next timing period;
the step is that the inertia processing unit processes the data according to the preset VdecAnd VadecAcquiring the displacement and the rotation amount of the window object which continues to move forwards in the current Timer2 timing period after the input device releases the window object, wherein the acquisition method is described above and is not repeated herein;
the method for acquiring the initial velocity V of the linear velocity and the initial velocity Va of the angular velocity in the next Timer2 timing period is as follows:
Vi=Vi-1-Vdec*Tg;
Vai=Vai-1-Vadec*Tg
step 409: judging whether the inertial movement is finished or not, if so, finishing the process; if not, go to step 410;
the method for judging whether the inertial movement is finished comprises the following steps: v obtained in the judgment step 408iAnd VaiWhether the inertia motion processing is less than or equal to 0 or not, if so, the Timer2 is terminated, and the inertia motion processing is ended; if one value is less than or equal to 0 and the other value is still greater than 0, then the other value is also subjected to inertia processing, for example, when V is less than or equal to 0i0 or less, VaiIf the current period is greater than 0, the displacement amount is 0 and the rotation amount is not 0 in the current period and the subsequent Timer2 period, and the inertial movement process is not ended until the current period and the subsequent Timer2 period are both less than or equal to 0.
Step 410: the window object adjusts the position and the rotation angle of the window object on the screen according to the obtained displacement and the rotation amount, and an inertial movement effect is achieved; step 408 is then performed again.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.

Claims (10)

1. A method of inertial movement of a window object, the method comprising:
A. monitoring the initial contact operation of the input device, recording initial contact coordinates and contact time, and starting a first Timer 1;
B. in the process of dragging the window object, the Timer1 regularly triggers and acquires an event relative to the displacement and the rotation of the user on the screen through the input device at the previous time point, and transmits the acquired displacement and rotation to the window object;
C. when the user releases the window object, the initial speed of the linear velocity and the initial speed of the angular velocity of the window object are obtained, and a second Timer2 is started;
D. based on the initial velocity of the linear velocity and the initial velocity of the angular velocity, Timer2 triggers an event for acquiring the current displacement and the current rotation of the window object at regular time according to the deceleration of the linear velocity and the deceleration of the angular velocity, and transmits the acquired displacement and the acquired rotation to the window object;
E. when the initial velocity of the linear velocity and the initial velocity of the angular velocity corresponding to the current Timer2 cycle are equal to or less than 0, the window object inertial movement processing is terminated.
2. The method according to claim 1, wherein the user drags the window object by an input device with one touch point or a plurality of touch points, and in the case of a plurality of touch points, the amount of displacement and the amount of rotation are acquired with two touch points having the smallest device number.
3. The method of claim 1,
under the condition of single contact, in step B, the displacement amount and the rotation amount are obtained, specifically:
Ti-1to TiThe displacement amount therebetween is: (Δ X, Δ Y) ═ Xi-Xi-1,Yi-Yi-1)
Wherein (X)i,Yi) Is the Tth time of Timer1iCoordinate vector of the corresponding contact of period, (X)i-1,Yi-1) Is the Tth time of Timer1i-1Coordinate vectors of corresponding contacts in a period;
Ti-1to TiThe amount of rotation between: alpha is alphai=arcos[ui.vi/(|ui||vi|)]
Wherein, the rotation center coordinate is the center coordinate of the window object: (C)x,Cy),uiIs the Tth time of Timer1iThe vector between the coordinates of the periodically corresponding contact and the coordinates of the center of rotation, i.e. ui=(Xi-Cx,Yi-Cy);viIs the Tth time of Timer1i-1Vectors between the periodically corresponding coordinates of the contact and the coordinates of the center of rotation, i.e. vi=(Xi-1-Cx,Yi-1-Cy);
Under the condition of a single contact, in the step C, the method for acquiring the initial velocity V of the linear velocity and the initial velocity Va of the angular velocity specifically includes:
V=(Xn-Xn-1,Yn-Yn-1)/(Tn-Tn-1)=(Xn-Xn-1,Yn-Yn-1)/Δt
wherein (X)n,Yn) Timer1 last cycle T when releasing a window object for an input devicenCoordinate vectors of corresponding contacts; (X)n-1,Yn-1) Is Tn-1Coordinate vectors of corresponding contacts in a period; Δ t is the timing period of Timer 1;
Va=arcos[un.vn/(|un||vn|)]/(Tn-Tn-1)=arcos[un.vn/(|un||vn|)]/Δt
wherein u isnTimer1 Tth when releasing a window object for an input devicenPeriodically corresponding contact coordinates (X)n,Yn) And the coordinate (C) of the center of rotationx,Cy) A vector of between, i.e. un=(Xn-Cx,Yn-Cy);vnIs the Tth time of Timer1n-1Vectors between the periodically corresponding coordinates of the contact and the coordinates of the center of rotation, i.e. vn=(Xn-1-Cx,Yn-1-Cy)。
4. The method of claim 2,
in the case of multiple contacts, in step B, the displacement amount and the rotation amount are obtained, specifically:
Ti-1to TiThe displacement amount therebetween is: (Δ X, Δ Y) ═ X (CXi-CXi-1,CYi-CYi-1)
Wherein (CX)i,CYi)、(CXi-1,CYi-1) The two contacts with the smallest numbers for the devices are respectively at the Tth time of Timer1iAnd Ti-1A central point coordinate corresponding to the period;
Ti-1to TiThe amount of rotation between: alpha is alphai=arcos[ui.vi/(|ui||vi|)]
Wherein u isiT for Timer1iVector formed by two points with minimum equipment numbers corresponding to periods viT for Timer1i-1A vector formed by two points with the minimum equipment number corresponding to the period;
under the condition of multiple contacts, in step C, the method for acquiring V and Va specifically includes:
V=(CXn-CXn-1,CYn-CYn-1)/(Tn-Tn-1)=(CXn-CXn-1,CYn-CYn-1)/Δt
wherein (CX)n,CYn)、(CXn-1,CYn-1) The two contacts with the minimum device numbers when the window objects are released for the input devices respectively are in the last period T of the Timer1nAnd period Tn-1Forming the coordinates of the central point of the vector correspondingly; Δ t is the timing period of Timer 1;
Va=arcos[un.vn/(|un||vn|)]/(Tn-Tn-1)=arcos[un.vn/(|un||vn|)]/Δt
wherein u isnThe last period T of Timer1 when a window object is released for an input devicenVector formed by two points with minimum corresponding equipment numbers vnIs a period Tn-1And the vector formed by the two points with the minimum corresponding equipment numbers.
5. The method according to claim 1, wherein in step D, the method for obtaining the current displacement and rotation of the window object according to the deceleration of the linear velocity and the deceleration of the angular velocity comprises:
timer 2TiThe displacement corresponding to the cycle is: (Δ X, Δ Y) ═ Vi-Vdec*Tg)*Tg
Timer 2TiThe rotation amount corresponding to the period is: alpha is alphai=(Vai-Vadec*Tg)*Tg
Wherein, VdecFor linear velocity deceleration, VadecIs the angular velocity deceleration; viIs the Tth time of Timer2iLinear velocity initial velocity corresponding to the period; va (Va)iIs the Tth time of Timer2iAngular velocity initial velocity corresponding to the period; tg is Timer2 timing period; and C, after the window object is released by the input device, the initial linear velocity and the initial angular velocity corresponding to the first Timer2 period are the initial linear velocity and the initial angular velocity obtained in the step C.
6. An inertial movement apparatus for a window object, the apparatus comprising:
the touch point capturing unit is used for capturing the operation of dragging the window object on the screen by the input equipment and generating corresponding control information;
the dragging processing unit is used for realizing the dragging effect of the window object according to the control information sent by the contact capturing unit; when the input equipment releases the window object, acquiring the initial velocity of the linear velocity and the initial velocity of the angular velocity, and sending the acquired initial velocity of the linear velocity and the initial velocity of the angular velocity to the inertial processing unit;
and the inertia processing unit is used for realizing an inertia movement effect according to the linear velocity deceleration and the angular velocity deceleration based on the initial velocity of the linear velocity and the initial velocity of the angular velocity transmitted by the dragging processing unit.
7. The apparatus of claim 6, wherein the control information generated by the contact capture unit comprises:
inputting initial control information when the equipment initially contacts the window object, wherein the initial control information comprises a position, time, an equipment number and an identifier of the initial contact window object; inputting current control information when the equipment moves the window object, wherein the current control information comprises position, time, equipment number and identification of a dragging window object; the release control information when the input device releases the window object includes the position, time, device number, and the identifier of the release window object.
8. The apparatus of claim 7, wherein the drag processing unit comprises:
the touch control device comprises a first movement processing unit, a second movement processing unit and a touch control unit, wherein the first movement processing unit is used for starting a first Timer1 when initial control information sent by a touch capture unit is received, acquiring the displacement and the rotation of a window object corresponding to the current period of the Timer1 according to the current control information sent by the touch capture unit under the triggering of the first Timer, and sending the acquired displacement and the acquired rotation to the window object;
and the initial velocity processing unit is used for acquiring the initial velocity of the linear velocity and the initial velocity of the angular velocity after receiving the release control information sent by the contact capture unit and sending the acquired initial velocity of the linear velocity and the acquired initial velocity of the angular velocity to the inertia processing unit.
9. The apparatus according to claim 8, wherein in the case of a single touch point, the first movement processing unit obtains the displacement amount and the rotation amount, specifically:
Ti-1to TiThe displacement amount therebetween is: (Δ X, Δ Y) ═ Xi-Xi-1,Yi-Yi-1)
Wherein (X)i,Yi) Is the Tth time of Timer1iCoordinate vector of the corresponding contact of period, (X)i-1,Yi-1) Is the Tth time of Timer1i-1Coordinate vectors of corresponding contacts in a period;
Ti-1to TiThe amount of rotation between: alpha is alphai=arcos[ui.vi/(|ui||vi|)]
Wherein, the rotation center coordinate is the center coordinate of the window object: (C)x,Cy),uiIs the Tth time of Timer1iPeriodic pairVector between the corresponding coordinates of the contact and the coordinates of the center of rotation, i.e. ui=(Xi-Cx,Yi-Cy);viIs the Tth time of Timer1i-1Vectors between the periodically corresponding coordinates of the contact and the coordinates of the center of rotation, i.e. vi=(Xi-1-Cx,Yi-1-Cy);
Under the condition of a single contact, the method for acquiring the initial velocity V of the linear velocity and the initial velocity Va of the angular velocity by the initial velocity processing unit specifically comprises the following steps:
V=(Xn-Xn-1,Yn-Yn-1)/(Tn-Tn-1)=(Xn-Xn-1,Yn-Yn-1)/Δt
wherein (X)n,Yn) Timer1 last cycle T when releasing a window object for an input devicenCoordinate vectors of corresponding contacts; (X)n-1,Yn-1) Is Tn-1Coordinate vectors of corresponding contacts in a period; Δ t is the timing period of Timer 1;
Va=arcos[un.vn/(|un||vn|)]/(Tn-Tn-1)=arcos[un.vn/(|un||vn|)]/Δt
wherein u isnTimer1 Tth when releasing a window object for an input devicenPeriodically corresponding contact coordinates (X)n,Yn) And the coordinate (C) of the center of rotationx,Cy) A vector of between, i.e. un=(Xn-Cx,Yn-Cy);vnIs the Tth time of Timer1n-1Vectors between the periodically corresponding coordinates of the contact and the coordinates of the center of rotation, i.e. vn=(Xn-1-Cx,Yn-1-Cy);
Under the condition of multiple contacts, the first mobile processing unit acquires the displacement amount and the rotation amount, and specifically comprises the following steps:
Ti-1to TiThe displacement amount therebetween is: (Δ X, Δ Y) ═ X (CXi-CXi-1,CYi-CYi-1)
Wherein (CX)i,CYi)、(CXi-1,CYi-1) The two contacts with the smallest numbers for the devices are respectively at the Tth time of Timer1iAnd Ti-1A central point coordinate corresponding to the period;
Ti-1to TiThe amount of rotation between: alpha is alphai=arcos[ui.vi/(|ui||vi|)]
Wherein u isiT for Timer1iVector formed by two points with minimum equipment numbers corresponding to periods viT for Timer1i-1A vector formed by two points with the minimum equipment number corresponding to the period;
under the condition of multiple contacts, the method for acquiring the initial velocity V of the linear velocity and the initial velocity Va of the angular velocity by the initial velocity processing unit specifically comprises the following steps:
V=(CXn-CXn-1,CYn-CYn-1)/(Tn-Tn-1)=(CXn-CXn-1,CYn-CYn-1)/Δt
wherein (CX)n,CYn)、(CXn-1,CYn-1) The two contacts with the minimum device numbers when the window objects are released for the input devices respectively are in the last period T of the Timer1nAnd period Tn-1Forming the coordinates of the central point of the vector correspondingly; Δ t is the timing period of Timer 1;
Va=arcos[un.vn/(|un||vn|)]/(Tn-Tn-1)=arcos[un.vn/(|un||vn|)]/Δt
wherein u isnThe last period T of Timer1 when a window object is released for an input devicenVector formed by two points with minimum corresponding equipment numbers vnIs a period Tn-1And the vector formed by the two points with the minimum corresponding equipment numbers.
10. The apparatus according to claim 8, wherein the method for the inertia processing unit to obtain the current displacement amount and the rotation amount of the window object according to the deceleration of the linear velocity and the deceleration of the angular velocity is:
timer 2TiThe displacement corresponding to the cycle is: (Δ X, Δ Y) ═ Vi-Vdec*Tg)*Tg
Timer 2TiThe rotation amount corresponding to the period is: alpha is alphai=(Vai-Vadec*Tg)*Tg
Wherein, VdecFor linear velocity deceleration, VadecIs the angular velocity deceleration; viIs the Tth time of Timer2iLinear velocity initial velocity corresponding to the period; va (Va)iIs the Tth time of Timer2iAngular velocity initial velocity corresponding to the period; tg is Timer2 timing period; and C, after the window object is released by the input device, the initial linear velocity and the initial angular velocity corresponding to the first Timer2 period are the initial linear velocity and the initial angular velocity obtained in the step C.
HK12104297.8A 2012-05-02 An inertial movement method for a window object and an implementation device HK1163867A (en)

Publications (1)

Publication Number Publication Date
HK1163867A true HK1163867A (en) 2012-09-14

Family

ID=

Similar Documents

Publication Publication Date Title
CN102314297A (en) Window object inertia displacement method and realizing device
US8860678B2 (en) Computer system with touch screen and gesture processing method thereof
US20130212541A1 (en) Method, a device and a system for receiving user input
CN106959808A (en) A kind of system and method based on gesture control 3D models
Zhang et al. Ren
CN103797442A (en) Using pressure differences with a touch-sensitive display screen
CN103827785A (en) Using pressure differences with a touch-sensitive display screen
CN103955336A (en) Sensing device and method
CN107273009A (en) A kind of method and system of the quick screenshotss of mobile terminal
CN102314282B (en) A kind of method and device realizing content choice based on scroll control
CN104808810B (en) Carry out the method and mobile terminal of mouse input
US11275498B2 (en) Information processing system, information processing method, and program
WO2016141597A1 (en) Touch control method, device, terminal and graphical user interface thereof
CN105892641A (en) Click response processing method and device for somatosensory control, and system
HK1163867A (en) An inertial movement method for a window object and an implementation device
CN105045521A (en) Touch screen response method and apparatus
CN106484277A (en) A kind of method of quick projection
CN104102332B (en) Display device and its control system and method
CN106959809A (en) The method and apparatus that content is rolled are realized based on scroll control
KR20130096073A (en) Virtual mouse driving method using hand motion recognition
CN102662587A (en) Operation method and device of touch screen
CN103576910B (en) A kind of information processing method and electronic equipment
CN109407886A (en) A kind of remote interaction method, apparatus and system
CN110727345B (en) Method and system for realizing man-machine interaction through finger intersection movement
WO2017092530A1 (en) Virtual reality-based cursor movement method and system