Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
An embodiment of the present invention provides an operation mapping method, and fig. 2 is a schematic flow chart illustrating an implementation of the operation mapping method according to the embodiment of the present invention, as shown in fig. 2, the method includes steps S21 to S23:
s21, when a first application receives a touch operation, the first application acquires a first coordinate of the touch operation on a first screen; the first application is an application program which is running and displayed on a first screen of the terminal;
here, it should be noted that the terminal has at least two screens, for example, a certain mobile phone that is already on the market is a foldable dual-screen mobile phone. In this way, with the advantage that the terminal has a plurality of screens, the terminal can display a running first application on one screen and a running second application on another screen, and the content of the second application is controlled by the operation keys in the first application. For example, the first application is a handle application, the second application is a game application, and the user can control content in the game application by operating an operation key in the handle application.
S22, converting the first coordinate by the first application according to a preset operation mapping table to obtain a second coordinate;
here, in the actual engineering implementation, a developer may freely design the position of the operation key in the first application on the first screen according to the operation key in the second application, record the mapping relationship between the operation key in the second application and the operation key in the first application in the operation mapping table, and then write the configured operation mapping table into the first application. Therefore, the first application can query the mapping relation between the first coordinate and the second coordinate by using the preset operation mapping table, and then convert the first coordinate to realize the mapping to the second coordinate.
S23, the first application transfers the second coordinate to a second application; wherein the second application is an application program which is running and displayed on a second screen of the terminal.
In the embodiment of the invention, an operation mapping method is provided, when a first application receives a touch operation, the first application acquires a first coordinate of the touch operation on a first screen; the first application converts the first coordinate according to a preset operation mapping table to obtain a second coordinate; the first application passes the second coordinate to a second application. In this way, the free design of the positions of the operation keys in the first application can be realized by using the operation mapping table, without requiring that the positions of the operation keys in the first application are completely consistent with the positions of the operation keys in the second application, that is, the positions of the operation keys can be designed by fully using the space of the first screen when the operation mapping table is configured, and when the first application receives a touch operation, the first application can realize the operation mapping of the touch operation to the second application according to the pre-configured operation mapping table. Therefore, the fatigue feeling caused by long-time deviation from the center of gravity of the terminal in the process of holding the terminal by the user can be solved through the operation mapping table which can be configured in advance, and better operation experience can be provided for the user.
In other embodiments, for step S22, the converting, by the first application, the first coordinate according to the preconfigured operation mapping table to obtain the second coordinate may include steps S221 to S224:
s221, the first application determines whether the first coordinate falls into an operation area defined by the operation mapping table according to the operation mapping table; if not, go to step S222; if yes, go to step S223;
s222, ignoring the operation event corresponding to the first coordinate;
it can be understood that, if the first coordinate does not fall into any operation area defined by the operation mapping table, it indicates that the user may touch the first screen by mistake, and at this time, the operation event corresponding to the first coordinate may be ignored.
S223, if the first coordinate falls into the operation area defined by the operation mapping table, the first application obtains the coordinate offset corresponding to the operation area from the operation mapping table;
and S224, the first application performs coordinate conversion on the first coordinate by using the coordinate offset to obtain a second coordinate.
It will be appreciated that the coordinate offset is a vector of offsets of the first coordinate relative to the second coordinate. For example, as shown in fig. 3, a coordinate system is respectively established for the first screen 31 and the second screen 32 of the terminal, the coordinate system where the first screen 31 is located and the coordinate system where the second screen 32 is located are mirror-symmetric, the operation key 321 on the second screen 32 has coordinates of a point B at a center point of the operation key 321 of (x1, y1), that is, the second coordinates are (x1, y1), the operation key 321 corresponds to the operation key 311 newly designed in the layout of the first screen, and coordinates of a point a at a center point of the operation key 311 of (x1', y1'), that is, the first coordinates are (x1', y 1'); then, the positional relationship of the points B and a can be represented by the following formula (1):
in the formula, Δ x1 represents a shift vector from an abscissa x1 of the point B to an abscissa x1', and Δ y1 represents a shift vector from an ordinate y1 of the point B to an ordinate y1' of the point a;
in this way, the first coordinates can be converted into the second coordinates by the mapping relationship expressed by the above expression (1).
Here, it should be noted that, when the coordinate system is established for the first screen 31 of the terminal and the second screen 32 of the terminal, the method of establishing the coordinate system, that is, the position of the origin in the coordinate system is not limited.
In other embodiments, the method further comprises: the first application configures the operation mapping table;
wherein the content of each mapping entry of the operation mapping table comprises: the coordinates of the first center point, the coordinates of the second center point, the first boundary range and the second boundary range; wherein,
the coordinate of the first central point is the coordinate of the central point of an operation key in the first application;
the coordinate of the second central point is the coordinate of the central point of the operation key in the second application; the function of the operation key in the first application is equal to that of the operation key in the second application;
the first boundary range and the second boundary range are used for jointly defining an operation area of an operation key in the first application.
Here, the first boundary range is defined as a value range of the abscissa, and the second boundary range is defined as a value range of the ordinate, so that the operation regions of the operation keys in the first application can be defined together by the first boundary range and the second boundary range. It is to be understood that, since the function of the operation key in the first application is equivalent to that of the operation key in the second application, the first boundary range and the second boundary range are determined by the size and shape of the operation key in the second application. For example, the operation key a in the second application is circular and has a radius r, and in this case, the first boundary range of the operation key a ' and the second boundary range of the operation key a ' can be obtained from the radius r and the center point coordinates of the operation key a ' equivalent to the function of the operation key a in the first application. For another example, when the operation key B in the second application has a square shape with a length a and a width B, the first boundary range of the operation key B ' and the second boundary range of the operation key B ' can be obtained based on the length and the width of the operation key B and the coordinates of the center point of the operation key B ' having the same function as the operation key B in the first application. For another example, the shape of the operation key C in the second application is an ellipse, and the long radius is a and the short radius is b, and at this time, the first boundary range of the operation key C ' and the second boundary range of the operation key C ' can be obtained according to the long radius and the short radius of the operation key C and the coordinates of the center point of the operation key C ' having the same function as the operation key C in the first application.
In other embodiments, the method further comprises steps S24 to S26:
s24, the first application acquires the current coordinate of the second center point on the second screen;
s25, the first application detects whether the current coordinate is the same as the coordinate of the second central point recorded in the operation mapping table; if yes, go back to step S24; otherwise, go to step S26;
and S26, the first application updates the coordinate of the second central point recorded in the operation mapping table by using the current coordinate.
It is understood that the establishment of the operation mapping table may generally be configured based on the layout of the operation keys in the first application on the first screen, that is, the operation mapping table is obtained through the correspondence between the positions of the operation keys in the second application on the second screen and the positions of the operation keys in the first application on the first screen, and the configured operation mapping table is preset in the first application. Further, here, the updating of the operation mapping table may be further completed through the above steps S24 to S26, so that the first application can adjust the coordinates of the first center point recorded in the mapping entry as the position of the operation key in the second application changes, without updating the first application by means of version upgrade.
An embodiment of the present invention provides another operation mapping method, and fig. 4 is a schematic diagram illustrating an implementation flow of the another operation mapping method according to the embodiment of the present invention, as shown in fig. 4, the method includes steps S401 to S416:
s401, configuring an operation mapping table by a first application;
wherein the content of each mapping entry of the operation mapping table comprises: the coordinates of the first center point, the coordinates of the second center point, the first boundary range and the second boundary range; wherein,
the coordinate of the first central point is the coordinate of the central point of an operation key in the first application;
the coordinate of the second central point is the coordinate of the central point of the operation key in the second application; the function of the operation key in the first application is equal to that of the operation key in the second application;
the first boundary range and the second boundary range are used for jointly defining an operation area of an operation key in the first application.
S402, detecting whether the first application receives a touch operation; if yes, go to step S403; otherwise, returning to execute the step S402;
here, the first application is an application program that is running and displayed on a first screen of the terminal, for example, the first application is a game pad application.
S403, the first application acquires a first coordinate of the touch operation on a first screen;
s404, judging whether the abscissa of the first coordinate falls into a first boundary range of the current mapping entry by the first application; if yes, go to step S405; otherwise, go to step S407;
s405, judging whether the ordinate of the first coordinate falls into a second boundary range of the current mapping entry or not by the first application; if yes, go to step S406; otherwise, go to step S407;
s406, the first application determines that the first coordinate falls into an operation area defined by the current mapping item; then, the process proceeds to step S411;
here, it may be understood that, if the abscissa of the first coordinate falls within the first boundary range of the current mapping entry and the ordinate of the first coordinate falls within the second boundary range of the current mapping entry, it may be determined that the first coordinate falls within the operation region defined by the current mapping entry. If the abscissa of the first coordinate does not fall within the first boundary range of the current mapping entry, or the ordinate of the first coordinate does not fall within the second boundary range of the current mapping entry, it may be determined that the first coordinate does not fall within the operation region defined by the current mapping entry, at this time, it is necessary to continuously determine whether the first coordinate falls within the operation region defined by the next mapping entry, that is, step S407 and step S408 are performed. Similarly, if the abscissa of the first coordinate does not fall within the first boundary range of the next mapping entry, or the ordinate of the first coordinate does not fall within the second boundary range of the next mapping entry, it may be determined that the first coordinate does not fall within the operation region defined by the next mapping entry, and at this time, it is necessary to continuously determine whether the first coordinate falls within the operation region defined by the next mapping entry until the operation regions defined by all mapping entries are traversed. And if the abscissa of the first coordinate does not fall into the first boundary range of all the mapping entries or the ordinate of the first coordinate does not fall into the second boundary range of all the mapping entries, the first application ignores the operation event corresponding to the first coordinate.
S407, the first application judges whether the abscissa of the first coordinate falls into the first boundary range of the next mapping entry; if yes, go to step S408; otherwise, go to step S410;
s408, the first application judges whether the ordinate of the first coordinate falls into the second boundary range of the next mapping entry; if yes, go to step S409; otherwise, go to step S410;
s409, the first application determines that the first coordinate falls into an operation area defined by the next mapping item; then, the process proceeds to step S411;
s410, judging whether the first coordinate falls into an operation area defined by the next mapping item or not by the first application;
here, it can be understood that, when the first coordinate does not fall into the operation region defined by the next mapping entry, it is continuously determined whether the first coordinate falls into the operation region defined by the next mapping entry until the operation regions defined by all mapping entries are traversed. For example, the operation mapping table includes 3 mapping entries, if the first coordinate does not fall into the operation area defined by the first mapping entry, it is determined whether the first coordinate falls into the operation area defined by the second mapping entry, if not, it is continuously determined whether the first coordinate falls into the operation area defined by the third mapping entry, and if not, the operation event corresponding to the first coordinate is ignored.
S411, the first application establishes the association between the first coordinate and the mapping item to which the operation area belongs;
s412, the first application acquires the coordinates of the first central point and the coordinates of the second central point from the associated mapping items;
s413, the first application determines an offset of the coordinate of the first central point with respect to the coordinate of the second central point as the coordinate offset;
s414, the first application performs coordinate conversion on the first coordinate by using the coordinate offset to obtain a second coordinate;
s415, the first application transmits the second coordinate to a second application;
here, the second application is an application program that is running and displayed on a second screen of the terminal, for example, the second application is a game application.
And S416, the second application receives the second coordinate and responds to the operation event corresponding to the second coordinate.
Here, it can be understood that, when the second application responds to the operation event corresponding to the second coordinate, the operation mapping from the first application to the second application is completed, that is, the operation key is touched in the first application, and then the operation event corresponding to the touched operation key is responded in the second application.
With the popularization of large-screen smart phones, the mobile game industry is developed vigorously and increasingly becomes an industrial army of digital entertainment culture. Because the mobile game has the advantages of low game threshold and being capable of utilizing fragmentation time, the mobile game gradually surpasses the computer game and is integrated into the daily life of people.
From a leisure entertainment game with simple operation to an online battle game with complex operation and dependence on skills, for the game with complex operation, a difficult problem exists on a single-screen terminal, namely how to design key interaction with easy operation by reducing the shielding of a visual area as much as possible.
Taking a mobile phone game in a certain fighting mode as an example, basic operation keys of the game comprise the following functions: navigation, selection of hero skills, maps, selection of equipment, city recovery, summons and signaling, etc. As shown in fig. 5, it can be seen that in order to ensure that the operation keys 511 in the game 51 do not affect the visual experience of the user on the game, the existing layout of the operation keys is to design the operation keys at both ends and the bottom of the screen; compared with the design of the operating keys in the middle area of the screen, the existing layout design of the operating keys can lead a user to deviate from the center of gravity of the terminal when holding the terminal by a palm in the game playing process, and the bending degree of fingers is larger, so that the fingers of the user are more easily fatigued along with the increase of time in the game playing process of the user.
A certain mobile phone which is on the market is a foldable double-screen terminal, and the contents of the two screens can be mutually independent. When the product is applied to a game scene, the advantages of two screens can be utilized, wherein one screen displays game contents, and the other screen performs game operation, so that the effects that game vision and game operation are separated and do not influence each other are achieved.
To achieve the above effects, the following problems need to be solved: the game Application generally does not expose the internal program of the game Application Programming Interface (API), which is considered from the perspective of game security to circumvent plug-ins; this means that it is impossible for the third party to get through the game operation channel between different screens by calling the application program of the game API, that is, because the third party cannot obtain the program code of the game application, it is impossible to design the operation keys in the game application on another screen by rewriting the program code of the game application. What the third party can do is to map the touch operation received on the other screen to the corresponding operation key in the game application for response.
In a certain marketed version of the mobile phone, a 1: a mapping scheme, which is implemented by running a game application (i.e. the second application described in the above embodiment) on the B screen (i.e. the second screen described in the above embodiment), and simultaneously starting a specific game pad application (i.e. the first application described in the above embodiment) on the a screen (i.e. the first screen described in the above embodiment), wherein the operation layout of the game pad application and the game operation layout are completely consistent.
In the implementation of the existing scheme, through the operation transparent transmission of the software layer, the operation event corresponding to the coordinate (x, y) on the screen a of the touch operation received by the gamepad application (i.e. the first coordinate in the above embodiment) can be synchronously transmitted to the position (x, y) on the screen B, so that the effects of the input operation of the screen a and the response of the screen B are achieved.
The problem existing in the existing scheme is obvious, namely, the operation layout of the A screen is required to be completely consistent with the operation layout in the B screen game, which means that the whole screen content of the A screen cannot be fully utilized, the operation layout of the game handle application on the A screen is freely designed from the angle of operation experience, the fatigue caused by the fact that a terminal deviates from the center of gravity in the process of holding the terminal by a user cannot be solved, and better game operation experience cannot be provided for the user.
Based on this, in the embodiment of the present invention, on the basis of the software architecture of the existing dual/multi-screen terminal, the problem existing in the existing solution is solved by introducing the operation mapping conversion unit, and fig. 6 is a system architecture diagram of the operation mapping conversion unit according to the embodiment of the present invention, as shown in fig. 6, the system architecture 60 includes: the screen hardware 61, the driver layer 62, the framework layer 63, the operation channel module 64, the target operation application 65 and the operation input application 66, wherein the driver layer 62 comprises an input capture module 621 and an input conversion module 622, and the operation input application 66 comprises an operation identification module 661 and an operation conversion module 662; wherein,
screen hardware 61, a hardware unit for receiving user input operations, namely, the first screen and the second screen described in the above embodiment; the screen hardware 61 is a hardware unit corresponding to the operation input application 66;
an input capturing module 62, configured to determine whether an input operation received on the screen hardware 61 belongs to an operation event, and if the input operation belongs to the operation event, pass an operation coordinate (i.e., the first coordinate) corresponding to the input operation of the user to the input converting module 622;
an input conversion module 622, which is responsible for transmitting the operation coordinates transmitted from the input capture module 62 to the operation input application 66 on the one hand, and receiving the converted coordinates (i.e. the second coordinates) processed by the operation conversion module 662 from the operation input application 66 from the operation channel module 64 on the other hand, and generating a simulated operation event using the converted coordinates, and transmitting the simulated operation event to the target operation application 65 through the framework layer 63;
an operation channel module 64, serving as an operation transmission channel between the driver layer 62 and the operation input application 66, bypassing the framework layer 63 to reduce delay, on one hand, configured to transmit an input operation received by the screen hardware 61 corresponding to the operation input application 66, and transmit an operation coordinate (i.e., the first coordinate) corresponding to the input operation to the operation identification module 661; on the other hand, the conversion coordinates output after the operation conversion module 662 performs the operation coordinate conversion processing are transmitted to the input conversion module 622 of the driver layer 62;
an operation identification module 661, configured to receive the operation coordinate from the operation channel module 64, determine an area corresponding to the operation coordinate according to the operation mapping table 664, establish a correlation when the operation coordinate falls into a certain operation area recorded in the operation mapping table 664, and ignore an operation event corresponding to the operation coordinate when the operation coordinate does not fall into any operation area in the operation mapping table;
optionally, the operation recognizing module 661 may transmit the received operation coordinates to the user interaction module 663 for feedback of operation response;
an operation conversion module 662, configured to query, according to the operation area associated with the operation identification module 661, an offset corresponding to the area, perform conversion processing on the operation coordinate to obtain a conversion coordinate (i.e., the second coordinate), and transmit the conversion coordinate to the input conversion module 622 through the operation channel module 64;
the target operation application 65 is the second application described in the above embodiment, and the application 65 is an application program that is being executed by the terminal and is displayed on the operation response screen (i.e., the second screen described in the above embodiment). The application 65 serves as a scheme effect presentation unit of the present invention, and the application 65 is application content actually controlled by the operation input application 66, and may be a game or other application; after receiving the simulation operation event transmitted by the input conversion module 622, the application content processing module is responsible for processing the application content and providing operation feedback to the user, that is, the simulation operation event is responded;
an operation input application 66, which is the first application described in the above embodiment, where the application 66 is running on the terminal and is displayed on an operation input screen (i.e., the first screen described in the above embodiment) for receiving an input operation from a user (e.g., a touch operation of the user); the operation elements (i.e., the operation keys) of the layout thereof can be defined based on the target operation application, but the layout of the operation elements on the first screen can be freely designed.
Here, it should be noted that, for a terminal having at least two screens, at least one screen is a screen on which a user directly inputs an operation, referred to as an operation input screen (e.g., the a screen in the previous example), and at least one screen is a target of actual control of the operation, referred to as an operation response screen (e.g., the B screen in the previous example). The operation input screen and the operation response screen are not fixed and can be switched with each other before, that is, the operation response screen also has the function of the operation input screen, and the operation input screen also has the function of the operation response screen.
In practical engineering applications, as shown in fig. 7, the implementation flow of the operation mapping method provided in the embodiment of the present invention in the application layer mainly includes steps S71 to S73:
s71, designing the layout of the operation keys in the operation input application on the operation input screen according to the operation content in the target operation application;
here, the layout of the operation keys on the operation input panel means the distribution of the positions of the operation keys on the operation input panel.
S72, configuring an operation mapping table according to the designed layout;
and S73, writing the operation mapping table into the operation input application.
Thus, the operation input application can implement the operation mapping method provided by the embodiment of the invention.
Here, it should be noted that the embodiment of the present invention defines the operation mapping table shown in table 1 below, and as can be seen from table 1, the content of each mapping entry of the table includes: number, original center point coordinate, new center point coordinate, shape, boundary value and offset; wherein,
numbering: distinguishing marks for different operation areas;
original center point coordinates: the coordinate of the center point corresponding to the original operation area button N on the B screen (namely the operation response screen);
table 1 operation mapping table
| Numbering
|
Original center point
|
New central point
|
Shape of
|
Boundary value
|
Offset amount
|
| 1
|
(x1,y1)
|
(x1',y1')
|
Circular shape
|
(x11,y11)
|
(Δx1,Δy1)
|
| 2
|
(x2,y2)
|
(x2',y2')
|
Square shape
|
(x21,y21)
|
(Δx2,Δy2)
|
| 3
|
(x3,y3)
|
(x3',y3')
|
Oval shape
|
(x31,y31)
|
(Δx3,Δy3)
|
| ···
|
···
|
···
|
···
|
···
|
··· |
Here, it should be noted that the original center point coordinate is the coordinate of the second center point in the foregoing embodiment, and the original operation area button is the operation key in the second application in the foregoing embodiment.
New center point coordinates: in order to define the coordinates of the center point of the button on the operation area button n' on the a screen (i.e., the operation input screen) according to the new design layout, here, the operation requirement on the button on the a screen is equivalent to the operation on the button on the B screen;
here, it should be noted that the new center point coordinate is the coordinate of the first center point in the foregoing embodiment, and the operation area button n' is the operation key in the first application in the foregoing embodiment.
Boundary value: the boundary values of the operation areas with different shapes have different meanings, such as a circular operation area, and the boundary values are defined as radiuses; a square operating region, the boundary values being defined as length and width; and in the elliptical operation area, the boundary values are the elliptical short radius and the elliptical long radius. Common key shapes can be defined in a similar geometric description.
Shape: defining the geometric shape of the operation area ButtonN ', so that the operation area of the ButtonN' can be defined by combining the coordinates of the new center point and the boundary values;
here, it can be understood that the range of the abscissa (i.e., the first boundary range in the above embodiment) and the range of the ordinate (i.e., the second boundary range in the above embodiment) of the operation region of butteron n' can be calculated by the new center point coordinates and the new boundary values. Therefore, in order to simplify the implementation steps of the operation mapping method, the calculated first boundary range and the second boundary range may be directly configured in the operation mapping table.
Coordinate offset amount: the offset vector of the new center point relative to the original center point.
Here, it should be noted that the coordinate offset amount is the coordinate offset amount described in the above embodiment. The coordinate offset may be directly configured in the operation mapping table, and of course, the parameter may not be recorded in the operation mapping table, and at this time, the coordinate offset may be directly calculated according to the coordinate of the new central point and the coordinate of the original central point, that is, the offset of the coordinate of the new central point relative to the coordinate of the original central point is determined as the coordinate offset;
here, for convenience of understanding of the above coordinate offset concept, for example, it is assumed that the coordinate systems of the two screens are as shown in fig. 3, the circular Button1 (i.e., the operation key 321) is located on the B screen (i.e., the second screen 32), the coordinate of the center point B of the circular Button1 is (x1, y1) (referred to as the original center point, the same below), the Button1 corresponds to the circular Button1 '(i.e., the operation key 311) newly designed in the layout on the a screen (i.e., the first screen 31), and the coordinate of the center point a of the circular Button1' is (x1', y1') (referred to as the new center point, the same below); then the operation on the Button1' on the a-screen needs to be passed through a mapping process to the B-screen, thereby implementing the synchronous equivalent operation on the original Button 1.
The relationship between the new center point and the original center point can be expressed by the following equation (2):
in the formula, Δ x1 and Δ y1 represent offset vectors of (x1, y1) to (x1', y1'), respectively;
as can be seen from the mapping relationship shown in the above equation (2), the single-point operation can be realized by coordinate conversion theoretically, but in actual operation, the single-point operation needs to be determined by a specific operation area before coordinate conversion can be performed.
It is understood that the establishment of the operation mapping table may be generally configured based on the layout design of the operation input screen, that is, the operation mapping table is obtained by the layout of the operation response screen and the layout of the operation input screen, and then is preset in the operation input application.
Furthermore, the updating of the operation mapping table can be completed by arranging a method for automatically capturing the layout on the operation response screen; in this way, the operation application running on the operation input screen is more flexible, and can be adjusted along with the change of the operated content on the operation response screen or the change of the layout of the operated content, without updating the operation input application in a version upgrading mode.
It should be noted that, for clarity, fig. 3 illustrates the definition of one coordinate system, but the present invention is not dependent on the definition of the coordinate system, and actually, the definition of different coordinate systems can be converted based on the principle of the present invention through simple mathematical knowledge. Thus, different screen coordinate definitions are also within the scope of the present invention.
In the embodiment of the invention, the method for operating free mapping between the screens is provided for the double/multi-screen terminal, the application scenes of the double/multi-screen terminal can be enriched by utilizing the method, and the practical value of the double/multi-screen terminal is improved. In addition, it should be noted that the technical starting point and the scheme effect of the embodiment of the present invention can be applied to a game scene, but are not limited to the game scene, and actually, the embodiment of the present invention provides a free mapping scheme for dual/multi-screen operation.
Based on the foregoing embodiments, an embodiment of the present invention provides an operation mapping apparatus, where the apparatus includes modules and units included in the modules, and may be implemented by a processor in a computer device; of course, the implementation can also be realized through a specific logic circuit; in implementation, the processor may be a Central Processing Unit (CPU), a Microprocessor (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like.
Fig. 8 is a schematic diagram of a structure of an operation mapping apparatus according to an embodiment of the present invention, and as shown in fig. 8, the apparatus 80 includes: an operation detection module 81, a coordinate conversion module 82, and a coordinate transfer module 83; wherein,
the operation detection module 81 is configured to acquire a first coordinate of a touch operation on a first screen when the first application receives the touch operation; the first application is an application program which is running and displayed on a first screen of the terminal;
here, it should be noted that the operation detection module 81 can implement the functions of the flat-mode hardware and the input capture module 62 described in the above embodiments.
The coordinate conversion module 82 is configured to convert the first coordinate according to a preconfigured operation mapping table to obtain a second coordinate;
here, it should be noted that the coordinate conversion module 82 may implement the functions of the operation identifying module 661 and the operation converting module 662 described in the above embodiments.
The coordinate transferring module 83 configured to transfer the second coordinate to a second application; wherein the second application is an application program which is running and displayed on a second screen of the terminal.
Here, it should be noted that the coordinate transfer module 83 may implement the functions of the operation channel module 64, the input conversion module 622, and the framework layer 63 described in the above embodiments.
In other embodiments, the coordinate conversion module 82 includes an area detection unit 821, an offset acquisition unit 822, and a coordinate conversion unit 823; wherein,
the region detecting unit 821 configured to determine whether the first coordinate falls into an operation region defined by the operation mapping table according to the operation mapping table;
here, it should be noted that the area detection unit 821 may implement the function of the operation identifying module 661 described in the above embodiment.
The offset obtaining unit 822 is configured to obtain a coordinate offset corresponding to the operation area from the operation mapping table if the first coordinate falls into the operation area defined by the operation mapping table;
the coordinate conversion unit 823 is configured to perform coordinate conversion on the first coordinate by using the coordinate offset to obtain a second coordinate.
Here, it is to be noted that the offset amount acquisition unit 822 and the coordinate conversion unit 823 may collectively implement the function of the operation conversion module 662 described in the above-described embodiment.
In other embodiments, the apparatus 80 further comprises a mapping table configuring module 84, and the mapping table configuring module 84 may be configured to configure the operation mapping table;
wherein the content of each mapping entry of the operation mapping table comprises: the coordinates of the first center point, the coordinates of the second center point, the first boundary range and the second boundary range; wherein,
the coordinate of the first central point is the coordinate of the central point of an operation key in the first application;
the coordinate of the second central point is the coordinate of the central point of the operation key in the second application; the function of the operation key in the first application is equal to that of the operation key in the second application;
the first boundary range and the second boundary range are used for jointly defining an operation area of an operation key in the first application.
In other embodiments, the region detection unit 821 includes:
the coordinate judging subunit is configured to judge whether the abscissa of the first coordinate falls into a first boundary range of a current mapping entry, and judge whether the ordinate of the first coordinate falls into a second boundary range of the current mapping entry;
and the area determining subunit is configured to determine that the first coordinate falls into the operation area defined by the current mapping item if the abscissa of the first coordinate falls into the first boundary range of the current mapping item and the ordinate of the first coordinate falls into the second boundary range of the current mapping item.
In other embodiments of the present invention, the substrate may be,
the coordinate judging subunit may be further configured to judge whether the first coordinate falls into an operation area defined by a next mapping entry if the abscissa of the first coordinate does not fall into the first boundary range of the current mapping entry or the ordinate of the first coordinate does not fall into the second boundary range of the current mapping entry;
the area determination subunit may be further configured to determine that the first coordinate falls within the operation area defined by the next mapping entry if the abscissa of the first coordinate falls within the first boundary range of the next mapping entry and the ordinate of the first coordinate falls within the second boundary range of the next mapping entry;
the coordinate determination subunit may be further configured to determine whether the first coordinate falls within an operation area defined by a next mapping entry if the abscissa of the first coordinate does not fall within the first boundary range of the next mapping entry or the ordinate of the first coordinate does not fall within the second boundary range of the next mapping entry.
In other embodiments, the offset obtaining unit 822 includes:
the area association subunit is configured to establish association between the first coordinate and a mapping entry to which the operation area belongs if the first coordinate falls into the operation area defined by the operation mapping table;
the coordinate query subunit is configured to acquire the coordinates of the first central point and the coordinates of the second central point from the associated mapping entries;
an offset determining subunit configured to determine an offset of the coordinates of the first center point with respect to the coordinates of the second center point as the coordinate offset.
In other embodiments, the apparatus 80 further includes a mapping table updating module 85, and the mapping table updating module 85 includes: a coordinate acquisition unit 851, a coordinate determination unit 852, and a mapping table updating unit 853; wherein,
the coordinate acquiring unit 851 is configured to acquire the current coordinate of the second center point on the second screen;
the coordinate judging unit 852 is configured to detect whether the current coordinate is the same as a coordinate of a second central point recorded in the operation mapping table;
the mapping table updating unit 853 is configured to update the coordinate of the second center point recorded in the operation mapping table by using the current coordinate if the current coordinate is not the same as the coordinate of the second center point recorded in the operation mapping table.
In other embodiments, the apparatus 80 further includes a coordinate response module 86, and the coordinate response module 86 is configured to control the second application to respond to the operation event corresponding to the second coordinate.
Here, it should be noted that: the above description of the apparatus embodiments, similar to the above description of the method embodiments, has similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the apparatus according to the invention, reference is made to the description of the embodiments of the method according to the invention for understanding.
In the embodiment of the present invention, if the operation mapping method is implemented in the form of a software functional module and is sold or used as an independent product, the operation mapping method may also be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computing device to execute all or part of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
Correspondingly, an embodiment of the present invention provides a terminal, fig. 9 is a schematic structural diagram of a terminal according to an embodiment of the present invention, and as shown in fig. 9, the terminal 90 includes a processor 91 and a storage medium 92 configured to store executable instructions, where:
the processor 91 is configured to execute stored executable instructions configured to perform the steps in the operation mapping method provided by the above-described embodiments.
In implementation, the terminal 90 may be a mobile terminal having at least two screens, for example, a dual-screen mobile phone or a dual-screen tablet computer.
Correspondingly, the embodiment of the present invention provides a readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps in the above-mentioned operation mapping method.
Here, it should be noted that: the above description of the storage medium and device embodiments is similar to the description of the method embodiments above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the storage medium and the apparatus according to the invention, reference is made to the description of the embodiments of the method according to the invention.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.