Adjustment method and apparatus for virtual key, and electronic device and storage medium
By adjusting the layout of virtual keys in the screen projection device, the problem of virtual keys being misoperated on the large screen is solved, improving user experience and operation accuracy.
Patent Information
- Application Number
- PCT/CN2024/075447
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-01
- Filing Date
- 2024-02-02
- Publication Date
- 2024-12-05
AI Technical Summary
In screen projection games, since the layout design of virtual buttons is based on small screens, it is prone to misoperation and ineffectiveness when used on large screens, affecting the user experience.
The terminal device provides a graphical user interface, responds to screen projection instructions, determines the target key layout associated with the user, and adjusts the initial virtual key in the preset screen projection device to adapt to the usage habits of different users.
It improves the user's control accuracy and gaming experience during blind operation, simplifies the adjustment process of virtual buttons, and adapts to the personalized needs of different users.
Smart Images

Figure CN2024075447_05122024_PF_FP_ABST
Abstract
Description
Virtual key adjustment method and device, electronic device, and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This disclosure claims priority to Chinese patent application number 202310644576.0, filed on June 1, 2023, entitled “Method and device for adjusting virtual keys, electronic device, and storage medium,” and the entire contents of this Chinese patent application are incorporated herein by reference. Technical Field
[0003] The present disclosure relates to the field of computer technology, and in particular to a method and device for adjusting virtual keys, an electronic device, and a storage medium. Background Art
[0004] Screen projection technology refers to the process of a smart mobile device client displaying the local screen image and sound on another display device via wired or wireless means, thereby achieving same-screen display.
[0005] In related technologies, screen projection technology can be used to project the screen of a game running on a first device to a second device with a larger screen for display. Users observe the game through the large screen of the second device, which can improve the user's gaming experience to a certain extent.
[0006] However, because the virtual buttons used to control games on the first device are arranged based on the small screen size—that is, based on operations performed when the user is focused on the small screen—the hotspot of the virtual buttons is small and relatively concentrated. When the game screen is projected onto the second device with a larger screen, the user's focus shifts to the screen of the second device. Controlling the game using the virtual buttons on the first device is prone to misoperation and ineffectiveness, resulting in a poor user experience.
[0007] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute prior art known to ordinary technicians in the field.
[0008] Summary of the Invention
[0009] In view of the above problems, the present disclosure provides a virtual key adjustment method and device, electronic device, and storage medium, so that when the game is projected and displayed, the initial virtual keys displayed on the original terminal device can be automatically adjusted according to the corresponding target key layout.
[0010] According to one aspect of the present disclosure, a method for adjusting virtual keys is provided, wherein a graphical user interface is provided through a terminal device, and the content displayed by the graphical user interface includes at least a game screen and multiple initial virtual keys. The method includes: determining a target key layout associated with the user in response to a screen projection instruction; displaying the game screen in a preset screen projection device, and adjusting the initial virtual keys according to the target key layout.
[0011] According to one aspect of the present disclosure, a virtual key adjustment device is also provided, which provides a graphical user interface through a terminal device, and the content displayed by the graphical user interface includes at least a game screen and multiple initial virtual keys. The device includes: a key layout determination module, which is used to determine the target key layout associated with the user in response to a screen projection instruction; a virtual key adjustment module, which is used to display the game screen in a preset screen projection device and adjust the initial virtual keys according to the target key layout.
[0012] According to one aspect of the present disclosure, an electronic device is also provided, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the virtual key adjustment method as described above is implemented.
[0013] According to one aspect of the present disclosure, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the method for adjusting the virtual key as described above is implemented.
[0014] In the embodiments of the present disclosure, it is achieved that when the game is projected and displayed, the initial virtual keys displayed by the terminal device can be automatically adjusted according to the corresponding target key layout to adapt to the usage habits of different users, thereby ensuring the accuracy of the user's control of the game during blind operation and improving the user's usage experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] FIG1 is a flowchart of a method for adjusting a virtual key according to an embodiment of the present disclosure;
[0016] FIG2 is a partial schematic diagram of a setting page in an example of the present disclosure;
[0017] FIG3 is a schematic diagram of an interface change for determining a preset position of a virtual key in an example of the present disclosure;
[0018] FIG4 is a schematic diagram of a target key layout in an example of the present disclosure;
[0019] FIG5 is a schematic diagram of a target key layout in another example of the present disclosure;
[0020] FIG6 is a schematic diagram of an interface change for determining a preset position of a first virtual key in an example of the present disclosure;
[0021] FIG7 is a schematic diagram of an interface change for determining a preset position of a current virtual key in an example of the present disclosure;
[0022] FIG8 is a schematic diagram of an interface change for determining a preset position of a current virtual key in another example of the present disclosure;
[0023] FIG9 is a flowchart of the steps of updating the target button layout according to an embodiment of the present disclosure;
[0024] FIG10 is a partial schematic diagram of a setting page according to an embodiment of the present disclosure;
[0025] FIG11 is a schematic diagram of a virtual key adjustment process according to an embodiment of the present disclosure;
[0026] FIG12 is a schematic diagram of another virtual key adjustment process according to an embodiment of the present disclosure;
[0027] FIG13 is a schematic diagram of another virtual key adjustment process according to an embodiment of the present disclosure;
[0028] FIG14 is a schematic diagram of a pop-up dialog box according to an embodiment of the present disclosure;
[0029] FIG15 is a structural block diagram of a device for adjusting a virtual key according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] To make the above-mentioned purposes, features, and advantages of the present disclosure more clearly understood, the present disclosure is further described in detail below with reference to the accompanying drawings and specific embodiments. It is apparent that the embodiments described are only a portion of the embodiments of the present disclosure, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present disclosure without inventive effort are also within the scope of protection of the present disclosure.
[0031] The main buttons in relevant mobile games are generally arranged based on the user's focus on small screens. The buttons are small and generally concentrated in the lower left and right corners. When the game is projected, the user's main focus shifts to the projection device, making it difficult to control the buttons. This can easily lead to incorrect operations and ineffective operation, resulting in a poor user experience.
[0032] To address the shortcomings of related technologies, the inventors came up with the idea of creating a separate key layout for screen projection that expands the hot zone of the keys (i.e., expands the keys) to reduce misoperations and ineffectiveness to a certain extent. However, due to the differences in hand shape, finger length, and usage habits, a unified key layout is difficult to meet the personalized needs of users.
[0033] In view of this, the embodiment of the present disclosure provides a method for adjusting virtual keys, which associates users with their corresponding target key layouts according to the usage habits of different users. When a screen projection command is received, the game screen is displayed in a preset screen projection device, and the initial virtual keys displayed on the terminal device are adjusted according to the target key layout; when the game is projected, the initial virtual keys originally displayed on the terminal device can be automatically adjusted according to the corresponding target key layout to adapt to the usage habits of different users, so that users can perform blind operations when projecting the game, and ensure the accuracy of users controlling the game during blind operation, thereby improving the user experience.
[0034] The virtual key adjustment method provided by the embodiments of the present disclosure can be run on a local terminal device or a server. When the virtual key adjustment method is run on the server, the virtual key adjustment method can be implemented and executed based on a cloud interaction system, wherein the cloud interaction system includes a server and a client device.
[0035] In an optional embodiment, various cloud applications can be run under the cloud interaction system, such as cloud games. Taking cloud games as an example, cloud games refer to a gaming method based on cloud computing. In the cloud game operation mode, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the virtual key adjustment method are completed on the cloud game server. The client device is used to receive and send data and present the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a first terminal device, a TV, a computer, a handheld computer, etc.; however, the virtual key adjustment method is performed by the cloud game server in the cloud. When playing the game, the player operates the client device to send operation instructions to the cloud game server. The cloud game server runs the game according to the operation instructions, encodes and compresses the data including the game screen of the virtual keys, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.
[0036] In an optional embodiment, taking a game as an example, a local terminal device stores a game program and is used to present the game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, conventionally downloading and installing the game program through an electronic device and running it. The local terminal device can provide the graphical user interface to the player in a variety of ways, for example, it can be rendered and displayed on the terminal's display screen, or provided to the player through holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present the graphical user interface, the graphical user interface includes the game screen, and the processor is used to run the game, generate the graphical user interface, and control the display of the graphical user interface on the display screen.
[0037] Referring to Figure 1, a flowchart of a method for adjusting virtual keys according to an embodiment of the present disclosure is shown. The method may be performed by the aforementioned terminal device or server. By running an application, a graphical user interface may be displayed on the terminal device. The content displayed in the graphical user interface includes at least a game screen and a plurality of initial virtual keys. The method may include the following steps:
[0038] Step 101: In response to a screen projection instruction, determine a target button layout associated with the user.
[0039] The screen projection instruction is used to instruct the game screen displayed in the graphical user interface of the terminal device to be displayed on the preset screen projection device. The button layout refers to the distribution method of the buttons in the graphical user interface, including the position of the buttons in the graphical user interface, and the relative position relationship between the buttons, wherein the position of the buttons refers to the place occupied by the buttons in the graphical user interface, including orientation, size and shape. The target button layout can be set by the user associated with it and stored in the terminal device or server. The user can be considered as the user of the terminal device. Generally, the user of the terminal device can be determined by the identification of the terminal device or the game account logged in by the terminal device.
[0040] In response to the screen projection instruction, a pre-stored target button layout associated with the user can be obtained; for example, based on the game account logged in by the terminal device, the button layout associated with the game account can be obtained from the terminal device or server, that is, the target button layout associated with the user.
[0041] Alternatively, in response to the screen projection instruction, the user may be guided to set a target key layout associated therewith to determine the target key layout. For example, a key adjustment interface may be displayed in a graphical user interface to prompt the user to set the key position, and then the target key layout associated with the user is determined based on the key position set by the user.
[0042] Step 102: Display the game screen on the preset projection device and adjust the initial virtual buttons according to the target button layout.
[0043] The preset projection device can be a device that communicates with the terminal device via a wired or wireless method. The number of preset projection devices can be one or more, and this disclosure does not limit this. For example, the projection device can be a smart TV, a tablet computer, a laptop computer, a car computer, a projector, etc.
[0044] After receiving the screen projection command, the game screen displayed in the graphical user interface of the terminal device is sent to the preset screen projection device for display, and the initial virtual keys displayed in the graphical user interface of the terminal device are adjusted according to the target key layout to expand the hot zone of at least one initial virtual key, thereby improving the accuracy of the user when performing blind operations according to personal habits, thereby improving the user's gaming experience.
[0045] Next, the method for adjusting the virtual keys in this exemplary embodiment will be further described.
[0046] The game screen may include virtual objects controlled by a terminal device, with virtual buttons configured to trigger and control virtual objects to execute preset game behaviors. The virtual objects may include, but are not limited to, living, interactive virtual objects such as virtual characters, virtual pets, and virtual monsters. Depending on the actual application scenario, they may also include inanimate, interactive virtual objects such as virtual footballs and virtual equipment. The game screen may also include other virtual scenes such as virtual houses, virtual hills, virtual rivers, and virtual trees. Optionally, the game screen may also include a mini-map, the level of the virtual objects, the number of matches played, and so on.
[0047] In step 101, in response to a screen projection instruction, a target key layout associated with the user is determined.
[0048] When the terminal device successfully communicates with the preset screen projection device, a preset screen projection control can be displayed on the terminal device, which is used to instruct the game screen to be displayed on the preset screen projection device. Based on the touch screen of the terminal device, the user can act on the preset screen projection control by clicking, sliding, dragging, long pressing, etc. to generate a screen projection instruction. Of course, the screen projection instruction can also be generated according to the shortcut screen projection key configured on the terminal device. As shown in Figure 2, the screen projection auxiliary switch control can be set in the settings page of the application. When the screen projection auxiliary switch control is in the on state, the screen projection instruction is generated; when the screen projection auxiliary switch control is in the off state, the screen projection instruction is not generated.
[0049] The target button layout can be set by the user associated with it and stored in the corresponding storage space of the terminal device or server. When the user triggers the preset screen casting control or the quick screen casting key to generate the screen casting command, the target button layout associated with the user can be determined.
[0050] Optionally, in response to the screen projection instruction, while determining the target button layout associated with the user, the content displayed on the terminal device display screen can also be synchronized to the preset screen projection device. It is understood that before the game screen of the terminal device is displayed on the preset screen projection device, the screen content of the terminal device can also be synchronously displayed on the preset screen projection device.
[0051] In some optional embodiments of the present disclosure, determining the target key layout associated with the user may include:
[0052] When the key adjustment interface is displayed on the graphical user interface, determining the target position of each virtual key in response to the setting operation of the virtual key;
[0053] A target key layout associated with the user is determined according to the target positions of the respective virtual keys.
[0054] This embodiment can respond to the screen projection instruction and display a button adjustment interface on the graphical user interface. The shape and size of the button adjustment interface can be completely consistent with the graphical user interface to prompt the user to set the positions of each virtual button when the game is projected according to his or her own habits, and obtain a target button layout that suits his or her habits. The target button layout obtained at this time is the target button layout associated with the user.
[0055] Optionally, in some optional embodiments of the present disclosure, when the key adjustment interface is displayed on the graphical user interface, determining the target position of each virtual key in response to the setting operation of the virtual key may include:
[0056] When the screen projection command is the first screen projection command, the button adjustment interface is displayed on the graphical user interface;
[0057] When the key adjustment interface is displayed on the graphical user interface, determining the target position of each virtual key in response to the setting operation of the virtual key;
[0058] Accordingly, after determining the target key layout associated with the user according to the target positions of the virtual keys, the following steps may also be performed:
[0059] Store the target button layout in the preset storage space.
[0060] In this embodiment, when responding to a screen casting instruction, it can be determined whether the screen casting instruction is the first screen casting instruction. If so, it means that the user is casting a game screen for the first time. Then, a key adjustment interface can be displayed on the graphical user interface to prompt the user to set the positions of each virtual key when casting the game screen according to their own habits, thereby obtaining a target key layout that conforms to their habits, that is, obtaining a target key layout associated with the user. After obtaining the target key layout associated with the user, the target key layout can also be stored in a preset storage space.
[0061] Accordingly, when the screen projection instruction is not the first screen projection instruction, the target key layout associated with the user is obtained from the preset storage space.
[0062] When the screen projection command is not the first screen projection command, it means that this is not the first time the user is casting the game screen, and it also means that the user has previously set the key layout for game casting. At this time, the target key layout associated with the user can be obtained from the preset storage space.
[0063] In one example, a preset storage space may be provided on a terminal device to store the latest target button layout on the terminal device, so that when a screen projection instruction is subsequently responded to again, the target button layout may be obtained from the preset storage space.
[0064] In another example, the preset storage space can be on a terminal device or on a server, and is used to store multiple button layouts. When storing a target button layout in the preset storage space, it is necessary to store the target button layout in association with its associated user. For example, the target button layout is stored in association with the user's game account, so that when a screen projection instruction is subsequently responded to again, the target button layout associated with the user can be obtained from the preset storage space according to the corresponding user's game account.
[0065] In this embodiment, the user only needs to set and save the button layout when projecting the screen for the first time. When projecting the screen subsequently, the target button layout can be directly obtained from the saved button layout, thereby improving the convenience of game projection.
[0066] Of course, if the screen projection instruction is not the first screen projection instruction, but the target key layout associated with the user cannot be obtained from the preset storage space due to storage space cleaning, network connection failure, etc., or the target key layout associated with the user cannot be obtained from the preset storage space, it can be processed in the same way as the first screen projection instruction, that is, when the graphical user interface displays the key adjustment interface, the target position of each virtual key is determined in response to the setting operation of the virtual key; the target key layout associated with the user is determined according to the target position of each virtual key.
[0067] Furthermore, in some optional embodiments of the present disclosure, when the key adjustment interface is displayed on the graphical user interface, determining the target position of each virtual key in response to the setting operation of the virtual key may include:
[0068] When the button adjustment interface is displayed on the graphical user interface, corresponding setting prompt information is displayed in sequence according to the preset setting order of multiple virtual buttons;
[0069] In response to a triggering operation for setting the prompt information, determining a preset position of the corresponding virtual key;
[0070] If the virtual keys do not conflict with each other at the corresponding preset positions, the preset positions of the virtual keys are determined as the target positions of the virtual keys.
[0071] In this embodiment, each virtual key has a corresponding preset hot zone, that is, each virtual key has a preset shape and a preset size, wherein the preset hot zone of at least some virtual keys is larger than the initial hot zone, and the initial hot zone refers to the hot zone of the virtual keys displayed on the graphical user interface before responding to the screen projection instruction. Since the virtual keys in the terminal device do not need to be considered to block the game screen after the game is projected, the hot zones of some or all virtual keys can be expanded accordingly after the game is projected. The game developer can configure the preset setting order of multiple virtual keys from high to low according to the priority set by the game, or the user can configure the preset setting order of multiple virtual keys by himself.
[0072] This embodiment can display corresponding setting prompt information in sequence according to the preset setting order of multiple virtual keys. The setting prompt information can be displayed on the display screen of the terminal device or on the display screen of the preset projection device to prompt the user to set the position of the virtual key corresponding to the current setting prompt information.
[0073] As shown in Figure 3, the setting prompt message "Please click on the screen to determine the hot zone of button A" is displayed on the button adjustment interface. After receiving the setting prompt message, the user can perform a trigger operation on the touch screen of the terminal device to determine the preset position of the corresponding virtual button. Continuing to refer to Figure 3, the contact point between the user's finger (indicated by the arrow) and the screen (the solid point in Figure 3) is used as the button center of button A (also called the preset button center of button A), combined with the preset hot zone of button A (the quadrilateral in Figure 3), the preset position of button A can be determined.
[0074] After all setup prompts have been displayed and the preset positions of the virtual keys corresponding to all setup prompts have been determined, it is possible to determine whether the virtual keys conflict at their corresponding preset positions, i.e., whether there is hot zone overlap at their corresponding preset positions. If not, the preset positions of the virtual keys can be determined as their corresponding target positions, and the target key layout can be determined. As shown in Figure 4, if multiple virtual keys (A, B, and C) do not conflict at their corresponding preset positions, the current preset positions of the virtual keys are determined as the target positions to obtain the target key layout.
[0075] Correspondingly, if there are at least two virtual keys conflicting at corresponding preset positions, each conflicting virtual key is cut to separate the conflicting virtual keys, so as to obtain the target position of the conflicting virtual key.
[0076] When there are conflicting virtual keys, the conflicting virtual keys can be obtained and separated by cutting to resolve the conflicts. After all conflicts are resolved, the target positions of the virtual keys are determined based on the final positions of the virtual keys.
[0077] The cutting method may include cutting according to the overlapping area between the conflicting virtual keys, cutting according to the perpendicular median of the line connecting the preset operation centers of the conflicting keys, etc.
[0078] It should be noted that, in other embodiments, for conflicting virtual keys, the conflict may also be resolved by reducing the key hot zone, that is, by reducing the conflicting virtual keys.
[0079] Optionally, the above-mentioned cutting of the conflicting virtual keys to separate the conflicting virtual keys may include:
[0080] determining a first connection line between the two conflicting virtual keys according to preset key centers of the two conflicting virtual keys;
[0081] The two conflicting virtual keys are cut according to the perpendicular median of the first connection line to separate the two conflicting virtual keys.
[0082] In this embodiment, the preset key centers of two conflicting virtual keys are connected to obtain a first connecting line between the two conflicting virtual keys. The two conflicting virtual keys are then cut along the perpendicular median of the first connecting line to separate the two conflicting virtual keys and resolve the conflict. The preset key center of a virtual key can be determined based on a trigger operation performed by a user in response to a setting prompt for the virtual key, with the contact point of the trigger operation with the touch screen of the terminal device serving as the preset key center of the corresponding virtual key.
[0083] Optionally, the above-mentioned cutting of the conflicting virtual keys to separate the conflicting virtual keys may include:
[0084] Determining the preset key center of each conflicting virtual key;
[0085] determining a first connection line between the two conflicting virtual keys according to preset key centers of the two conflicting virtual keys;
[0086] translating the perpendicular bisector of the first connecting line toward the preset key center direction of the first conflicting virtual key of the two conflicting virtual keys by a first preset distance to obtain a first parallel line;
[0087] translating the perpendicular midline of the first connecting line toward the preset key center direction of the second conflicting virtual key of the two conflicting virtual keys by a second preset distance to obtain a second parallel line;
[0088] The first conflicting virtual key is cut along the first parallel line, and the second conflicting virtual key is cut along the second parallel line, so that the first conflicting virtual key and the second conflicting virtual key are separated.
[0089] After determining the first line between the two conflicting virtual keys, this embodiment can further determine the perpendicular bisector of the first line, and translate the perpendicular bisector of the first line along the preset operation center direction of one of the conflicting virtual keys by a first preset distance to obtain a first parallel line, and translate the perpendicular bisector of the first line along the preset operation center direction of the other conflicting virtual key by a second preset distance to obtain a second parallel line. The first preset distance and the second preset distance can be equal or unequal. For example, the first preset distance and the second preset distance can both be equal to 10 pixels. For ease of distinction, one of the above-mentioned conflicting virtual keys is recorded as the first conflicting virtual key, and the other above-mentioned conflicting virtual key is recorded as the second conflicting virtual key. The first conflicting virtual key is cut by the first parallel line, and the part where the preset operation center of the first conflicting virtual key is retained, and the second conflicting virtual key is cut by the second parallel line, and the part where the preset operation center of the second conflicting virtual key is retained, so that the first conflicting virtual key and the second conflicting virtual key are separated to resolve the conflict.
[0090] As shown in Figure 5, button A and button B conflict at their corresponding preset positions. For these conflicting buttons, a first line connecting the preset button centers of button A and button B can be obtained, and the perpendicular bisector of the first line can be determined. A first parallel line, at a first preset distance from the perpendicular bisector of the first line, is used to cut button A into two parts. The part containing the preset button center of button A is retained, and the part not containing the preset button center is discarded.
[0091] Correspondingly, a second parallel line that is a second preset distance away from the perpendicular bisector of the first connecting line is used to cut the B button, cutting the B button into two parts. The part where the preset key center of the B button is located is retained, and the part that does not contain the preset key center is discarded. At this time, the cut A button and B button 6 are separated.
[0092] For the conflicting B and C buttons in Figure 5, you can refer to the conflict resolution method for the A and B buttons to obtain the final A, B, and C buttons, which is the target button layout.
[0093] In some other optional embodiments of the present disclosure, when the key adjustment interface is displayed on the graphical user interface, determining the target position of each virtual key in response to the setting operation of the virtual key may include:
[0094] When the button adjustment interface is displayed on the graphical user interface, corresponding setting prompt information is displayed in sequence according to the preset setting order of multiple virtual buttons;
[0095] In response to a triggering operation for the currently set prompt information, determining a preset touch point of the current virtual key;
[0096] When the current setting prompt information is the first setting prompt information, determining the preset position of the current virtual key according to the preset area where the preset touch point of the current virtual key is located;
[0097] When the current setting prompt information is not the first setting prompt information, if the preset touch point of the current virtual key is in the previous virtual key, determining a second connection line between the preset touch point of the current virtual key and the preset touch point of the previous virtual key;
[0098] Cutting the previous virtual key according to the perpendicular midline of the second connecting line to obtain a first key region including the preset touch point of the previous virtual key and a second key region including the preset touch point of the current virtual key;
[0099] updating the preset position of the previous virtual key according to the first key area, and determining the preset position of the current virtual key according to the second key area;
[0100] After the preset position of the virtual key corresponding to the last setting prompt information is determined, the final preset position of each virtual key is determined as the target position of each virtual key.
[0101] Among them, the preset setting order of multiple virtual keys can be configured by the game developer from high to low according to the priority set by the game, or the preset setting order of multiple virtual keys can be configured by the user.
[0102] The key adjustment interface of this embodiment may include one or more preset areas for setting virtual keys. For example, the key adjustment interface can be divided into a preset area on the left side of the center line and a preset area on the right side of the center line according to the longitudinal center line of the key adjustment interface. For the first virtual key set in each preset area, the preset area is used as the preset position of the first set virtual key. For example, when the user sets the first virtual key, when clicking anywhere within the preset area on the left side of the center line, the entire preset area on the left side of the center line is used as the hot zone of the first virtual key, so that the graphical user interface can be fully utilized and the hot zone of the virtual key can be expanded as much as possible.
[0103] This embodiment can display corresponding setting prompt information in sequence according to the preset setting order of multiple virtual keys. The setting prompt information can be displayed on the display screen of the terminal device or on the display screen of the preset projection device to prompt the user to set the position of the virtual key corresponding to the current setting prompt information.
[0104] As shown in Figure 6, the setting prompt message "Please click on the screen to confirm the hot zone of key A" is displayed on the key adjustment interface, that is, the current setting prompt message is "Please click on the screen to confirm the hot zone of key A". After receiving the setting prompt message, the user can perform a trigger operation on the touch screen of the terminal device to determine the preset touch point of the corresponding virtual key. When the current setting prompt message is the first setting prompt message, the preset position of the current virtual key can be directly determined based on the preset area where the preset touch point of the current virtual key is located.
[0105] As shown in Figure 6, when "Please click the screen to confirm the hot zone of button A" is the first setting prompt information, the contact point between the user's finger and the screen can be used as the preset touch point of button A. Combined with the preset area where the preset touch point is located, the preset area can be used as the preset position of button A.
[0106] When the current setting information is not the first setting prompt information, it can be determined whether the preset touch point of the current virtual key is in the previous virtual key; if it is in the previous virtual key, obtain the second line between the preset touch point of the current virtual key and the preset touch point of the previous virtual key where it is located, and then cut the previous virtual key where the touch point of the current virtual key is located according to the perpendicular bisector of the second line to obtain a first key area containing the preset touch point of the previous virtual key and a second key area containing the preset touch point of the current virtual key; finally, the first key area updates the preset position of the previous virtual key, and determines the preset position of the current virtual key according to the second key area. It can be understood that the first key area is used as the current preset position of the previous virtual key, and the second key area is used as the current preset position of the current virtual key.
[0107] As shown in FIG7 , when the prompt “Please click on the screen to confirm the hot zone of key B” is not the first setting prompt message, the point of contact between the user's finger and the screen can be used as the preset touch point of key B, and it is determined whether the preset touch point of key B is in the previous virtual key. In the example shown in FIG7 , the preset touch point of key B is in the previous key A. In this case, a second connecting line between the preset touch point of key B and the preset touch point of key A can be determined, and then key A can be cut according to the perpendicular midline of the second connecting line. For example, the perpendicular midline of the second connecting line can be translated toward the preset touch point of key A by a first preset distance, and the perpendicular midline of the second connecting line can be translated toward the preset touch point of key B by a second preset distance, and key A can be cut according to the translated perpendicular midline, resulting in a first key area containing the preset touch point of key A and a second key area containing the preset touch point of key B. In this case, the preset position of key A is the first key area, and the preset position of key B is the second key area.
[0108] When the preset position of the virtual key corresponding to the last setting prompt information is determined, the final preset position of each virtual key is determined as the corresponding target position, and then the target key layout can be obtained.
[0109] Accordingly, when the current setting prompt information is not the first setting prompt information, the preset touch point of the corresponding current virtual key may not be in the previous virtual key. Specifically, the preset touch point of the current virtual key can be located in the gap between two previous virtual keys in the same preset area, or in another preset area different from the preset area where the previous virtual key is located. When it is located in another preset area different from the preset area where the previous virtual key is located, it can be regarded as the first virtual key in the new preset area, and the current setting prompt information can be equivalent to the first setting prompt information. The preset position of the current virtual key can be determined by referring to the method described above.
[0110] If the preset touch point of the current virtual key is in a gap between two previous virtual keys located in the same preset area, determining a third connecting line between the preset touch point of the current virtual key and the preset touch point of a first one of the two previous virtual keys, and determining a fourth connecting line between the preset touch point of the current virtual key and the preset touch point of a second one of the two previous virtual keys;
[0111] Splitting the first previous virtual key according to the perpendicular midline of the third connecting line to obtain a third key area and a fourth key area including a preset touch point of the first previous virtual key;
[0112] The second previous virtual key is divided according to the perpendicular median of the fourth connecting line to obtain a fifth key area and a sixth key area including a preset touch point of the second previous virtual key;
[0113] The preset area of the current virtual key is determined according to the third key area and the fifth key area, and the preset position of the first previous virtual key is updated according to the fourth key area, and the preset position of the second previous virtual key is updated according to the sixth key area.
[0114] As shown in Figure 8, when "Please click on the screen to confirm the hot zone of key C" is not the first setting prompt message, the contact point between the user's finger and the screen can be used as the preset touch point of key C, and the relationship between the preset touch point of key C and the previous virtual key can be determined. In the example shown in Figure 8, the preset touch point of key C is in the gap between the previous key C and key B. At this time, the third line between the preset touch point of key C and the preset touch point of key A can be determined, as well as the fourth line between the preset touch point of key C and the preset touch point of key B. Then, key A is cut according to the perpendicular bisector of the third line. For example, the perpendicular bisector of the third line can be translated by a first preset distance toward the preset touch point of key A to obtain a third parallel line; at the same time, the perpendicular bisector of the third line can be translated by a second preset distance toward the preset touch point of key C to obtain a fourth parallel line; the perpendicular bisector of the fourth line can be translated by a second preset distance toward the preset touch point of key B to obtain a fourth parallel line; the perpendicular bisector of the fourth line can be translated by a second preset distance toward the preset touch point of key C to obtain a fourth parallel line. Suppose the touch point is translated in the direction of the first preset distance to obtain the fifth parallel line, and at the same time, the perpendicular bisector of the fourth line is translated in the direction of the preset touch point of the C key by the second preset distance to obtain the sixth parallel line; according to the third parallel line and the fourth parallel line, the A key is cut to obtain the fourth key area including the preset touch point of the A key, and the third key area closer to the preset touch point of the C key; similarly, according to the fifth parallel line and the sixth parallel line, the B key is cut to obtain the sixth key area including the preset touch point of the B key, and the fifth key area closer to the preset touch point of the C key; at this time, the preset position of the A key is the fourth key area, the preset position of the B key is the sixth key area, and the preset position of the C key is the area surrounded by the third parallel line and the fifth parallel line, including the third key area and the fifth key area and the gap between the third key area and the fifth key area.
[0115] In some other embodiments, when the current setting prompt information is not the first setting prompt information, and the preset touch point of the current virtual key is in the gap between two previous virtual keys located in the same preset area, the preset key area can also be determined with the preset touch point of the current virtual key as the preset key center, as the preset position of the current virtual key; for example, a circle with a preset radius is used as the current virtual key, and the center of the circle with the preset radius coincides with the preset touch point of the current virtual key to obtain the preset position of the current virtual key; of course, the shape and size of the current virtual key can be set according to actual conditions, and are not limited to the circle with the preset radius in the above example.
[0116] The preset positions of the two previous virtual keys are respectively discarded from the key areas overlapping with the preset position of the current virtual key to update the preset positions of the two previous virtual keys, so that the updated preset positions of the two previous preset keys do not conflict with the preset position of the current virtual key.
[0117] Optionally, when the key adjustment interface is displayed on the graphical user interface, corresponding setting prompt information is displayed in sequence according to the preset setting order of the multiple virtual keys, and the following may also be included:
[0118] Display the initial button thumbnail, which is used to show the relative position relationship of each initial virtual button in the graphical user interface; the initial button thumbnail can be displayed on the screen of the terminal device or on the screen of the preset projection device.
[0119] When displaying the current setting prompt information of the current virtual key, the initial virtual key corresponding to the current virtual key is identified in the initial key thumbnail, so that the user can more intuitively understand the virtual key to be set currently through the identification in the initial key thumbnail.
[0120] Optionally, based on the importance of virtual keys in the game process, the multiple initial virtual keys displayed on the graphical user interface can be divided into first-category virtual keys and second-category virtual keys, that is, the multiple initial virtual keys include first-category virtual keys and second-category virtual keys. Among them, the first-category virtual keys can be considered as secondary function keys, such as settings, perspective switching, reset, etc.; the second-category virtual keys can be considered as primary function keys, such as the left and right direction keys, brake keys, accelerator keys, etc. in racing games. For a certain virtual key, whether it specifically belongs to the first-category virtual key or the second-category virtual key is generally defined by the game developer based on the characteristics of the game; of course, the user can also adjust the category of the virtual key according to personal habits, for example, adjust the category of the virtual key from the first-category virtual key to the second-category virtual key, or adjust the category of the virtual key from the second-category virtual key to the first-category virtual key.
[0121] Considering that the first type of virtual keys are generally used less frequently during gaming, while the second type of virtual keys are used more frequently, in order to improve the efficiency of the user in setting the target key layout, in some optional embodiments of the present disclosure, the target positions of the first type of virtual keys can be set according to the default layout, and the user only needs to set the target positions of the second type of virtual keys. It is understood that when the key adjustment interface is displayed on the graphical user interface, the corresponding setting prompt information is displayed in sequence according to the preset setting order of multiple virtual keys, which may include:
[0122] When the button adjustment interface is displayed on the graphical user interface, the first type of virtual buttons are displayed in a preset edge area of the button adjustment interface; for example, multiple virtual buttons of the first type are arranged in a top edge area of the button adjustment interface according to a preset order and a preset button hot zone size;
[0123] According to the preset setting order of multiple virtual keys in the second category of virtual keys, the corresponding setting prompt information is displayed in sequence; the setting prompt information reminds the user to set the position of the virtual key corresponding to the current setting prompt information. The specific setting process can be found in the previous description and will not be repeated here.
[0124] Of course, the user can also adjust the layout of the first type of virtual keys according to actual needs, for example, adjust the arrangement order and position of the first type of virtual keys.
[0125] In step 102, the game screen is displayed on the preset projection device, and the initial virtual keys are adjusted according to the target key layout.
[0126] After determining the target button layout, the game screen displayed in the graphical user interface of the terminal device is sent to the preset projection device for display, and the initial virtual keys displayed in the graphical user interface of the terminal device are adjusted according to the target button layout to expand the hot zone of at least one initial virtual key, thereby improving the accuracy of the user when performing blind operations according to personal habits, thereby improving the user's gaming experience.
[0127] In some optional embodiments of the present disclosure, the above-mentioned displaying the game screen on the preset projection device and adjusting the initial virtual keys according to the target key layout may further include:
[0128] Display virtual button thumbnails on the preset projection device. The virtual button thumbnails are used to show the relative position relationship of each virtual button in the target button layout.
[0129] In this embodiment, in addition to displaying the game screen in the preset projection device, the virtual button thumbnail corresponding to the target button layout can also be displayed in the preset projection device to provide assistance for the user's blind operation. Moreover, displaying the target button layout in thumbnail form can reduce interference and ensure the user's large-screen vision experience.
[0130] Furthermore, the method may also include:
[0131] In response to a triggering operation acting on a target virtual key in the target key layout, the target virtual key is identified in the virtual key thumbnail.
[0132] During the game, the user controls the game by triggering the corresponding virtual key. In this embodiment, when the user triggers the target virtual key, the target virtual key can be identified in the virtual key thumbnail, wherein the target virtual key can be any virtual key. For example, when the user triggers the left direction key, the virtual object in the game screen can be controlled to move to the left, and the left direction key can be identified in the virtual key thumbnail. For example, the left direction key can be displayed in a different color from other keys. When the user finishes triggering the left direction key, the left direction key in the virtual key thumbnail returns to the default color, that is, it maintains the same color as other untriggered keys. By synchronously identifying the virtual key corresponding to the user's triggering operation in the virtual key thumbnail, a corresponding response display can be provided to the user.
[0133] Furthermore, considering that it is difficult for users to simulate the scene during the game when setting the target button layout, the set button positions cannot fully adapt to the user's usage needs during the game, resulting in game operation errors.
[0134] In view of this, in some optional embodiments of the present disclosure, the method for adjusting the virtual key may further include:
[0135] Update the target button layout based on the user's historical operation information.
[0136] In this embodiment, the target key layout set by the user can be adaptively adjusted according to the user's historical operation information, that is, the target key layout is updated according to the user's historical operation information, so that the updated target key layout is more suitable for the user's usage habits in actual usage scenarios, which can avoid the user from repeatedly adjusting the virtual keys, that is, the way the user adjusts the virtual keys is simplified, the efficiency of the virtual key adjustment is improved, and the user's usage experience is improved.
[0137] 9 , the updating of the target button layout according to the user's historical operation information may include:
[0138] 901. Determine an operation center of each virtual key in a target key layout based on historical operation information of the user;
[0139] 902. Adjust the corresponding virtual key according to the operation center and update the target key layout to shorten the distance between the key center of the virtual key and the corresponding operation center.
[0140] Taking games as an example, in the game projection mode, users can play games by triggering virtual buttons in the terminal device. Therefore, the trigger position information when the user triggers the virtual button during the game can be obtained. The trigger position information is the historical operation information.
[0141] The historical operation information includes the single-key historical operation information of each virtual key. According to the single-key historical operation information corresponding to each virtual key, the operation center of each virtual key can be obtained.
[0142] After obtaining the operation center of each virtual key, the corresponding virtual key can be adjusted according to the position of the operation center, including adjusting the position of the virtual key and / or adjusting the shape of the virtual key; so that the distance between the key center of the virtual key and the corresponding operation center is shortened, that is, the distance between the new key center of each adjusted virtual key and the corresponding operation center is less than the distance between the original key center of the virtual key and the operation center, wherein the original key center of the virtual case refers to the key center of the virtual key in the current target key layout.
[0143] The process of updating the target key layout will be further described below with reference to FIG. 9 to FIG. 14 .
[0144] In step 901, the operation center of each virtual key in the target key layout is determined according to the user's historical operation information.
[0145] Each virtual key has a corresponding function and triggering method. The triggering method can include touch operations that contact the virtual key, such as single-clicking, sliding, double-clicking, and long-pressing. The triggering method can also include non-contact operations on the virtual key, such as operations where the projection point of the operating medium is on the virtual key. Historical operation information refers to the operation information that the user has performed to trigger the virtual key. The user's historical operation information can be obtained by monitoring the trigger position information of the operating medium on the display screen when the function of the virtual key is triggered. The operating medium can be a finger, a stylus, etc.
[0146] The historical operation information includes the single-key historical operation information of each virtual key. According to the single-key historical operation information corresponding to each virtual key, the operation center of each virtual key can be obtained. It can be understood that for each virtual key, its single-key historical operation information includes at least one trigger position information related to the virtual key. For example, for a virtual key triggered by sliding, the trigger position information may include the click position information obtained by quantifying the sliding trajectory of the sliding operation, or include the start and end position information of the sliding operation. For a virtual key triggered by long pressing, the trigger position information may include the contact point position information of the long pressing operation. By processing all the trigger position information in the single-key historical operation information, the center point of all the trigger position information can be obtained, and the center point is the operation center of the virtual key. In other words, the operation center of the virtual key is used to represent the user's usage habits when triggering the virtual key in the actual usage scenario, and can more accurately reflect the position where the virtual key actually needs to be set, so that the virtual key can be adaptively adjusted based on the operation center of the virtual key in the future, so as to obtain a virtual key that better meets the user's personalized needs.
[0147] In some optional embodiments of the present disclosure, a switch control for controlling the adjustment function of the virtual key can be added to the settings page of the application. As shown in Figure 10, a switch control for the key adaptive position can be set on the settings page of the application. The switch control for the key adaptive position is a switch control for controlling the adjustment function of the virtual key. When the switch control for the key adaptive position is in the on state, the above-mentioned step of determining the operation center of each virtual key based on the user's historical operation information is executed; when the switch control for the key adaptive position is in the off state, the above-mentioned step of determining the operation center of each virtual key based on the user's historical operation information is not executed. It can be understood that in some optional embodiments of the present disclosure, the above-mentioned step 901 may include:
[0148] In response to the activation operation of the key adjustment control, the operation center of each virtual key is determined according to the historical operation information of the user.
[0149] In this embodiment, when a user activates the switch for adaptive key positions, the user's historical operation information is obtained and, based on this information, the operation center of each virtual key is determined. The user can then independently decide whether to allow adaptive key position adjustment to meet the needs of different users in different scenarios. For example, when a user (device owner) temporarily lends a terminal device to another person, since the current user (other person) is not the owner, the user generally does not want the terminal device to adaptively adjust the key positions. Therefore, the adaptive key position adjustment function can be disabled by turning off the switch for adaptive key positions.
[0150] Furthermore, in some optional embodiments of the present disclosure, while adding a switch control for controlling the adjustment function of the virtual key to the settings page of the application, a period setting input box for indicating the virtual key adaptive adjustment period can also be added, or multiple different adjustment period options for indicating the virtual key adaptive adjustment period can be added, so that the user can independently determine the virtual key adaptive adjustment period. It is understood that in some optional embodiments of the present disclosure, the above-mentioned determination of the operation center of each virtual key based on the user's historical operation information in response to the activation operation of the key adjustment control can include:
[0151] In response to the start-up operation of the key adjustment control, a target adjustment period is determined. When the target adjustment period is reached, the operation center of each virtual key is determined according to the historical operation information of the user within the adjustment period.
[0152] In this embodiment, before enabling the switch control for key adaptive position, the user can set or select an adjustment period. After the user enables the switch control for key adaptive position, the user's set or selected adjustment period is obtained, i.e., a target adjustment period is determined, and user operation information is collected within the target adjustment period. When the target adjustment period is reached, the key center of each virtual key is determined based on the user's historical operation information collected within the target adjustment period. If the user does not set or select an adjustment period, the user's historical operation information is collected according to the default adjustment period.
[0153] Taking games as an example, when the target adjustment cycle is determined to be 10 games, after the switch control of the button adaptive position is turned on, the user's operation information during the next 10 games is obtained. When the 10th game is over, the operation center of each virtual button is determined based on the currently obtained historical operation information.
[0154] In step 902 , the corresponding virtual key is adjusted according to the operation center to shorten the distance between the key center of the virtual key and the corresponding operation center.
[0155] Since the operation center can more accurately reflect the user's needs for virtual keys in actual usage scenarios, after determining the operation center of each virtual key, the position and / or shape of the corresponding virtual key can be adjusted according to the operation center to shorten the distance between the key center of each virtual key and the corresponding operation center, so that all virtual keys can better meet the user's personalized needs.
[0156] In some optional embodiments of the present disclosure, adjusting the corresponding virtual key according to the operation center to shorten the distance between the key center of the virtual key and the corresponding operation center may include:
[0157] Move the virtual key toward the corresponding operation center so that the key center of the virtual key coincides with the corresponding operation center.
[0158] In this embodiment, when adjusting the virtual keys, each virtual key can be moved sequentially or simultaneously in the direction of the corresponding operation center, and the movement is stopped when the key center of the virtual key coincides with the corresponding operation center, so that the operation center is located at the center position of the moved virtual key. If there is no conflict between the moved virtual keys, that is, there is no overlapping between the key areas of the moved virtual keys, the position of the moved virtual key at this time is used as the final position of the virtual key. If there is a conflict between the moved virtual keys, the moved virtual keys need to be further processed. Various processing methods are provided later, which will not be repeated here.
[0159] In some optional embodiments of the present disclosure, after moving the virtual key to the corresponding operation center so that the key center of the virtual key coincides with the corresponding operation center, the following steps may be further included:
[0160] If there is a conflict between the moved virtual keys, an adjustment vector for each conflicting key is determined based on the operation center and the original key center of each conflicting key. The starting point of the adjustment vector is the operation center of the corresponding conflicting key, and the end point is the original key center of the corresponding conflicting key.
[0161] Move each conflicting button along the direction of the corresponding adjustment vector until the conflict disappears.
[0162] After the virtual keys are moved to a position where the key center coincides with the corresponding operation center, the position of each virtual key after movement can be obtained. When there is a conflict between the moved virtual keys, that is, when there is an overlapping portion between the key areas of the moved virtual keys, the conflicting virtual keys are obtained. For easy distinction, the virtual keys obtained at this time are recorded as conflicting keys, and the adjustment vectors of each conflicting key are determined based on the operation center and the original key center of each conflicting key. It can be understood that for each conflicting key, the corresponding adjustment vector is generated with its operation center as the starting point and the original key center as the end point.
[0163] Then, each conflicting key is moved in the direction of the corresponding adjustment vector, and the movement stops when the conflict disappears. During the movement process, each conflicting key can be moved simultaneously or sequentially. When moving simultaneously, the movement distance of each conflicting key per unit time can be equal, or the ratio of the movement distance of each conflicting key per unit time to its corresponding adjustment vector is equal. When moving sequentially, the single movement distance of each conflicting key is equal, or the ratio of the single movement distance of each conflicting key to its corresponding adjustment vector is equal.
[0164] In some optional embodiments of the present disclosure, the above-mentioned moving each conflicting key along the direction of the corresponding adjustment vector until the conflict disappears includes:
[0165] Determine the movement speed of each conflicting key;
[0166] Move each conflicting key simultaneously along the direction of the corresponding adjustment vector at the corresponding movement speed;
[0167] When the conflict of the target conflict key disappears, the movement of the target conflict key is stopped.
[0168] Among them, the target conflict key can be any conflict key. In the process of moving the conflict keys, this embodiment can first determine the moving speed of each conflict key, and the moving speed of different conflict keys can be different. For example, the moving speed can be related to the length of the adjustment vector corresponding to the conflict key, or it can also be related to the priority of the conflict key. For example, the higher the priority of the conflict key, the smaller the corresponding moving speed, so that the conflict key with a higher priority is relatively closer to the corresponding operation center when the conflict is resolved. And multiple conflict keys can move at the same time to improve the efficiency of key adaptive adjustment. For each conflict key, during the movement process, when it no longer conflicts with other virtual keys (virtual keys other than itself), the movement of the conflict key can be stopped.
[0169] As shown in Figure 11, after virtual key 1, virtual key 2, virtual key 3 and virtual key 4 move to the position where the key center (the key center is represented by a hollow circle in the figure, where the hollow solid circle in the figure represents the current key center and the hollow dotted circle represents the original key center) coincides with the corresponding operation center (the operation center is represented by a solid circle in the figure), there is a conflict between virtual key 1 and virtual key 2, and there is also a conflict between virtual key 2 and virtual key 3. Therefore, virtual key 1, virtual key 2 and virtual key 3 are recorded as conflict key 1, conflict key 2 and conflict key 3 respectively; virtual key 4 where there is no conflict can remain unchanged. Move the conflicting key 1, the conflicting key 2 and the conflicting key 3 along the direction of the corresponding adjustment vector. The conflict of the conflicting key 1 disappears first. When the conflict of the conflicting key 1 disappears, stop moving the conflicting key 1. Since the conflicts between the conflicting key 2 and the conflicting key 3 still exist when the conflict of the conflicting key 1 disappears, continue to move the conflicting key 2 and the conflicting key 3. When the conflict between the conflicting key 2 and the conflicting key 3 disappears, stop moving the conflicting key 2 and the conflicting key 3, thereby realizing adaptive adjustment of the keys.
[0170] Furthermore, in some optional embodiments of the present disclosure, the above-mentioned determination of the movement speed of each conflicting key may include:
[0171] The movement speed corresponding to each conflicting key is determined according to the length of the adjustment vector of each conflicting key; the movement speed is proportional to the length of the corresponding adjustment vector, and the ratio of the movement speeds of different conflicting keys is equal to the ratio of the lengths of the corresponding adjustment vectors.
[0172] In this embodiment, the corresponding movement speed can be determined based on the length of the adjustment vector for each conflicting key. It will be appreciated that, in this embodiment, conflicting keys with different adjustment vector lengths have corresponding movement speeds that are different. Specifically, the movement speed is proportional to the length of the corresponding adjustment vector, and the ratio of the movement speeds of different conflicting keys is equal to the ratio of the lengths of the corresponding adjustment vectors. That is, the ratio of the movement speed of each conflicting key to the length of its corresponding adjustment vector is the same, meaning that each conflicting key moves in equal proportion to the length of its corresponding adjustment vector.
[0173] For example, the adjustment vector length of the conflicting key 1 is a, and the adjustment vector length of the conflicting key 2 is b. Then, the moving speed of the conflicting key 1 may be a / c, and correspondingly, the moving speed of the conflicting key 2 is b / c.
[0174] In some other optional embodiments of the present disclosure, after moving the virtual key to the corresponding operation center so that the key center of the virtual key coincides with the corresponding operation center, the following steps may also be performed:
[0175] If there is a conflict between the moved virtual keys, each conflicting key is cut to separate the conflicting keys.
[0176] In this embodiment, when there is a conflict between the moved virtual keys, the conflicting virtual keys, i.e., the conflicting keys, can be obtained and separated by cutting to resolve the conflict. Cutting methods may include cutting based on the overlapping area between the conflicting keys, cutting based on the perpendicular median of the line connecting the operation centers of the conflicting keys, and so on.
[0177] In some optional embodiments of the present disclosure, the above-mentioned cutting of the conflicting keys to separate the conflicting keys may include:
[0178] Determine a connection line between the two conflicting keys according to the operation centers of the two conflicting keys;
[0179] The two conflicting keys are cut according to the perpendicular median of the connecting line to separate the two conflicting keys.
[0180] In this embodiment, the operation centers of two conflicting keys are connected to obtain a connection line between the two conflicting keys, that is, the operation centers of the conflicting keys are connected in pairs. The two conflicting keys connected by the connection line can be cut along the perpendicular median of the connection line to separate the two conflicting keys to resolve the conflict.
[0181] Furthermore, in some optional embodiments of the present disclosure, the above-mentioned cutting of the two conflicting keys according to the perpendicular median of the connecting line to separate the two conflicting keys may include:
[0182] The perpendicular median is translated by a preset distance toward the operation center of the first conflicting key of the two conflicting keys to obtain a first cutting line;
[0183] The perpendicular median is translated by a preset distance toward the operation center of the second conflicting key of the two conflicting keys to obtain a second cutting line;
[0184] The first conflicting key is cut along the first cutting line, and the second conflicting key is cut along the second cutting line, so that the first conflicting key and the second conflicting key are separated.
[0185] After determining the line connecting the two conflicting keys, this embodiment can further determine the perpendicular midline of the line, translate the perpendicular midline along the direction of the operation center of one of the conflicting keys by a preset distance to obtain a first cutting line, and translate the perpendicular midline along the direction of the operation center of the other conflicting key by the same distance to obtain a second cutting line. For ease of distinction, one of the conflicting keys is referred to as the first conflicting key, and the other conflicting key is referred to as the second conflicting key. The first conflicting key is cut along the first cutting line, retaining the portion where the operation center of the first conflicting key is located, and the second conflicting key is cut along the second cutting line, retaining the portion where the operation center of the second conflicting key is located, thereby separating the first conflicting key and the second conflicting key to resolve the conflict.
[0186] As shown in Figure 12, after virtual key 5, virtual key 6, virtual key 7 and virtual key 8 move to the position where the key center (the key center is represented by a hollow circle in the figure, where the hollow solid circle in the figure represents the current key center and the hollow dotted circle represents the original key center) coincides with the corresponding operation center (the operation center is represented by a solid circle in the figure), there is a conflict between virtual key 5 and virtual key 6, and there is also a conflict between virtual key 6 and virtual key 7. Therefore, virtual key 5, virtual key 6 and virtual key 7 are respectively recorded as conflict key 5, conflict key 6 and conflict key 7.
[0187] For conflicting keys 5 and 6, a line 1 is obtained between the operation centers of conflicting keys 5 and 6. For conflicting keys 6 and 7, a line 2 is obtained between the operation centers of conflicting keys 6 and 7. Based on line 1 and line 2, the corresponding perpendicular midline 3 and perpendicular midline 4 can be determined, respectively. Perpendicular midline 3 is translated 10 pixels toward conflicting keys 5 and 6, respectively, to obtain first cutting line 5 and second cutting line 6. Perpendicular midline 4 is translated 10 pixels toward conflicting keys 6 and 7, respectively, to obtain first cutting line 7 and second cutting line 8.
[0188] The conflict button 5 is cut along a first cutting line 5, dividing the conflict button 5 into two parts. The part where the operation center of the conflict button 5 is located is retained, and the part not containing the operation center is discarded. Accordingly, the conflict button 6 is cut along a second cutting line 6, dividing the conflict button 6 into two parts. The part where the operation center of the conflict button 6 is located is retained, and the part not containing the operation center is discarded. The conflict buttons 5 and 6 are now separated.
[0189] Similarly, the first cutting line 7 is used to cut the conflict button 6, retaining the part where the operation center of the conflict button 6 is located; the second cutting line 8 is used to cut the conflict button 7, retaining the part where the operation center of the conflict button 7 is located. At this time, the cut conflict button 6 and conflict button 7 are separated.
[0190] In some other optional embodiments of the present disclosure, adjusting the corresponding virtual key according to the operation center to shorten the distance between the key center of the virtual key and the corresponding operation center may include:
[0191] Determine a movement vector of each virtual key according to the original key center and the operation center of each virtual key, where the starting point of the movement vector is the original key center of the corresponding virtual key and the end point is the operation center of the corresponding virtual key;
[0192] Move each virtual key along the direction of the corresponding movement vector, and ensure that the adjusted virtual keys do not conflict with each other.
[0193] In this embodiment, when adjusting the virtual keys, each virtual key can be moved sequentially or simultaneously toward the corresponding operation center, and the movement stops when a conflict is approaching. The adjusted virtual key position obtained in this case can be considered as the position where the key center is closest to the operation center without changing the original shape of the virtual key.
[0194] For example, for each virtual key, a corresponding movement vector can be generated, starting from the original center of the virtual key and ending at the corresponding operation center. The virtual key is then moved along the direction of the corresponding movement vector while simultaneously detecting the edge positions of each virtual key. When the distance between any two virtual keys equals a preset distance, the movement of those two virtual keys stops. The preset distance can be set based on actual needs, for example, 10 pixels or 20 pixels.
[0195] During the movement process, each virtual key can be moved simultaneously or sequentially. When moving simultaneously, the movement distance of each virtual key per unit time can be equal, or the ratio of the movement distance of each virtual key per unit time to its corresponding movement vector is equal. When moving sequentially, the single movement distance of each virtual key is equal, or the ratio of the single movement distance of each virtual key to its corresponding movement vector is equal.
[0196] In some optional embodiments of the present disclosure, moving each virtual key along the direction of the corresponding movement vector to shorten the distance between the key center of the virtual key and the corresponding operation center may include:
[0197] Determine the adjustment speed of each virtual key;
[0198] Each virtual key is moved simultaneously along the direction of the corresponding movement vector at the corresponding adjustment speed, and it is ensured that the adjusted virtual keys do not conflict with each other.
[0199] In this embodiment, during the adjustment of virtual keys, an adjustment speed for each virtual key can be determined. The adjustment speed indicates how fast the corresponding virtual key moves along the direction of the movement vector. The adjustment speeds for different virtual keys can be different. For example, the adjustment speed can be related to the length of the movement vector corresponding to the virtual key, or it can be related to the priority of the virtual key. For example, virtual keys with higher priorities have correspondingly faster adjustment speeds, so that virtual keys with higher priorities are relatively closer to the corresponding operation center when they stop moving. Multiple virtual keys can also move simultaneously to improve the efficiency of adaptive key adjustment. For each virtual key, during the adjustment process, when the distance between it and other virtual keys (excluding itself) reaches a preset distance, the virtual key and other virtual keys with the same distance from it can be stopped. Alternatively, for each virtual key, during the adjustment process, when the distance between it and other virtual keys is less than or equal to 0, a retraction operation can be performed, i.e., the virtual key and the other virtual keys are moved in the opposite direction, so that the distance between the virtual key and the other virtual keys is greater than 0, and then the movement stops.
[0200] Furthermore, in some optional embodiments of the present disclosure, determining the adjustment speed of each virtual key may include:
[0201] The adjustment speed corresponding to each virtual key is determined according to the length of the movement vector of each virtual key; the adjustment speed is proportional to the length of the corresponding movement vector, and the adjustment speed ratio of different virtual keys is equal to the length ratio of the corresponding movement vectors.
[0202] In this embodiment, the corresponding adjustment speed can be determined based on the length of the motion vector of each virtual key. Specifically, the adjustment speed is proportional to the length of the corresponding motion vector, and the ratio of the adjustment speeds of different virtual keys is equal to the ratio of the lengths of the corresponding motion vectors. That is, the ratio of the adjustment speed of each virtual key to the length of the corresponding motion vector is the same, that is, each virtual key moves in equal proportion to the length of its corresponding motion vector.
[0203] In some optional embodiments of the present disclosure, before adjusting the corresponding virtual key according to the operation center to shorten the distance between the key center of the virtual key and the corresponding operation center, it can be determined whether the distance between the operation center and the original key center of the corresponding virtual key is greater than a preset distance threshold. When the distance between the original key center of the virtual key and the corresponding operation center is not greater than the preset distance threshold, it can be considered that the virtual key can meet the user's personalized needs and the virtual key can be adjusted. When the distance between the original key center of the virtual key and the corresponding operation center is greater than the preset distance threshold, the corresponding virtual key is adjusted according to the operation center to shorten the distance between the key center of the virtual key and the corresponding operation center.
[0204] In some further optional embodiments of the present disclosure, adjusting the corresponding virtual key according to the operation center to shorten the distance between the key center of the virtual key and the corresponding operation center may include:
[0205] When the operation area corresponding to the operation center is not within the corresponding virtual key, the virtual key and the operation area are merged to obtain a new virtual key.
[0206] When adjusting a virtual key in this embodiment, the operation area corresponding to each operation center is first determined based on each operation center. The operation area can be a circular area with a preset radius and the operation center as the center, or a region with a preset area and the operation center as the center point. A determination is then made as to whether the operation area corresponding to the operation center is within the corresponding virtual key. If so, the virtual key can meet the user's usage requirements. If not, the virtual key and the operation area need to be merged to obtain a new virtual key. That is, the union of the original key area of the virtual key and the corresponding operation area is taken as the new key area of the new virtual key.
[0207] As shown in Figure 13, the operation area corresponding to the operation center of the virtual key 9 (the operation center is represented by a solid circle in the figure) is area a, and the original key area of the virtual key 9 is area A. Since part of area a is not within area A, area a and area A are merged to obtain area B, that is, area B = area a ∪ area A, and area B is the new key area of the adjusted virtual key 9; the new key center of the virtual key 9 (the key center is represented by a hollow circle in the figure, where the hollow solid circle in the figure represents the current key center, and the hollow dotted circle represents the original key center) is closer to the operation center than the original key center, that is, the distance between the new key center and the operation center is smaller than the distance between the original key center and the operation center.
[0208] Optionally, when there is a conflict between the new virtual keys, that is, when there is overlap between the new virtual keys, a method for resolving the conflict can be determined based on the relationship between the conflicting area and the operation areas corresponding to the two conflicting new virtual keys. A new virtual key is a virtual key whose key area includes a corresponding operation area, and the conflicting area is the area where the two new virtual keys overlap.
[0209] Exemplarily, the new virtual key can be divided into an operation area portion and an original area portion, wherein the original area portion refers to the other area in the new key area except the operation area. When the conflicting area is the area where the operation area portion of a new virtual key overlaps with the original area portion of another new virtual key, the original area portion of the other new virtual key can be cut according to the conflicting area, and the portion of the other new virtual key located in the conflicting area can be discarded, so that the two new virtual keys are separated to resolve the conflict. When the conflicting area is the operation area portion of two new virtual keys, the operation area portions of the two new virtual keys can be divided according to the perpendicular bisector of the line connecting the operation centers of the two new virtual keys, so that the two new virtual keys are separated to resolve the conflict.
[0210] Furthermore, referring to FIG. 14 , in some optional embodiments of the present disclosure, after performing the above-mentioned adjustment of the corresponding virtual key according to the operation center to shorten the distance between the key center of the virtual key and the corresponding operation center, the following steps may also be included:
[0211] Displaying a pop-up dialog box on the display screen; the pop-up dialog box includes a relative position of the adjusted virtual key and the display screen, or a positional relationship between the adjusted virtual key and the corresponding original virtual key, and the pop-up dialog box also includes an accept control and a reject control;
[0212] In response to a trigger operation on the accept control, displaying the adjusted virtual key on the display screen;
[0213] In response to the triggering operation on the rejection control, the original virtual button is displayed on the display screen.
[0214] In this embodiment, after the adjustment of each virtual key is completed, a pop-up dialog box can be displayed on the display screen of the terminal device. The pop-up dialog box displays the relative position of the adjusted virtual key and the display screen. For example, in FIG14 , a proportionally reduced display screen display interface and the adjusted virtual key are displayed on the display screen, or the positional relationship between the adjusted virtual key and the corresponding original virtual key is displayed. For example, the adjusted virtual key can be displayed in a different color from the original virtual key, or an arrow or other indicator can be used between the adjusted virtual key and the corresponding original virtual key. The pop-up dialog box can also display an accept control and a reject control. The accept control is used to indicate that the adjusted virtual key will be used as the virtual key for subsequent use, that is, to accept the result of the current adaptive adjustment; the reject control is used to indicate that the original virtual key will be maintained, that is, to reject the result of the current adaptive adjustment. When the user selects the accept control, the adjusted virtual key is displayed on the display screen; when the user selects the reject control, the original virtual key is displayed on the display screen.
[0215] The information of the adjusted virtual keys can be displayed to the user through a pop-up dialog box, so that the user can choose whether to use the adjusted virtual keys as virtual keys for subsequent use according to personal needs, so that the virtual keys displayed subsequently can better meet user needs.
[0216] Furthermore, the information of virtual keys obtained through adaptive adjustments of multiple different users can be summarized, and then the target information of at least part of the virtual keys can be determined based on the summarized data. The target information may include the shape and / or position information of the virtual keys, and then the target information can be used as the default information of the corresponding virtual keys. The default information refers to the shape and / or position information of the virtual keys before the user makes personalized adjustments.
[0217] In the game projection mode, the embodiments of the present disclosure can display the game screen on a preset projection device and adjust the initial virtual keys displayed on the terminal device according to the target key layout associated with the user; it is realized that when the game is projected, the original virtual keys displayed on the terminal device can be automatically adjusted according to the corresponding target key layout to adapt to the usage habits of different users, thereby ensuring the accuracy of the user's control of the game during blind operation and improving the user experience.
[0218] In addition, the operation center of each virtual key is determined based on the user's historical operation information; the corresponding virtual key is adjusted according to the operation center to shorten the distance between the key center of the virtual key and the corresponding operation center; wherein, adjusting the corresponding virtual key according to the operation center to shorten the distance between the key center of the virtual key and the corresponding operation center can specifically be moving the key center of the virtual key to coincide with the corresponding operation center, and when there is a conflict between the virtual keys after the movement, each conflicting key is moved along the direction of the corresponding adjustment vector, or each conflicting key is cut to resolve the conflict; or, adjusting the corresponding virtual key according to the operation center to shorten the distance between the key center of the virtual key and the corresponding operation center can specifically be moving each virtual key along the direction of the corresponding movement vector, and ensuring that the adjusted virtual keys do not conflict with each other; or, merging the key area of the virtual key with the operation area corresponding to the operation center; it is achieved that the virtual key can be adaptively adjusted according to the user's historical operation information, and the adjusted virtual key is more suitable for the user's usage habits in actual usage scenarios. Therefore, the user can avoid repeatedly adjusting the virtual key, that is, the way the user adjusts the virtual key is simplified, the efficiency of virtual key adjustment is improved, and the user experience is improved.
[0219] It should be noted that for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present disclosure are not limited by the order of the actions described, because according to the embodiments of the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present disclosure.
[0220] Referring to Figure 15 , a block diagram of an embodiment of a virtual key adjustment device disclosed herein is shown. Corresponding to the aforementioned embodiment of the virtual key adjustment method, a graphical user interface can be displayed on a terminal device by running an application. The graphical user interface displays at least a game screen and a plurality of initial virtual keys. The device may include the following modules:
[0221] A button layout determination module 1501 is configured to determine a target button layout associated with a user in response to a screen projection instruction;
[0222] The virtual key adjustment module 1502 is used to display the game screen in the preset projection device and adjust the initial virtual keys according to the target key layout.
[0223] In an embodiment of the present disclosure, the above-mentioned device can automatically adjust the initial virtual keys displayed by the terminal device according to the corresponding target key layout when projecting the game to adapt to the usage habits of different users, thereby ensuring the accuracy of the user's control of the game during blind operation and improving the user's usage experience.
[0224] In some optional embodiments of the present disclosure, the key layout determining module 1501 may include:
[0225] a target position determination module, configured to determine a target position of each virtual key in response to a setting operation of the virtual key when the key adjustment interface is displayed on the graphical user interface;
[0226] The target layout determination module is used to determine the target key layout associated with the user according to the target position of each virtual key.
[0227] In some optional embodiments of the present disclosure, the target location determination module may include:
[0228] The prompt information display module is used to display corresponding setting prompt information in sequence according to the preset setting order of multiple virtual keys when the key adjustment interface is displayed on the graphical user interface;
[0229] A preset position determination module, configured to determine a preset position of a corresponding virtual key in response to a triggering operation for setting prompt information;
[0230] The first target position determining module is configured to determine the preset position of each virtual key as the target position of each virtual key if the virtual keys do not conflict with each other at the corresponding preset positions.
[0231] In some optional embodiments of the present disclosure, the apparatus may further include:
[0232] The second target position determination module is configured to cut each conflicting virtual key if at least two virtual keys conflict at corresponding preset positions, so as to separate the conflicting virtual keys and obtain target positions of the conflicting virtual keys.
[0233] In some optional embodiments of the present disclosure, the second target position determination module may include:
[0234] A preset key center determination module, used to determine the preset key center of each conflicting virtual key;
[0235] A first connection line determining module, configured to determine a first connection line between two conflicting virtual keys according to preset key centers of the two conflicting virtual keys;
[0236] A first parallel line determining module is configured to translate the perpendicular bisector of the first connecting line toward the preset key center direction of the first conflicting virtual key of the two conflicting virtual keys by a first preset distance to obtain a first parallel line;
[0237] A second parallel line determining module is configured to translate the perpendicular bisector of the first connecting line toward the preset key center of the second conflicting virtual key of the two conflicting virtual keys by a second preset distance to obtain a second parallel line;
[0238] The key separation module is used to cut the first conflicting virtual key according to the first parallel line and cut the second conflicting virtual key according to the second parallel line, so as to separate the first conflicting virtual key from the second conflicting virtual key.
[0239] In some optional embodiments of the present disclosure, the target location determination module may include:
[0240] The prompt information display module is used to display corresponding setting prompt information in sequence according to the preset setting order of multiple virtual keys when the key adjustment interface is displayed on the graphical user interface;
[0241] A preset touch point determination module, configured to determine a preset touch point of a current virtual key in response to a trigger operation for the currently set prompt information;
[0242] a first processing module, configured to determine, when the current setting prompt information is the first setting prompt information, a preset position of the current virtual key according to a preset area where the preset touch point of the current virtual key is located;
[0243] a second processing module configured to, when the current setting prompt information is not the first setting prompt information and if the preset touch point of the current virtual key is within the previous virtual key, determine a second connection line between the preset touch point of the current virtual key and the preset touch point of the previous virtual key;
[0244] a first cutting module, configured to cut the previous virtual key according to the perpendicular midline of the second connecting line to obtain a first key region including the preset touch point of the previous virtual key and a second key region including the preset touch point of the current virtual key;
[0245] a first preset position updating module, configured to update the preset position of the previous virtual key according to the first key area, and determine the preset position of the current virtual key according to the second key area;
[0246] The third target position determining module is configured to determine the final preset position of each virtual key as the target position of each virtual key after the preset position of the virtual key corresponding to the last setting prompt information is determined.
[0247] In some optional embodiments of the present disclosure, the target location determination module may further include:
[0248] a third processing module configured to, when the current setting prompt information is not the first setting prompt information and if the preset touch point of the current virtual key is in a gap between two previous virtual keys located in the same preset area, determine a third connecting line between the preset touch point of the current virtual key and the preset touch point of a first previous virtual key of the two previous virtual keys, and determine a fourth connecting line between the preset touch point of the current virtual key and the preset touch point of a second previous virtual key of the two previous virtual keys;
[0249] a second segmentation module, configured to segment the first preceding virtual key according to a perpendicular midline of the third connecting line to obtain a third key region and a fourth key region including a preset touch point of the first preceding virtual key;
[0250] a third segmentation module, configured to segment the second preceding virtual key according to the perpendicular midline of the fourth connecting line to obtain a fifth key region and a sixth key region including a preset touch point of the second preceding virtual key;
[0251] The second preset position update module is used to determine the preset area of the current virtual key according to the third key area and the fifth key area, and to update the preset position of the first previous virtual key according to the fourth key area and to update the preset position of the second previous virtual key according to the sixth key area.
[0252] In some optional embodiments of the present disclosure, the target position determination module may be configured to, when the screen casting instruction is the first screen casting instruction, display a key adjustment interface on the graphical user interface; when the key adjustment interface is displayed on the graphical user interface, determine the target position of each virtual key in response to the setting operation of the virtual key;
[0253] Correspondingly, the target layout determination module can also be used to store the target button layout in a preset storage space.
[0254] In some optional embodiments of the present disclosure, the button layout determination module can also be used to obtain the target button layout associated with the user from a preset storage space when the screen projection instruction is not the first screen projection instruction.
[0255] In some optional embodiments of the present disclosure, the apparatus may further include:
[0256] The virtual button thumbnail display module is used to display virtual button thumbnails in the preset screen projection device. The virtual button thumbnails are used to show the relative position relationship of each virtual button in the target button layout.
[0257] In some optional embodiments of the present disclosure, the apparatus may further include:
[0258] The virtual key thumbnail identification module is configured to respond to a triggering operation on a target virtual key in the target key layout and identify the target virtual key in the virtual key thumbnail.
[0259] In some optional embodiments of the present disclosure, the multiple initial virtual keys displayed on the graphical user interface include a first category virtual keys and a second category virtual keys, and the prompt information display module is used to display the first category virtual keys in a preset edge area of the key adjustment interface when the graphical user interface displays the key adjustment interface; and display corresponding setting prompt information in sequence according to the preset setting order of the multiple virtual keys in the second category virtual keys.
[0260] In some optional embodiments of the present disclosure, the apparatus may further include:
[0261] The target layout update module is used to update the target button layout based on the user's historical operation information.
[0262] In some optional embodiments of the present disclosure, the target layout update module may include:
[0263] An operation center determination module, configured to determine the operation center of each virtual key in the target key layout based on the user's historical operation information;
[0264] The virtual key adjustment module is used to adjust the corresponding virtual key according to the operation center and update the target key layout to shorten the distance between the key center of the virtual key and the corresponding operation center.
[0265] In some optional embodiments of the present disclosure, the virtual key adjustment module may include:
[0266] The first moving module is used to move the virtual key to the corresponding operation center so that the key center of the virtual key coincides with the corresponding operation center.
[0267] In some optional embodiments of the present disclosure, the first conflict determination module is used to determine the adjustment vector of each conflicting key based on the operation center and the original key center of each conflicting key if there is a conflict between the moved virtual keys. The starting point of the adjustment vector is the operation center of the corresponding conflicting key, and the end point is the original key center of the corresponding conflicting key; the first conflict processing module is used to move each conflicting key along the direction of the corresponding adjustment vector until the conflict disappears.
[0268] In some optional embodiments of the present disclosure, the first conflict handling module may include:
[0269] A movement speed determination module, used to determine the movement speed of each conflicting key;
[0270] A movement speed-based movement module is used to move each conflicting key simultaneously along the direction of the corresponding adjustment vector at the corresponding movement speed;
[0271] The stop movement module is used to stop moving the target conflict key when the conflict of the target conflict key disappears.
[0272] In some optional embodiments of the present disclosure, the movement speed determination module can be specifically used to determine the movement speed corresponding to each conflicting key based on the length of the adjustment vector of each conflicting key; the movement speed is proportional to the length of the corresponding adjustment vector, and the movement speed ratio of different conflicting keys is equal to the length ratio of the corresponding adjustment vector.
[0273] In some optional embodiments of the present disclosure, the virtual key adjustment module may further include:
[0274] The second conflict processing module is configured to cut each conflicting key if there is a conflict between the moved virtual keys, so as to separate the conflicting keys.
[0275] In some optional embodiments of the present disclosure, the second conflict handling module may include:
[0276] A connection determination module, configured to determine a connection between two conflicting keys according to the operation centers of the two conflicting keys;
[0277] Based on the connection cutting module, it is used to cut two conflicting keys according to the perpendicular median of the connection to separate the two conflicting keys.
[0278] In some optional embodiments of the present disclosure, the line-based cutting module may include:
[0279] A first cutting line determining module is configured to translate the perpendicular midline of the connecting line toward the operation center of the first conflicting key of the two conflicting keys by a preset distance to obtain a first cutting line;
[0280] A second cutting line determining module is configured to translate the perpendicular midline of the connecting line toward the operation center of the second conflicting key of the two conflicting keys by a preset distance to obtain a second cutting line;
[0281] The cutting and separating module is used to cut the first conflicting key along a first cutting line and cut the second conflicting key along a second cutting line, so as to separate the first conflicting key from the second conflicting key.
[0282] In some optional embodiments of the present disclosure, the virtual key adjustment module may include:
[0283] a movement vector determination module, configured to determine a movement vector for each virtual key based on the original key center and the operation center of each virtual key, wherein the starting point of the movement vector is the original key center of the corresponding virtual key and the end point is the operation center of the corresponding virtual key;
[0284] Based on the motion vector adjustment module, it is used to move each virtual key along the direction of the corresponding motion vector and ensure that the adjusted virtual keys do not conflict with each other.
[0285] In some optional embodiments of the present disclosure, the motion vector-based adjustment module may include:
[0286] An adjustment speed determination module, used to determine the adjustment speed of each virtual key;
[0287] Based on the adjustment speed adjustment module, it is used to move each virtual key simultaneously along the direction of the corresponding movement vector according to the corresponding adjustment speed, and ensure that the adjusted virtual keys do not conflict with each other.
[0288] In some optional embodiments of the present disclosure, the adjustment speed determination module is specifically used to determine the adjustment speed corresponding to each virtual key based on the length of the movement vector of each virtual key; the adjustment speed is proportional to the length of the corresponding movement vector, and the adjustment speed ratio of different virtual keys is equal to the length ratio of the corresponding movement vectors.
[0289] In some optional embodiments of the present disclosure, the virtual key adjustment module may specifically adjust the corresponding virtual key according to the operation center when the distance between the original key center of the virtual key and the corresponding operation center is greater than a preset distance threshold, and update the target key layout to shorten the distance between the key center of the virtual key and the corresponding operation center.
[0290] In some optional embodiments of the present disclosure, the virtual key adjustment module may include:
[0291] The merging processing module is used to merge the virtual key and the operation area to obtain a new virtual key when the operation area corresponding to the operation center is not within the corresponding virtual key.
[0292] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0293] The present disclosure also discloses an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, the steps of the above virtual key adjustment method are implemented.
[0294] The embodiment of the present disclosure further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method for adjusting the virtual keys are implemented.
[0295] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0296] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, devices, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0297] The embodiments of the present disclosure are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0298] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0299] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce computer-implemented processing, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0300] The embodiments of the present disclosure may involve the use of user data. In actual applications, user-specific personal data can be used in the scenarios described herein within the scope permitted by applicable laws and regulations, subject to compliance with applicable laws and regulations of the country (for example, with the user's explicit consent, effective notification to the user, etc.).
[0301] Although the preferred embodiments of the present disclosure have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present disclosure.
[0302] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.
[0303] The above is a detailed introduction to the virtual key adjustment method and device, electronic device, and storage medium provided by the present disclosure. Specific examples are used in this article to illustrate the principles and implementation methods of the present disclosure. The description of the above embodiments is only used to help understand the method of the present disclosure and its core ideas. At the same time, for general technical personnel in this field, based on the ideas of the present disclosure, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present disclosure.
Claims
1. A method for adjusting virtual keys, wherein a terminal device provides a graphical user interface, wherein the content displayed by the graphical user interface includes at least a game screen and a plurality of initial virtual keys, and the method comprises: In response to the screen projection instruction, determining a target key layout associated with the user; The game screen is displayed in a preset screen projection device, and the initial virtual keys are adjusted according to the target key layout.
2. The method according to claim 1, wherein: The determining of the target key layout associated with the user comprises: When the graphical user interface displays a key adjustment interface, in response to a setting operation of a virtual key, determining a target position of each virtual key; A target key layout associated with the user is determined according to the target positions of the respective virtual keys.
3. The method according to claim 2, wherein: When the key adjustment interface is displayed on the graphical user interface, in response to the setting operation of the virtual key, determining the target position of each virtual key includes: When the graphical user interface displays the button adjustment interface, corresponding setting prompt information is displayed in sequence according to the preset setting order of the multiple virtual buttons; In response to the triggering operation for setting the prompt information, determining a preset position of the corresponding virtual key; If the virtual keys do not conflict with each other at the corresponding preset positions, the preset positions of the virtual keys are determined as the target positions of the virtual keys.
4. The method according to claim 3, wherein: The method further comprises: If there are at least two virtual keys conflicting at the corresponding preset positions, each conflicting virtual key is cut to separate the conflicting virtual keys to obtain the target position of the conflicting virtual key.
5. The method according to claim 4, wherein: The step of cutting each conflicting virtual key to separate the conflicting virtual keys includes: Determining the preset key center of each conflicting virtual key; Determining a first connection line between two conflicting virtual keys according to preset key centers of the two conflicting virtual keys; The perpendicular midline of the first connecting line is translated by a first preset distance toward the preset key center direction of the first conflicting virtual key of the two conflicting virtual keys to obtain a first parallel line; The perpendicular midline of the first connecting line is translated by a second preset distance toward the preset key center direction of the second conflicting virtual key of the two conflicting virtual keys to obtain a second parallel line; The first conflicting virtual key is cut according to the first parallel lines, and the second conflicting virtual key is cut according to the second parallel lines, so that the first conflicting virtual key and the second conflicting virtual key are separated.
6. The method according to claim 2, wherein: When the key adjustment interface is displayed on the graphical user interface, in response to the setting operation of the virtual key, determining the target position of each virtual key includes: When the graphical user interface displays the button adjustment interface, corresponding setting prompt information is displayed in sequence according to the preset setting order of the multiple virtual buttons; In response to a trigger operation for the currently set prompt information, determining a preset touch point of the current virtual key; When the current setting prompt information is the first setting prompt information, determining the preset position of the current virtual key according to the preset area where the preset touch point of the current virtual key is located; When the current setting prompt information is not the first setting prompt information, if the preset touch point of the current virtual key is in the previous virtual key, determining a second connection line between the preset touch point of the current virtual key and the preset touch point of the previous virtual key; The previous virtual key is cut according to the perpendicular midline of the second connecting line to obtain a first key area including a preset touch point of the previous virtual key and a second key area including a preset touch point of the current virtual key; updating the preset position of the previous virtual key according to the first key area, and determining the preset position of the current virtual key according to the second key area; When the preset position of the virtual key corresponding to the last setting prompt information is determined, the final preset position of each virtual key is determined as the target position of each virtual key.
7. The method according to claim 6, after the preset position of the virtual key corresponding to the last setting prompt information is determined, before determining the final preset position of each virtual key as the target position of each virtual key, the method further comprises: When the current setting prompt information is not the first setting prompt information, if the preset touch point of the current virtual key is in a gap between two previous virtual keys located in the same preset area, a third connection line between the preset touch point of the current virtual key and the preset touch point of a first previous virtual key of the two previous virtual keys is determined, and a fourth connection line between the preset touch point of the current virtual key and the preset touch point of a second previous virtual key of the two previous virtual keys is determined; The first previous virtual key is divided according to the perpendicular midline of the third connecting line to obtain a third key area and a fourth key area including a preset touch point of the first previous virtual key; The second previous virtual key is divided according to the perpendicular midline of the fourth connecting line to obtain a fifth key area and a sixth key area including a preset touch point of the second previous virtual key; The preset area of the current virtual key is determined according to the third key area and the fifth key area, and the preset position of the first previous virtual key is updated according to the fourth key area, and the preset position of the second previous virtual key is updated according to the sixth key area.
8. The method according to claim 2, wherein: When the key adjustment interface is displayed on the graphical user interface, in response to the setting operation of the virtual key, determining the target position of each virtual key includes: When the screen projection instruction is the first screen projection instruction, displaying a button adjustment interface on the graphical user interface; When the graphical user interface displays a key adjustment interface, in response to a setting operation of a virtual key, determining a target position of each virtual key; After determining the target key layout associated with the user according to the target positions of the virtual keys, the method further includes: The target button layout is stored in a preset storage space.
9. The method according to claim 8, wherein: The method further comprises: When the screen projection instruction is not the first screen projection instruction, the target button layout associated with the user is obtained from the preset storage space.
10. The method according to any one of claims 1 to 9, wherein: The displaying of the game screen in the preset screen projection device and adjusting the initial virtual keys according to the target key layout also includes: A virtual key thumbnail is displayed in the preset screen projection device, and the virtual key thumbnail is used to show the relative position relationship of each virtual key in the target key layout.
11. The method according to claim 10, wherein: The method further comprises: In response to a triggering operation acting on a target virtual key in the target key layout, the target virtual key is identified in the virtual key thumbnail.
12. The method according to any one of claims 3 to 7, wherein: The multiple initial virtual keys displayed on the graphical user interface include first-type virtual keys and second-type virtual keys. When the key adjustment interface is displayed on the graphical user interface, corresponding setting prompt information is displayed in sequence according to a preset setting sequence of the multiple virtual keys, including: When the graphical user interface displays a button adjustment interface, displaying the first type of virtual buttons in a preset edge area of the button adjustment interface; According to the preset setting order of the multiple virtual keys in the second type of virtual keys, corresponding setting prompt information is displayed in sequence.
13. The method according to any one of claims 1 to 9, wherein: The method further comprises: The target button layout is updated according to the historical operation information of the user.
14. The method according to claim 13, wherein: The updating of the target button layout according to the historical operation information of the user includes: Determining the operation center of each virtual key in the target key layout according to the user's historical operation information; The corresponding virtual key is adjusted according to the operation center, and the target key layout is updated to shorten the distance between the key center of the virtual key and the corresponding operation center.
15. The method according to claim 14, wherein: The adjusting the corresponding virtual key according to the operation center and updating the target key layout to shorten the distance between the key center of the virtual key and the corresponding operation center includes: The virtual key is moved toward the corresponding operation center so that the key center of the virtual key coincides with the corresponding operation center.
16. The method according to claim 15, wherein: After moving the virtual key to the corresponding operation center so that the key center of the virtual key coincides with the corresponding operation center, the method further includes: If there is a conflict between the moved virtual keys, an adjustment vector of each conflicting key is determined according to the operation center and the original key center of each conflicting key, wherein the starting point of the adjustment vector is the operation center of the corresponding conflicting key and the end point is the original key center of the corresponding conflicting key; Each of the conflicting keys is moved along the direction of the corresponding adjustment vector until the conflict disappears.
17. The method according to claim 16, wherein: The step of moving each of the conflicting keys along the direction of the corresponding adjustment vector until the conflict disappears includes: Determining the moving speed of each of the conflicting keys; Moving each of the conflicting keys simultaneously along the direction of the corresponding adjustment vector at a corresponding moving speed; When the conflict of the target conflicting key disappears, the moving of the target conflicting key is stopped.
18. The method according to claim 17, wherein: The step of determining the moving speed of each of the conflicting keys comprises: According to the length of the adjustment vector of each of the conflicting keys, the movement speed corresponding to each of the conflicting keys is determined; The speed is proportional to the length of the corresponding adjustment vector, and the moving speed ratio of different conflicting keys is equal to the length ratio of the corresponding adjustment vector.
19. The method according to claim 15, wherein: After moving the virtual key to the corresponding operation center so that the key center of the virtual key coincides with the corresponding operation center, the method further includes: If there is a conflict between the moved virtual keys, each conflicting key is cut to separate the conflicting keys.
20. The method according to claim 19, wherein: The step of cutting each conflicting key to separate the conflicting keys includes: Determining a connection line between the two conflicting keys according to the operation centers of the two conflicting keys; The two conflicting keys are cut according to the perpendicular midline of the connecting line to separate the two conflicting keys.
21. The method according to claim 20, wherein: The step of cutting the two conflicting keys according to the perpendicular midline of the connecting line to separate the two conflicting keys includes: The perpendicular midline of the connecting line is translated toward the operation center direction of the first conflicting key of the two conflicting keys by a preset distance to obtain a first cutting line; The perpendicular midline of the connecting line is translated toward the operation center direction of the second conflicting key of the two conflicting keys by a preset distance to obtain a second cutting line; The first conflicting key is cut along the first cutting line, and the second conflicting key is cut along the second cutting line, so that the first conflicting key and the second conflicting key are separated.
22. The method according to claim 14, wherein: The adjusting the corresponding virtual key according to the operation center and updating the target key layout to shorten the distance between the key center of the virtual key and the corresponding operation center includes: Determine a movement vector of each virtual key according to an original key center and an operation center of each virtual key, wherein a starting point of the movement vector is an original key center of the corresponding virtual key, and an end point is an operation center of the corresponding virtual key; Each of the virtual keys is moved along the direction of the corresponding movement vector, and it is ensured that the adjusted virtual keys do not conflict with each other.
23. The method according to claim 22, wherein: Moving each of the virtual keys along the direction of the corresponding movement vector to shorten the distance between the key center of the virtual key and the corresponding operation center includes: Determining an adjustment speed of each of the virtual keys; Each of the virtual keys is moved simultaneously along the direction of the corresponding movement vector at a corresponding adjustment speed, and it is ensured that the adjusted virtual keys do not conflict with each other.
24. The method according to claim 23, wherein: The determining the adjustment speed of each of the virtual keys includes: The adjustment speed corresponding to each virtual key is determined according to the length of the movement vector of each virtual key; the adjustment speed is proportional to the length of the corresponding movement vector, and the adjustment speed ratio of different virtual keys is equal to the length ratio of the corresponding movement vector.
25. The method of claim 14, wherein: The adjusting the corresponding virtual key according to the operation center and updating the target key layout to shorten the distance between the key center of the virtual key and the corresponding operation center includes: When the distance between the original key center of the virtual key and the corresponding operation center is greater than a preset distance threshold, the corresponding virtual key is adjusted according to the operation center, and the target key layout is updated to shorten the distance between the key center of the virtual key and the corresponding operation center.
26. The method of claim 14, wherein: The adjusting the corresponding virtual key according to the operation center and updating the target key layout to shorten the distance between the key center of the virtual key and the corresponding operation center includes: When the operation area corresponding to the operation center is not within the corresponding virtual key, the virtual key and the operation area are merged to obtain a new virtual key.
27. A virtual key adjustment device, providing a graphical user interface through a terminal device, wherein the content displayed by the graphical user interface includes at least a game screen and a plurality of initial virtual keys, the device comprising: A key layout determination module is configured to determine a target key layout associated with a user in response to a screen projection instruction; The virtual key adjustment module is configured to display the game screen in a preset screen projection device and adjust the initial virtual keys according to the target key layout.
28. An electronic device, comprising a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the virtual key adjustment method as described in any one of claims 1 to 26.
29. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the virtual key adjustment method according to any one of claims 1 to 26.
Citation Information
Patent Citations
Screen projection method and device
CN112988102A
Game control processing method and device thereof, terminal equipment and readable storage medium
CN113769375A
Electronic equipment, screen projection method thereof and medium
CN114356258A
Virtual key adjustment method and device, electronic equipment and storage medium
CN116159301A
Virtual key adjustment method and device, electronic equipment and storage medium
CN116637356A
