[go: up one dir, main page]

CN109999486B - Control method and device of gamepad and storage medium - Google Patents

Control method and device of gamepad and storage medium Download PDF

Info

Publication number
CN109999486B
CN109999486B CN201910253426.0A CN201910253426A CN109999486B CN 109999486 B CN109999486 B CN 109999486B CN 201910253426 A CN201910253426 A CN 201910253426A CN 109999486 B CN109999486 B CN 109999486B
Authority
CN
China
Prior art keywords
gamepad
electronic device
magnetic sensor
instruction
electronic equipment
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910253426.0A
Other languages
Chinese (zh)
Other versions
CN109999486A (en
Inventor
代仁军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201910253426.0A priority Critical patent/CN109999486B/en
Publication of CN109999486A publication Critical patent/CN109999486A/en
Priority to PCT/CN2020/081327 priority patent/WO2020200025A1/en
Application granted granted Critical
Publication of CN109999486B publication Critical patent/CN109999486B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/20Input arrangements for video game devices
    • A63F13/23Input arrangements for video game devices for interfacing with the game device, e.g. specific interfaces between game controller and console
    • A63F13/235Input arrangements for video game devices for interfacing with the game device, e.g. specific interfaces between game controller and console using a wireless connection, e.g. infrared or piconet
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/20Input arrangements for video game devices
    • A63F13/24Constructional details thereof, e.g. game controllers with detachable joystick handles
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/10Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by input arrangements for converting player-generated signals into game device control signals
    • A63F2300/1025Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by input arrangements for converting player-generated signals into game device control signals details of the interface with the game device, e.g. USB version detection
    • A63F2300/1031Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by input arrangements for converting player-generated signals into game device control signals details of the interface with the game device, e.g. USB version detection using a wireless connection, e.g. Bluetooth, infrared connections
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/10Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by input arrangements for converting player-generated signals into game device control signals
    • A63F2300/1043Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by input arrangements for converting player-generated signals into game device control signals being characterized by constructional details

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • User Interface Of Digital Computer (AREA)
  • Position Input By Displaying (AREA)

Abstract

本申请提供了一种游戏手柄的控制方法,游戏手柄与所连接的电子设备的位置关系可以为第一位置关系,也可以为第二位置关系。当游戏手柄与所连接的电子设备的位置关系为第一位置关系或第二位置关系时,可以对应不同的指令。这样,游戏手柄既可以安装在电子设备的第一侧,触发电子设备执行第一指令;也可以安装在电子设备的第二侧,触发电子设备执行第二指令。同一个游戏手柄可以安装在电子设备的不同位置使用,从而降低用户的使用成本,以及生产商的生产和维护成本。

Figure 201910253426

The present application provides a method for controlling a gamepad. The positional relationship between the gamepad and the connected electronic device may be a first positional relationship or a second positional relationship. When the positional relationship between the gamepad and the connected electronic device is the first positional relationship or the second positional relationship, different instructions may be corresponding. In this way, the gamepad can be installed on the first side of the electronic device to trigger the electronic device to execute the first instruction; or can be installed on the second side of the electronic device to trigger the electronic device to execute the second instruction. The same gamepad can be installed and used in different positions of electronic equipment, thereby reducing the user's use cost and the manufacturer's production and maintenance cost.

Figure 201910253426

Description

一种游戏手柄的控制方法、设备和存储介质A gamepad control method, device and storage medium

技术领域technical field

本申请涉及通信技术领域,尤其涉及一种游戏手柄的控制方法及设备。The present application relates to the field of communication technologies, and in particular, to a control method and device for a game handle.

背景技术Background technique

游戏手柄是一种电子设备的输入设备,用户在玩电子设备的游戏时,可以通过操纵游戏手柄的按钮等,实现对游戏中的模拟角色等的控制。传统的握持式游戏手柄的使用体验比较差,越来越多的用户选择使用单边手柄。A gamepad is an input device of an electronic device. When a user plays a game on the electronic device, the user can control the simulated characters in the game by manipulating the buttons of the gamepad, etc. The experience of using traditional handheld gamepads is relatively poor, and more and more users choose to use single-sided gamepads.

通常,单边手柄安装在电子设备的一侧,比如,单边手柄可以安装在手机横屏使用时的左侧。用户的一只手操作单边手柄来操控游戏,另一只手通过触摸屏幕来操控游戏。有时,用户期望使用两个单边手柄实现双边组合,以实现不触摸屏幕,使用两个单边手柄操控游戏。一般的,双边手柄的左右手柄的功能不一样。用户有使用双边手柄的需求时,需要购买两个不同的单边手柄,增加了使用成本。游戏手柄生产商也需要准备两套不同的模具,分别生产左、右手柄,增加生产和维护成本。Usually, the unilateral handle is installed on one side of the electronic device. For example, the unilateral handle can be installed on the left side of the mobile phone when the mobile phone is used in landscape orientation. One hand of the user operates the single-sided handle to control the game, and the other hand controls the game by touching the screen. Sometimes, users want to use two single-sided controllers to achieve a bilateral combination, so as to control the game with two single-sided controllers without touching the screen. In general, the functions of the left and right handles of the bilateral handles are different. When users need to use bilateral handles, they need to purchase two different unilateral handles, which increases the cost of use. Game controller manufacturers also need to prepare two different sets of molds to produce the left and right controllers respectively, which increases production and maintenance costs.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供一种游戏手柄的控制方法,一个单边手柄可以单独使用;也可以使用两个相同的单边手柄组合使用,实现双边手柄的功能;从而降低用户的使用成本,以及生产商的生产和维护成本。Embodiments of the present invention provide a method for controlling a gamepad. One unilateral handle can be used alone; or two identical unilateral handles can be used in combination to realize the function of a bilateral handle; thereby reducing the use cost of users and the production and maintenance costs.

第一方面,本申请实施例提供一种游戏手柄的控制方法,该方法可以包括:建立游戏手柄与电子设备的连接;检测游戏手柄与所连接电子设备的位置关系;响应于检测到游戏手柄与所连接电子设备的位置关系为第一位置关系,则游戏手柄的第一操作键对应第一指令;响应于检测到游戏手柄与所连接电子设备的位置关系为第二位置关系,则游戏手柄的第一操作键对应第二指令;其中,第一位置关系与第二位置关系不同,第一指令与第二指令不同。In a first aspect, an embodiment of the present application provides a method for controlling a gamepad, the method may include: establishing a connection between the gamepad and an electronic device; detecting the positional relationship between the gamepad and the connected electronic device; The positional relationship of the connected electronic device is the first positional relationship, then the first operation key of the gamepad corresponds to the first command; in response to detecting that the positional relationship between the gamepad and the connected electronic device is the second positional relationship, the gamepad The first operation key corresponds to the second command; wherein, the first positional relationship is different from the second positional relationship, and the first command is different from the second command.

在该方法中,游戏手柄可以连接在电子设备的不同位置,从而其操作键对应不同的指令。这样,同一个游戏手柄可以安装在电子设备的不同位置,实现不同的功能。而且,可以将两个游戏手柄组合使用。游戏手柄的使用方式灵活,同一个游戏手柄可以实现不同的功能。降低了用户的使用成本,以及生产商的生产和维护成本。In this method, the gamepad can be connected to different positions of the electronic device, so that its operation keys correspond to different commands. In this way, the same gamepad can be installed in different positions of the electronic device to realize different functions. Also, two gamepads can be used in combination. The use of the gamepad is flexible, and the same gamepad can achieve different functions. Reduce the user's cost of use, as well as the manufacturer's production and maintenance costs.

在一种可能的设计中,第一位置关系为游戏手柄安装在电子设备的第一侧;第二位置关系为游戏手柄安装在电子设备的第二侧;其中,第一侧与第二侧不同。In a possible design, the first positional relationship is that the gamepad is installed on the first side of the electronic device; the second positional relationship is that the gamepad is installed on the second side of the electronic device; wherein the first side is different from the second side .

在一种可能的设计中,游戏手柄包括第一磁传感器和第二磁传感器,第一磁传感器和第二磁传感器分别设置在游戏手柄的左右两侧。若确定第一磁传感器有输出信号,则确定游戏手柄安装在电子设备的第一侧;若确定第二磁传感器有输出信号,则确定游戏手柄安装在电子设备的第二侧。在该方式中,通过检测安装在游戏手柄左右两侧的磁传感器的输出信号,判断游戏手柄安装在电子设备的哪一侧。In a possible design, the game handle includes a first magnetic sensor and a second magnetic sensor, and the first magnetic sensor and the second magnetic sensor are respectively disposed on the left and right sides of the game handle. If it is determined that the first magnetic sensor has an output signal, it is determined that the gamepad is installed on the first side of the electronic device; if it is determined that the second magnetic sensor has an output signal, it is determined that the gamepad is installed on the second side of the electronic device. In this method, by detecting the output signals of the magnetic sensors installed on the left and right sides of the game handle, it is determined on which side of the electronic device the game handle is installed.

在一种可能的设计中,游戏手柄包括拨档开关,检测拨档开关的当前档位;响应于检测到拨档开关位于第一档位,则游戏手柄的第一操作键对应第一指令;响应于检测到拨档开关位于第二档位,则游戏手柄的第一操作键对应第二指令。在该方式中,通过检测拨档开关的当前档位,判断游戏手柄安装在电子设备的哪一侧。In a possible design, the game handle includes a shift switch, and the current gear position of the shift switch is detected; in response to detecting that the shift switch is in the first gear position, the first operation key of the game handle corresponds to the first command; In response to detecting that the shift switch is in the second gear, the first operation key of the game handle corresponds to the second command. In this manner, by detecting the current gear position of the toggle switch, it is determined which side of the electronic device the gamepad is installed on.

在一种可能的设计中,响应于检测到游戏手柄与所连接电子设备的位置关系为第三位置关系,则游戏手柄的第一操作键对应第三指令。在该方式中,游戏手柄可以连接在电子设备的第三位置使用。游戏手柄的使用方式更灵活。In a possible design, in response to detecting that the positional relationship between the gamepad and the connected electronic device is the third positional relationship, the first operation key of the gamepad corresponds to the third instruction. In this way, the gamepad can be connected to the third position of the electronic device for use. Gamepad usage is more flexible.

在一种可能的设计中,在游戏手柄已开机的情况下,如果确定游戏手柄未安装在电子设备的第一侧或第二侧,则确定游戏手柄与所连接电子设备的位置关系为第三位置关系;其中,第一侧与第二侧不同。该方式提供了一种确定游戏手柄与所连接电子设备的位置关系为第三位置关系的具体方法。In a possible design, when the gamepad is turned on, if it is determined that the gamepad is not installed on the first side or the second side of the electronic device, the positional relationship between the gamepad and the connected electronic device is determined to be the third Positional relationship; wherein the first side is different from the second side. This method provides a specific method for determining that the positional relationship between the gamepad and the connected electronic device is the third positional relationship.

在一种可能的设计中,游戏手柄包括第一磁传感器和第二磁传感器,第一磁传感器和第二磁传感器分别设置在游戏手柄的左右两侧;若确定第一磁传感器和第二磁传感器都不存在输出信号,则确定游戏手柄与所连接电子设备的位置关系为第三位置关系。In a possible design, the game handle includes a first magnetic sensor and a second magnetic sensor, and the first magnetic sensor and the second magnetic sensor are respectively arranged on the left and right sides of the game handle; if it is determined that the first magnetic sensor and the second magnetic sensor are If there is no output signal from the sensor, it is determined that the positional relationship between the gamepad and the connected electronic device is the third positional relationship.

在一种可能的设计中,响应于检测到拨档开关位于第三档位,则游戏手柄的第一操作键对应第三指令。In a possible design, in response to detecting that the shift switch is in the third gear, the first operation key of the game handle corresponds to the third command.

第二方面,本申请实施例提供一种游戏手柄,该游戏手柄可以包括一个或多个处理器,存储器。该处理器被配置为支持该游戏手柄执行上述第一方面方法中相应的功能。存储器用于与处理器耦合,其保存该音箱必要的程序指令和数据。另外该游戏手柄中还可以包括通信接口,用于支持该游戏手柄与其他电子设备之间的通信。该通信接口可以是收发器或收发电路。该游戏手柄中还可以包括至少一个按键和/或摇杆。In a second aspect, an embodiment of the present application provides a gamepad, where the gamepad may include one or more processors and memories. The processor is configured to support the gamepad to perform the corresponding functions in the method of the first aspect. A memory is used to couple with the processor, which holds the necessary program instructions and data for the loudspeaker. In addition, the gamepad may further include a communication interface for supporting communication between the gamepad and other electronic devices. The communication interface may be a transceiver or a transceiver circuit. The game handle may also include at least one button and/or a joystick.

在一种可能的设计中,通信接口用于建立游戏手柄与电子设备的连接;处理器用于检测游戏手柄与所连接电子设备的位置关系;响应于检测到游戏手柄与所连接电子设备的位置关系为第一位置关系,则确定游戏手柄的第一操作键对应第一指令;响应于检测到游戏手柄与所连接电子设备的位置关系为第二位置关系,则确定游戏手柄的第一操作键对应第二指令;其中,第一位置关系与第二位置关系不同,第一指令与第二指令不同。至少一个按钮和/或摇杆,用于接收用户的输入,以控制显示在电子设备上的虚拟对象。In a possible design, the communication interface is used to establish a connection between the gamepad and the electronic device; the processor is used to detect the positional relationship between the gamepad and the connected electronic device; in response to detecting the positional relationship between the gamepad and the connected electronic device is the first positional relationship, then it is determined that the first operation key of the gamepad corresponds to the first instruction; in response to detecting that the positional relationship between the gamepad and the connected electronic device is the second positional relationship, it is determined that the first operation key of the gamepad corresponds to the first instruction; The second command; wherein, the first positional relationship is different from the second positional relationship, and the first command is different from the second command. At least one button and/or joystick for receiving user input to control virtual objects displayed on the electronic device.

在一种可能的设计中,第一位置关系为游戏手柄安装在电子设备的第一侧;第二位置关系为游戏手柄安装在电子设备的第二侧;其中,第一侧与第二侧不同。In a possible design, the first positional relationship is that the gamepad is installed on the first side of the electronic device; the second positional relationship is that the gamepad is installed on the second side of the electronic device; wherein the first side is different from the second side .

在一种可能的设计中,游戏手柄包括第一磁传感器和第二磁传感器,第一磁传感器和第二磁传感器分别设置在游戏手柄的左右两侧,检测游戏手柄与所连接电子设备的位置关系包括:确定第一磁传感器和第二磁传感器的输出信号;若确定第一磁传感器有输出信号,则确定游戏手柄安装在电子设备的第一侧;若确定第二磁传感器有输出信号,则确定游戏手柄安装在电子设备的第二侧。In a possible design, the gamepad includes a first magnetic sensor and a second magnetic sensor. The first magnetic sensor and the second magnetic sensor are respectively arranged on the left and right sides of the gamepad to detect the position of the gamepad and the connected electronic device. The relationship includes: determining the output signals of the first magnetic sensor and the second magnetic sensor; if determining that the first magnetic sensor has an output signal, then determining that the gamepad is installed on the first side of the electronic device; if determining that the second magnetic sensor has an output signal, Then it is determined that the gamepad is installed on the second side of the electronic device.

在一种可能的设计中,游戏手柄包括拨档开关,检测游戏手柄与所连接电子设备的位置关系;响应于检测到游戏手柄与所连接电子设备的位置关系为第一位置关系,则确定游戏手柄的第一操作键对应第一指令;响应于检测到游戏手柄与所连接电子设备的位置关系为第二位置关系,则确定游戏手柄的第一操作键对应第二指令包括:检测拨档开关的当前档位;响应于检测到拨档开关位于第一档位,则确定游戏手柄的第一操作键对应第一指令;响应于检测到拨档开关位于第二档位,则确定游戏手柄的第一操作键对应第二指令。In a possible design, the gamepad includes a toggle switch to detect the positional relationship between the gamepad and the connected electronic device; in response to detecting that the positional relationship between the gamepad and the connected electronic device is the first positional relationship, determine the game The first operation key of the handle corresponds to the first instruction; in response to detecting that the positional relationship between the game handle and the connected electronic device is the second positional relationship, determining that the first operation key of the game handle corresponds to the second instruction includes: detecting the toggle switch in response to detecting that the shift switch is in the first gear, determine that the first operation key of the joystick corresponds to the first command; in response to detecting that the shift switch is in the second gear, determine the The first operation key corresponds to the second command.

在一种可能的设计中,处理器还用于响应于检测到游戏手柄与所连接电子设备的位置关系为第三位置关系,则确定游戏手柄的第一操作键对应第三指令。In a possible design, the processor is further configured to, in response to detecting that the positional relationship between the gamepad and the connected electronic device is a third positional relationship, determine that the first operation key of the gamepad corresponds to the third instruction.

在一种可能的设计中,在游戏手柄已开机的情况下,如果处理器确定游戏手柄未安装在电子设备的第一侧或第二侧,则确定游戏手柄与所连接电子设备的位置关系为第三位置关系;其中,第一侧与第二侧不同。In a possible design, when the gamepad is powered on, if the processor determines that the gamepad is not installed on the first side or the second side of the electronic device, the positional relationship between the gamepad and the connected electronic device is determined as: A third positional relationship; wherein the first side is different from the second side.

在一种可能的设计中,游戏手柄包括第一磁传感器和第二磁传感器,第一磁传感器和第二磁传感器分别设置在游戏手柄的左右两侧,处理器还用于确定第一磁传感器和第二磁传感器的输出信号;处理器还用于若确定第一磁传感器和第二磁传感器都不存在输出信号,则确定游戏手柄与所连接电子设备的位置关系为第三位置关系。In a possible design, the game handle includes a first magnetic sensor and a second magnetic sensor, the first magnetic sensor and the second magnetic sensor are respectively arranged on the left and right sides of the game handle, and the processor is further configured to determine the first magnetic sensor and the output signal of the second magnetic sensor; the processor is further configured to determine that the positional relationship between the gamepad and the connected electronic device is a third positional relationship if it is determined that neither the first magnetic sensor nor the second magnetic sensor has an output signal.

在一种可能的设计中,处理器还用于响应于检测到拨档开关位于第三档位,则确定游戏手柄的第一操作键对应第三指令。In a possible design, the processor is further configured to determine that the first operation key of the game handle corresponds to the third instruction in response to detecting that the shift switch is in the third gear position.

本申请实施例还提供一种计算机存储介质,该计算机存储介质包括计算机指令,当所述计算机指令在电子设备上运行时,使得电子设备执行如第一方面及其可能的设计方式所述的游戏手柄的控制方法。Embodiments of the present application further provide a computer storage medium, where the computer storage medium includes computer instructions, when the computer instructions are executed on the electronic device, the electronic device is made to execute the game described in the first aspect and its possible design manners The control method of the handle.

本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如第一方面及其可能的设计方式所述的游戏手柄的控制方法。Embodiments of the present application further provide a computer program product, which, when the computer program product runs on a computer, enables the computer to execute the method for controlling a gamepad according to the first aspect and possible design methods thereof.

本申请实施例还提供了一种芯片系统,该芯片系统中包括处理器,用于实现上述任一方面所述的方法。An embodiment of the present application further provides a chip system, where the chip system includes a processor for implementing the method described in any one of the foregoing aspects.

上述提供的任一种设备或计算机存储介质或计算机程序产品或芯片系统均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文提供的对应的方法中对应方案的有益效果,此处不再赘述。Any device or computer storage medium or computer program product or chip system provided above is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can be referred to in the corresponding method provided above. The beneficial effects of the corresponding solution will not be repeated here.

附图说明Description of drawings

图1为一种游戏手柄的使用实例示意图一;Fig. 1 is a schematic diagram of a use example of a game handle;

图2为一种游戏手柄的使用实例示意图二;Fig. 2 is a kind of use example schematic diagram two of a game handle;

图3为本申请实施例提供的游戏手柄的控制方法的一种场景实例示意图一;3 is a schematic diagram 1 of a scene example of a method for controlling a gamepad provided by an embodiment of the present application;

图4为本申请实施例提供的游戏手柄的控制方法所适用的一种系统框架示意图;4 is a schematic diagram of a system framework to which the method for controlling a gamepad provided by an embodiment of the present application is applied;

图5为本申请实施例提供的一种电子设备的硬件结构的组成示意图;5 is a schematic composition diagram of a hardware structure of an electronic device provided by an embodiment of the present application;

图6为本申请实施例提供的一种游戏手柄的硬件结构的组成示意图;6 is a schematic composition diagram of a hardware structure of a game handle provided by an embodiment of the present application;

图7为本申请实施例提供的游戏手柄的控制方法的一种场景实例示意图二;FIG. 7 is a schematic diagram 2 of a scene example of a method for controlling a gamepad provided by an embodiment of the present application;

图8为一种霍尔传感器电路示意图;8 is a schematic diagram of a Hall sensor circuit;

图9A为本申请实施例提供的一种游戏手柄的磁传感器和电子设备的磁体的相对位置示意图一;9A is a schematic diagram 1 of the relative positions of a magnetic sensor of a game handle and a magnet of an electronic device according to an embodiment of the application;

图9B为本申请实施例提供的一种游戏手柄的磁传感器和电子设备的磁体的相对位置示意图二;9B is a second schematic diagram of the relative positions of a magnetic sensor of a game handle and a magnet of an electronic device according to an embodiment of the application;

图10为本申请实施例提供的一种游戏手柄的拨档开关结构示意图;10 is a schematic structural diagram of a toggle switch of a game handle provided by an embodiment of the application;

图11为本申请实施例提供的游戏手柄的控制方法的一种场景实例示意图三;11 is a schematic diagram 3 of a scene example of a method for controlling a gamepad according to an embodiment of the present application;

图12A为本申请实施例提供的游戏手柄的控制方法的一种场景实例示意图四;12A is a fourth schematic diagram of a scenario example of a method for controlling a gamepad provided by an embodiment of the present application;

图12B为本申请实施例提供的游戏手柄的控制方法的一种场景实例示意图五;12B is a schematic diagram 5 of a scene example of a method for controlling a gamepad provided by an embodiment of the present application;

图13为本申请实施例提供的游戏手柄的控制方法的一种场景实例示意图六;13 is a sixth schematic diagram of a scene example of a method for controlling a gamepad provided by an embodiment of the present application;

图14为本申请实施例提供的一种系统框架实例示意图一;FIG. 14 is a schematic diagram 1 of an example of a system framework provided by an embodiment of the present application;

图15为本申请实施例提供的一种系统框架实例示意图二。FIG. 15 is a second schematic diagram of an example of a system framework provided by an embodiment of the present application.

具体实施方式Detailed ways

用户在玩电子设备的游戏时,可以通过操纵游戏手柄的按键,摇杆等,实现对游戏中的模拟角色等的控制。以下以电子设备是手机为例进行说明。When a user is playing a game on an electronic device, he or she can control the simulated characters and the like in the game by manipulating buttons, joysticks, etc. of the gamepad. In the following, the electronic device is a mobile phone as an example for description.

传统的游戏手柄一般分为左右两侧。需要说明的是,本申请实施例中所述左、右,以用户面向手机的方位为准;也就是说,用户面向手机时,左手边为左侧,右手边为右侧。请参考图1,图1中游戏手柄为一种双边手柄。双边手柄的左侧手柄和右侧手柄的按键分布不同,左侧手柄的按键的功能与右侧手柄的按键的功能也不相同。比如,左侧手柄上的摇杆和按键用于控制游戏模拟角色的幅度较大的动作,右侧手柄上的摇杆和按键用于控制较精细的动作。示例性的,左侧手柄设置有摇杆1,右侧手柄上设置有摇杆6;摇杆1可以用于控制游戏模拟角色的行动方向,摇杆6可以用于控制游戏模拟角色的瞄准方向。Traditional gamepads are generally divided into left and right sides. It should be noted that the left and right described in the embodiments of the present application are based on the orientation of the user facing the mobile phone; that is, when the user faces the mobile phone, the left-hand side is the left side and the right-hand side is the right side. Please refer to FIG. 1 , the game handle in FIG. 1 is a bilateral handle. The buttons on the left handle and the right handle of the bilateral handle are distributed differently, and the functions of the buttons on the left handle are also different from those on the right handle. For example, the joystick and buttons on the left handle are used to control the larger movements of the game simulated character, and the joystick and buttons on the right handle are used to control finer movements. Exemplarily, a joystick 1 is provided on the left handle, and a joystick 6 is provided on the right handle; the joystick 1 can be used to control the action direction of the game simulation character, and the joystick 6 can be used to control the aiming direction of the game simulation character. .

越来越多的用户选择使用单边手柄。请参考图2,图2中游戏手柄为一种单边手柄。比如,单边手柄安装在手机左侧,手柄上的摇杆和按键用于控制游戏模拟角色的幅度较大的动作。用户的右手可以直接在屏幕上操作,控制游戏模拟角色的较精细的动作。More and more users choose to use single-sided handles. Please refer to FIG. 2 , the game handle in FIG. 2 is a single-sided handle. For example, the unilateral handle is installed on the left side of the mobile phone, and the joystick and buttons on the handle are used to control the larger movements of the simulated character in the game. The user's right hand can operate directly on the screen to control the finer movements of the game simulated character.

有时,用户期望将两个单边手柄组合使用,以实现不触摸屏幕,使用两个单边手柄实现双边手柄的功能来操控游戏。一般的,双边手柄的左右手柄的功能不一样,如图1中双边手柄。要将两个单边手柄组合使用,用户需要购买两个不同的单边手柄,增加了使用成本。游戏手柄生产商也需要准备两套不同的模具,分别生产左、右手柄,增加生产和维护成本。Sometimes, users expect to use two single-sided controllers in combination to control the game without touching the screen, and use two single-sided controllers to achieve the function of double-sided controllers. Generally, the functions of the left and right handles of the bilateral handle are different, as shown in Figure 1. To use two unilateral handles in combination, the user needs to purchase two different unilateral handles, which increases the use cost. Game controller manufacturers also need to prepare two different sets of molds to produce the left and right controllers respectively, which increases production and maintenance costs.

请参考图3,本申请实施例提供的游戏手柄的控制方法。当单边手柄安装在手机左侧,如图3的(a),单边手柄的摇杆和按键按照第一模式的设置执行。比如,单边手柄安装在手机左侧时,单边手柄上的摇杆和按键用于控制游戏模拟角色的幅度较大的动作。当单边手柄安装在手机右侧,如图3的(b),单边手柄的摇杆和按键按照第二模式的设置执行。比如,单边手柄安装在手机右侧时,单边手柄上的摇杆和按键用于控制较精细的动作。如图3的(c),将一个单边手柄安装在左侧,将另一个相同的单边手柄安装在右侧,则可以将两个单边手柄组合为双边手柄使用。Please refer to FIG. 3 , which shows a control method of a gamepad provided by an embodiment of the present application. When the unilateral handle is installed on the left side of the mobile phone, as shown in (a) of Figure 3, the joystick and buttons of the unilateral handle are executed according to the settings of the first mode. For example, when the unilateral handle is installed on the left side of the mobile phone, the joystick and buttons on the unilateral handle are used to control the larger movements of the game simulated character. When the unilateral handle is installed on the right side of the mobile phone, as shown in (b) of Figure 3, the joystick and buttons of the unilateral handle are executed according to the settings of the second mode. For example, when the unilateral handle is installed on the right side of the phone, the joystick and buttons on the unilateral handle are used to control finer movements. As shown in (c) of Figure 3, if one unilateral handle is installed on the left side, and another same unilateral handle is installed on the right side, the two unilateral handles can be combined into a bilateral handle.

请继续参考图3,如图3的(d),在一些实施例中,单边手柄还可以不安装在手机一侧使用,单边手柄的摇杆和按键按照第三模式的设置执行。单边手柄在第三模式的设置可以与第一模式或第二模式相同,也可以与第一模式或第二模式均不相同。比如,单边手柄可以不安装在手机一侧,而是由用户单独手持,用于遥控操作手机上的游戏。示例性的,单边手柄上的摇杆和按键用于模拟游戏中的手势。Please continue to refer to FIG. 3 , as shown in (d) of FIG. 3 , in some embodiments, the unilateral handle can also be used without being installed on one side of the mobile phone, and the joystick and buttons of the unilateral handle are executed according to the settings of the third mode. The setting of the unilateral handle in the third mode may be the same as the first mode or the second mode, or may be different from the first mode or the second mode. For example, the unilateral handle may not be installed on one side of the mobile phone, but be held by the user alone to remotely operate the game on the mobile phone. Exemplarily, joysticks and buttons on a single-sided controller are used to simulate in-game gestures.

本申请实施例提供的游戏手柄的控制方法,一个单边手柄可以用作左侧手柄;也可以用作右侧手柄;或者即不用作左侧手柄,也不用作右侧手柄,而是独立于手机,遥控操作手机。从而,可以单独使用一个单边手柄,也可以将两个相同的单边手柄组合使用。这样,多个用户的相同的单边手柄可以组合使用,用户也可以单独使用一个单边手柄,用法灵活,节约了使用成本。游戏手柄生产商也可以降低生产和维护成本。In the method for controlling a gamepad provided by the embodiments of the present application, a single-sided handle can be used as a left handle; it can also be used as a right handle; or it is neither used as a left handle nor as a right handle, but independent Mobile phone, remote control of mobile phone. Thus, one single-sided handle can be used alone, or two identical single-sided handles can be used in combination. In this way, the same unilateral handle of a plurality of users can be used in combination, and the user can also use a unilateral handle alone, which is flexible in usage and saves the use cost. Gamepad manufacturers can also reduce production and maintenance costs.

本申请实施例提供的游戏手柄的控制方法可以应用于图4所示的系统。该系统可以包括电子设备100和游戏手柄200。电子设备100和游戏手柄200可以通过无线连接或有线连接。用户可以通过游戏手柄200控制电子设备100中的游戏。比如,用户可以通过操作游戏手柄 200上的摇杆或按键,对电子设备100上的游戏中的模拟角色进行控制。The control method of the gamepad provided by the embodiment of the present application can be applied to the system shown in FIG. 4 . The system may include an electronic device 100 and a gamepad 200 . The electronic device 100 and the gamepad 200 may be connected wirelessly or wiredly. The user can control the game in the electronic device 100 through the gamepad 200 . For example, the user can control the simulated character in the game on the electronic device 100 by operating the joystick or the button on the game handle 200.

其中,电子设备100可以是便携式计算机(如手机等)、笔记本电脑、个人计算机(personal computer,PC)、平板电脑、电视等,本申请实施例对该电子设备100的具体形式不做特殊限制。游戏手柄200可以是一种单边手柄。The electronic device 100 may be a portable computer (such as a mobile phone, etc.), a notebook computer, a personal computer (PC), a tablet computer, a TV, etc. The specific form of the electronic device 100 is not particularly limited in this embodiment of the present application. The gamepad 200 may be a single-sided controller.

请参考图5,其示出了电子设备100的一种硬件架构。电子设备100可以包括处理器110、无线通信模块120和显示屏130。Please refer to FIG. 5 , which shows a hardware architecture of the electronic device 100 . The electronic device 100 may include a processor 110 , a wireless communication module 120 and a display screen 130 .

可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),图形处理器(graphics processing unit,GPU),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (application processor, AP), a graphics processor (graphics processing unit, GPU), a controller, a memory, a video codec, Digital signal processor (digital signal processor, DSP) and so on. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.

其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。比如,控制器可以用于将接收到的游戏手柄200的键信号转换为游戏的控制信号。The controller may be the nerve center and command center of the electronic device 100 . The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions. For example, the controller may be used to convert the received key signals of the gamepad 200 into control signals of the game.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110 中的存储器为高速缓冲存储器。该存储器可以保存处理器110使用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data used or recycled by the processor 110 . If the processor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby increasing the efficiency of the system.

视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组 (moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in various encoding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4 and so on.

数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。A digital signal processor is used to process digital signals, in addition to processing digital image signals, it can also process other digital signals.

电子设备100的无线通信功能可以通过天线,无线通信模块120等实现。The wireless communication function of the electronic device 100 may be implemented by an antenna, a wireless communication module 120 and the like.

天线用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。Antennas are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.

无线通信模块120可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近场通信(near field communication,NFC),紫蜂(ZigBee),红外技术(infrared,IR)等无线通信的解决方案。例如,无线通信模块120可以用于实现本申请实施例中电子设备100与游戏手柄200的通信。无线通信模块120可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块120经由天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块120还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线转为电磁波辐射出去。The wireless communication module 120 can provide wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellite systems applied on the electronic device 100 . (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication (near field communication, NFC), ZigBee (ZigBee), infrared technology (infrared, IR) and other wireless communication solutions. For example, the wireless communication module 120 may be used to implement the communication between the electronic device 100 and the gamepad 200 in the embodiment of the present application. The wireless communication module 120 may be one or more devices integrating at least one communication processing module. The wireless communication module 120 receives electromagnetic waves via the antenna, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 120 can also receive the signal to be sent from the processor 110, frequency-modulate the signal, amplify the signal, and radiate it into electromagnetic waves through the antenna.

电子设备100通过GPU,显示屏130,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏130和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements a display function through a GPU, a display screen 130, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 130 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.

显示屏130用于显示图像,视频等。显示屏130包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode 的,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed, Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏130,N为大于1的正整数。The display screen 130 is used to display images, videos, and the like. The display screen 130 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode). , AMOLED), flexible light-emitting diodes (flex light-emitting diodes, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (quantum dot light emitting diodes, QLED) and so on. In some embodiments, the electronic device 100 may include 1 or N display screens 130 , where N is a positive integer greater than 1.

在本申请中,显示屏130可以显示应用的界面(比如游戏界面)。In the present application, the display screen 130 may display an interface of an application (eg, a game interface).

在一些实施例中,电子设备100还可以包括磁体140。比如,磁体140可以是磁铁。磁体140可以与游戏手柄200的磁传感器配合使用,为磁传感器提供磁性。两个磁体140分别设置在电子设备100的左右两侧,与游戏手柄200的磁传感器的位置匹配;即磁体可以被磁传感器感应到。在一些实施例中,磁体140可以安装在电子设备100的外壳内侧。In some embodiments, the electronic device 100 may also include a magnet 140 . For example, magnet 140 may be a magnet. The magnet 140 may be used in conjunction with the magnetic sensor of the gamepad 200 to provide magnetism to the magnetic sensor. The two magnets 140 are respectively disposed on the left and right sides of the electronic device 100, and match the positions of the magnetic sensors of the gamepad 200; that is, the magnets can be sensed by the magnetic sensors. In some embodiments, the magnet 140 may be mounted inside the housing of the electronic device 100 .

请参考图6,其示出了游戏手柄200的一种硬件架构。游戏手柄200可以包括处理器210、无线通信模块220和操作键230。Please refer to FIG. 6 , which shows a hardware architecture of the gamepad 200 . The gamepad 200 may include a processor 210 , a wireless communication module 220 and operation keys 230 .

可以理解的是,本发明实施例示意的结构并不构成对游戏手柄200的具体限定。在本申请另一些实施例中,游戏手柄200可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the game handle 200 . In other embodiments of the present application, the gamepad 200 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

处理器210是游戏手柄200的控制中心,可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。比如,处理器210可以用于接收磁传感器的信号,以识别游戏手柄200的工作模式(比如,第一模式或第二模式)。比如,处理器210还可以用于接收拨档开关的输出,以识别游戏手柄200的工作模式。比如,处理器210还可以用于向电子设备100上报游戏手柄200的工作模式。比如,处理器210可以用于向电子设备 100上报操作键230在对应的工作模式下的操作信息。The processor 210 is the control center of the gamepad 200, and can generate operation control signals according to the instruction operation code and the timing signal, and complete the control of fetching and executing instructions. For example, the processor 210 may be configured to receive a signal from a magnetic sensor to identify an operating mode (eg, the first mode or the second mode) of the gamepad 200 . For example, the processor 210 can also be used to receive the output of the toggle switch to identify the working mode of the gamepad 200 . For example, the processor 210 may also be configured to report the working mode of the gamepad 200 to the electronic device 100 . For example, the processor 210 may be configured to report the operation information of the operation key 230 in the corresponding working mode to the electronic device 100.

处理器210中还可以设置存储器,用于存储指令和数据。该存储器可以保存处理器210 使用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 210 for storing instructions and data. The memory may hold instructions or data used or recycled by the processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated accesses are avoided, and the waiting time of the processor 210 is reduced, thereby improving the efficiency of the system.

游戏手柄200的无线通信功能可以通过天线,无线通信模块220等实现。The wireless communication function of the gamepad 200 may be implemented by an antenna, a wireless communication module 220 and the like.

天线用于发射和接收电磁波信号。Antennas are used to transmit and receive electromagnetic wave signals.

无线通信模块220可以提供应用在游戏手柄200上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近场通信(near field communication,NFC),紫蜂(ZigBee),红外技术(infrared,IR)等无线通信的解决方案。例如,无线通信模块220可以用于实现本申请实施例中游戏手柄200与电子设备100的通信。无线通信模块220可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块220经由天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器210。无线通信模块220还可以从处理器210接收待发送的信号,对其进行调频,放大,经天线转为电磁波辐射出去。The wireless communication module 220 can provide wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellite systems applied on the gamepad 200 . (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication (near field communication, NFC), ZigBee (ZigBee), infrared technology (infrared, IR) and other wireless communication solutions. For example, the wireless communication module 220 may be used to implement the communication between the gamepad 200 and the electronic device 100 in the embodiment of the present application. The wireless communication module 220 may be one or more devices integrating at least one communication processing module. The wireless communication module 220 receives electromagnetic waves via the antenna, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210 . The wireless communication module 220 can also receive the signal to be sent from the processor 210, frequency-modulate the signal, amplify the signal, and radiate it into electromagnetic waves through the antenna.

操作键230包括摇杆,按键等。游戏手柄200可以接收操作键230的输入,产生与操作键230的用户设置以及功能控制有关的键信号输入。操作键230的按键和/或摇杆,可以接收用户的输入,以控制显示在电子设备100上的虚拟对象。操作键230可以是机械按键。在一些实施例中,操作键230也可以是触摸式按键。比如,游戏手柄200还包括触摸传感器260 和显示屏270。显示屏270可以用于显示文字、图像等;显示屏270包括显示面板。触摸传感器260也称“触控面板”,可以设置于显示屏270;由触摸传感器260与显示屏270组成触摸屏,也称“触控屏”。触摸传感器260可以用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给处理器,以确定触摸事件类型。还可以通过显示屏270 提供与触摸操作相关的视觉输出。在一些示例中,触摸传感器260也可以设置于游戏手柄200 的表面,与显示屏270所处的位置不同。或者,在一些示例中,游戏手柄200的表面设置有触摸传感器260,而不设置显示屏。The operation keys 230 include joysticks, buttons, and the like. The gamepad 200 can receive the input of the operation key 230 and generate the key signal input related to the user setting and function control of the operation key 230 . The keys and/or joysticks of the operation keys 230 can receive user input to control the virtual objects displayed on the electronic device 100 . The operation keys 230 may be mechanical keys. In some embodiments, the operation keys 230 may also be touch keys. For example, the gamepad 200 also includes a touch sensor 260 and a display screen 270 . The display screen 270 may be used to display text, images, etc.; the display screen 270 includes a display panel. The touch sensor 260 is also called a "touch panel" and can be disposed on the display screen 270; the touch sensor 260 and the display screen 270 form a touch screen, also called a "touch screen". The touch sensor 260 may be used to detect touch operations on or near it. The touch sensor can pass the detected touch operation to the processor to determine the type of touch event. Visual output related to touch operations may also be provided through display screen 270 . In some examples, the touch sensor 260 may also be disposed on the surface of the gamepad 200 in a different location than the display screen 270 . Alternatively, in some examples, the surface of the gamepad 200 is provided with a touch sensor 260 without a display screen.

在一些实施例中,游戏手柄200还可以包括两个磁传感器240。磁传感器240包括霍尔传感器。在一些实施例中,磁传感器240可以与电子设备100的磁体140配合使用,游戏手柄200可以利用磁传感器240检测磁体140,以确定游戏手柄的工作模式。比如,两个磁传感器240可以分别放置在游戏手柄200(单边手柄)的外壳内侧的左右两边。磁传感器240 与电子设备100的磁体140的位置匹配;即磁传感器可以感应到磁体。In some embodiments, the gamepad 200 may also include two magnetic sensors 240 . The magnetic sensor 240 includes a Hall sensor. In some embodiments, the magnetic sensor 240 may be used in conjunction with the magnet 140 of the electronic device 100, and the gamepad 200 may utilize the magnetic sensor 240 to detect the magnet 140 to determine the operation mode of the gamepad. For example, two magnetic sensors 240 may be placed on the left and right sides of the inner side of the casing of the game handle 200 (single-sided handle), respectively. The magnetic sensor 240 matches the position of the magnet 140 of the electronic device 100; that is, the magnetic sensor can sense the magnet.

在另一些实施例中,游戏手柄200还可以包括开关250。比如,开关250可以是拨档开关。拨档开关可以包括多个档位。当拨档开关位于不同的档位时,可以输出不同的输出信号。比如,拨档开关可以是电平器,电位器;当拨档开关位于不同的档位时,可以输出不同的电压。比如,开关250可以设置在游戏手柄200(单边手柄)的表面。本申请中,处理器210 可以接收开关250的输出信号,并根据开关250输出的不同的输出信号确定对应的工作模式。In other embodiments, the gamepad 200 may further include a switch 250 . For example, switch 250 may be a toggle switch. The paddle switch can include multiple positions. When the shift switch is in different gears, different output signals can be output. For example, the shift switch can be a leveler or a potentiometer; when the shift switch is in different gears, different voltages can be output. For example, the switch 250 may be provided on the surface of the gamepad 200 (single-sided handle). In this application, the processor 210 may receive the output signal of the switch 250 and determine the corresponding working mode according to different output signals output by the switch 250 .

需要说明的是,本申请实施例中,电子设备100上安装显示屏的一面为正面,与正面相反的一面为背面。游戏手柄200上安装有操作键的一面为正面,与正面相反的一面为背面。以电子设备100或游戏手柄200正面面向用户时,用户的左手边为左侧,用户的右手边为右侧。It should be noted that, in the embodiment of the present application, the side on which the display screen is installed on the electronic device 100 is the front side, and the side opposite to the front side is the back side. The side of the gamepad 200 on which the operation keys are installed is the front side, and the side opposite to the front side is the back side. When the front of the electronic device 100 or the gamepad 200 faces the user, the user's left-hand side is the left side, and the user's right-hand side is the right side.

以下结合附图对本申请实施例提供的游戏手柄的控制方法进行具体介绍。The control method of the game handle provided by the embodiment of the present application will be specifically introduced below with reference to the accompanying drawings.

在一些实施例中,游戏手柄可以根据其安装在电子设备的左侧或右侧,工作在不同的工作模式。游戏手柄的工作模式包括第一模式和第二模式,第一模式和第二模式不同。游戏手柄确定其安装在电子设备的第一侧时,游戏手柄的工作模式为第一模式,游戏手柄的操作键按照第一模式工作;游戏手柄确定其安装在电子设备的第二侧时,游戏手柄的工作模式为第二模式,游戏手柄的操作键按照第二模式工作。比如,第一侧为左侧,第二侧为右侧。In some embodiments, the gamepad can work in different working modes depending on whether it is installed on the left or right side of the electronic device. The working modes of the gamepad include a first mode and a second mode, and the first mode and the second mode are different. When the gamepad determines that it is installed on the first side of the electronic device, the working mode of the gamepad is the first mode, and the operation keys of the gamepad work according to the first mode; when the gamepad determines that it is installed on the second side of the electronic device, the gamepad operates in the first mode. The working mode of the handle is the second mode, and the operation keys of the game handle work according to the second mode. For example, the first side is the left side and the second side is the right side.

游戏手柄可以安装在电子设备的一侧。比如,游戏手柄的侧边设置有卡槽,游戏手柄可以通过卡槽卡在电子设备一侧。在使用游戏手柄时,先建立游戏手柄与电子设备的连接。比如,游戏手柄可以与电子设备无线连接;示例性的,游戏手柄可以与电子设备通过蓝牙连接。再比如,游戏手柄可以与电子设备有线连接。The gamepad can be mounted on one side of the electronic device. For example, a card slot is provided on the side of the game handle, and the game handle can be stuck on the side of the electronic device through the card slot. When using a gamepad, first establish a connection between the gamepad and the electronic device. For example, the gamepad can be wirelessly connected to the electronic device; for example, the gamepad can be connected to the electronic device through Bluetooth. For another example, the gamepad may be wired to the electronic device.

在一种实现方式中,游戏手柄检测游戏手柄与所连接电子设备的位置关系,根据游戏手柄与电子设备的位置关系,确定其安装在电子设备的第一侧或第二侧。游戏手柄与电子设备的位置关系可以包括:第一位置关系和第二位置关系;其中,第一位置关系与第二位置关系不同。比如,第一位置关系为游戏手柄安装在电子设备的第一侧(如图3的(a));第二位置关系为游戏手柄安装在电子设备的第二侧(如图3的(b))。确定游戏手柄与电子设备的位置关系,即确定游戏手柄安装在电子设备的第一侧,或者游戏手柄安装在电子设备的第二侧。In one implementation, the gamepad detects the positional relationship between the gamepad and the connected electronic device, and determines whether the gamepad is installed on the first side or the second side of the electronic device according to the positional relationship between the gamepad and the electronic device. The positional relationship between the game handle and the electronic device may include: a first positional relationship and a second positional relationship; wherein the first positional relationship is different from the second positional relationship. For example, the first positional relationship is that the gamepad is installed on the first side of the electronic device (as shown in FIG. 3(a)); the second positional relationship is that the gamepad is installed on the second side of the electronic device (as shown in FIG. 3(b) ) ). The positional relationship between the gamepad and the electronic device is determined, that is, it is determined that the gamepad is installed on the first side of the electronic device, or the gamepad is installed on the second side of the electronic device.

需要说明的是,图3以手机横屏放置为例进行示例。在一些实施例中,电子设备也可以竖屏放置。示例性的,游戏手柄安装在电子设备的左侧,如图7的(a)所示;游戏手柄安装在电子设备的右侧,如图7的(b)所示。It should be noted that FIG. 3 takes the mobile phone being placed in a landscape orientation as an example for illustration. In some embodiments, the electronic device can also be placed in portrait orientation. Exemplarily, the gamepad is installed on the left side of the electronic device, as shown in (a) of FIG. 7 ; the gamepad is installed on the right side of the electronic device, as shown in (b) of FIG. 7 .

本申请实施例提供一种通过磁传感器确定游戏手柄的工作模式的方式。The embodiment of the present application provides a method for determining the working mode of a game handle by using a magnetic sensor.

在一种实现方式中,游戏手柄包括第一磁传感器和第二磁传感器,游戏手柄通过第一磁传感器或第二磁传感器的输出信号,确定游戏手柄安装在电子设备的左侧或者右侧。比如,两个磁传感器分别设置在游戏手柄上相对的两侧(示例性的,第一磁传感器设置在游戏手柄的左侧,第二磁传感器设置在游戏手柄的右侧)。相应的,电子设备上相对的两侧分别设置两个磁体(比如,第一磁体设置在电子设备的左侧,第二磁体设置在电子设备的右侧)。游戏手柄的磁传感器在游戏手柄上的位置与电子设备的磁体在电子设备上的位置相匹配;即游戏手柄安装在电子设备的左侧或右侧时,游戏手柄的第一磁传感器或第二磁传感器可以感应到电子设备的一个磁体。In an implementation manner, the game handle includes a first magnetic sensor and a second magnetic sensor, and the game handle determines that the game handle is installed on the left or right side of the electronic device through the output signal of the first magnetic sensor or the second magnetic sensor. For example, two magnetic sensors are respectively disposed on opposite sides of the game handle (exemplarily, the first magnetic sensor is disposed on the left side of the game handle, and the second magnetic sensor is disposed on the right side of the game handle). Correspondingly, two magnets are respectively provided on opposite sides of the electronic device (for example, the first magnet is provided on the left side of the electronic device, and the second magnet is provided on the right side of the electronic device). The position of the gamepad's magnetic sensor on the gamepad matches the position of the electronic device's magnet on the electronic device; that is, when the gamepad is mounted on the left or right side of the electronic device, the first magnetic sensor or the second Magnetic sensors can sense a magnet in an electronic device.

在一些实施例中,如果确定磁传感器的至少一个输出端口存在输出信号,则确定该磁传感器感应到磁体。示例性的,以磁传感器为霍尔(Hall)传感器为例,图8为一个霍尔传感器电路。该霍尔传感器电路包括霍尔传感器,开关斩波器,斩波放大器,比较器,极性鉴别器,输出缓冲,输出端口1,输出端口2,还可以包括偏置器,示波器,时钟等。霍尔传感器检测到磁体的磁性南极(S极)时,输出端口1输出信号;霍尔传感器检测到磁体的磁性北极(N极)时,输出端口2输出信号。如果输出端口1或输出端口2输出信号,则确定该霍尔传感器感应到磁体。In some embodiments, the magnetic sensor is determined to sense a magnet if an output signal is determined to be present at at least one output port of the magnetic sensor. Illustratively, taking the magnetic sensor as a Hall sensor as an example, FIG. 8 shows a Hall sensor circuit. The hall sensor circuit includes a hall sensor, a switching chopper, a chopper amplifier, a comparator, a polarity discriminator, an output buffer, an output port 1, an output port 2, and can also include a biaser, an oscilloscope, a clock, and the like. When the Hall sensor detects the magnetic south pole (S pole) of the magnet, output port 1 outputs a signal; when the Hall sensor detects the magnetic north pole (N pole) of the magnet, output port 2 outputs a signal. If the output port 1 or the output port 2 outputs a signal, it is determined that the Hall sensor senses the magnet.

请参考图9A,游戏手柄安装在电子设备的左侧时,游戏手柄的第一磁传感器感应到电子设备的第一磁体。此时,第一磁传感器有输出信号。Please refer to FIG. 9A , when the gamepad is installed on the left side of the electronic device, the first magnetic sensor of the gamepad senses the first magnet of the electronic device. At this time, the first magnetic sensor has an output signal.

请参考图9B,游戏手柄安装在电子设备的右侧时,游戏手柄的第二磁传感器感应到电子设备的第二磁体。此时,第二磁传感器有输出信号。Please refer to FIG. 9B , when the gamepad is installed on the right side of the electronic device, the second magnetic sensor of the gamepad senses the second magnet of the electronic device. At this time, the second magnetic sensor has an output signal.

需要说明的是,图9A-图9B中磁传感器和磁体之间的相对位置的设置方式,仅为示例性说明。在实际应用中,可以有其他的设置方式,只要满足两个磁传感器分别设置在游戏手柄上相对的两侧,两个磁体分别设置在电子设备上相对的两侧,使得游戏手柄位于电子设备的两侧时,不同的磁传感器可以感应到磁体。比如,图9A-图9B中,第一磁体和第二磁体分别设置在电子设备横屏放置的左、右两侧。实际使用中,也可以设置为,第一磁体和第二磁体分别设置在电子设备竖屏放置的左、右两侧;也可以在横屏和竖屏的左右两侧都放置。具体设置方式此处不再赘述。It should be noted that the arrangement of the relative positions between the magnetic sensor and the magnet in FIGS. 9A-9B is only an exemplary illustration. In practical applications, there can be other setting methods, as long as the two magnetic sensors are respectively arranged on opposite sides of the game handle, and the two magnets are respectively arranged on opposite sides of the electronic device, so that the game handle is located on the opposite side of the electronic device. When on both sides, different magnetic sensors can sense the magnets. For example, in FIGS. 9A-9B , the first magnet and the second magnet are respectively disposed on the left and right sides of the electronic device in a horizontal screen. In actual use, the first magnet and the second magnet can also be arranged on the left and right sides of the vertical screen of the electronic device, respectively, or on the left and right sides of the horizontal screen and the vertical screen. The specific setting method will not be repeated here.

游戏手柄确定第一磁传感器存在输出信号,则确定游戏手柄安装在电子设备的左侧;游戏手柄确定第二磁传感器存在输出信号,则确定游戏手柄安装在电子设备的右侧。If the gamepad determines that there is an output signal from the first magnetic sensor, it is determined that the gamepad is installed on the left side of the electronic device; if the gamepad determines that there is an output signal from the second magnetic sensor, it is determined that the gamepad is installed on the right side of the electronic device.

示例性的,当游戏手柄200与电子设备100连接时,游戏手柄200的第一磁传感器240 或第二磁传感器240输出信号。当游戏手柄200安装在电子设备100左侧时,第一磁传感器 240输出信号,并将输出信号传输至游戏手柄200的处理器210;处理器210接收到第一磁传感器240的输出信号后,确认游戏手柄200安装在电子设备100的左侧。当游戏手柄200安装在电子设备100右侧时,第二磁传感器240输出信号,并将输出信号传输至游戏手柄200的处理器210;处理器210接收到第二磁传感器240的输出信号后,确认游戏手柄200安装在电子设备100的右侧。Exemplarily, when the gamepad 200 is connected to the electronic device 100, the first magnetic sensor 240 or the second magnetic sensor 240 of the gamepad 200 outputs a signal. When the gamepad 200 is installed on the left side of the electronic device 100, the first magnetic sensor 240 outputs a signal, and transmits the output signal to the processor 210 of the gamepad 200; after the processor 210 receives the output signal from the first magnetic sensor 240, It is confirmed that the gamepad 200 is installed on the left side of the electronic device 100 . When the gamepad 200 is installed on the right side of the electronic device 100, the second magnetic sensor 240 outputs a signal, and transmits the output signal to the processor 210 of the gamepad 200; after the processor 210 receives the output signal from the second magnetic sensor 240, It is confirmed that the gamepad 200 is installed on the right side of the electronic device 100 .

进一步的,游戏手柄根据其安装在电子设备的左侧或者右侧,工作在不同的工作模式。比如,如果游戏手柄确定其安装在电子设备的左侧,则工作在第一模式。如果游戏手柄确定其安装在电子设备的右侧,则工作在第二模式。比如,第一模式为左侧模式,第二模式为右侧模式;即如果游戏手柄检测到其安装在电子设备的左侧,则工作在左侧模式,如果游戏手柄检测到其安装在电子设备的右侧,则工作在右侧模式。Further, the gamepad works in different working modes according to whether it is installed on the left or right side of the electronic device. For example, if the gamepad determines that it is mounted on the left side of the electronic device, it operates in the first mode. If the gamepad determines that it is mounted on the right side of the electronic device, it operates in the second mode. For example, the first mode is the left mode, and the second mode is the right mode; that is, if the gamepad detects that it is installed on the left side of the electronic device, it works in the left mode, and if the gamepad detects that it is installed on the electronic device on the right side, it works in the right side mode.

示例性的,游戏手柄200的处理器210接收到第一磁传感器240的输出信号,则确定游戏手柄200安装在电子设备100的左侧,确定游戏手柄200的工作模式为第一模式。游戏手柄200的处理器210接收到第二磁传感器240的输出信号,则确定游戏手柄200安装在电子设备100的右侧,确定游戏手柄200的工作模式为第二模式。Exemplarily, the processor 210 of the gamepad 200 receives the output signal of the first magnetic sensor 240, determines that the gamepad 200 is installed on the left side of the electronic device 100, and determines that the working mode of the gamepad 200 is the first mode. The processor 210 of the gamepad 200 receives the output signal of the second magnetic sensor 240, determines that the gamepad 200 is installed on the right side of the electronic device 100, and determines that the working mode of the gamepad 200 is the second mode.

本申请实施例还提供一种通过拨档开关确定游戏手柄的工作模式的方式。The embodiment of the present application also provides a method for determining the working mode of the game handle by using a toggle switch.

在一种实现方式中,游戏手柄包括一个拨档开关,拨档开关包括第一档位和第二档位。用户可以通过拨动拨档开关来设置拨档开关的档位。示例性的,图10是一种拨档开关的示意图。拨档开关可以包括按钮和输出端。响应于用户对拨档开关的按钮的拨动操作,拨档开关可以设置为不同的档位;拨档开关位于不同的档位时,输出端输出不同的输出信号。比如,响应于用户对拨档开关的按钮的第一拨动操作,拨档开关设置为第一档位;拨档开关位于第一档位时,输出端输出第一输出信号(比如,第一电平);响应于用户对拨档开关的按钮的第二拨动操作,拨档开关设置为第二档位;拨档开关位于第二档位时,输出端输出第二输出信号(比如,第二电平)。其中,第一拨动操作为将按钮拨动至第一位置,第二拨动操作为将按钮拨动至第二位置。第一位置与第二位置不相同。In one implementation, the game handle includes a toggle switch, and the toggle switch includes a first gear and a second gear. The user can set the shift position of the shift switch by toggling the shift switch. Exemplarily, FIG. 10 is a schematic diagram of a toggle switch. The toggle switch may include a button and an output. In response to the user's toggling operation of the button of the toggle switch, the toggle switch can be set to different gear positions; when the toggle switch is located in different gear positions, the output terminal outputs different output signals. For example, in response to the user's first toggle operation on the button of the toggle switch, the toggle switch is set to the first gear position; when the toggle switch is in the first gear position, the output terminal outputs the first output signal (for example, the first level); in response to the second toggle operation of the button of the dial switch by the user, the dial switch is set to the second gear position; when the dial switch is in the second gear position, the output terminal outputs a second output signal (for example, second level). The first toggle operation is to toggle the button to the first position, and the second toggle operation is to toggle the button to the second position. The first position is not the same as the second position.

游戏手柄可以检测拨档开关的当前档位,从而确定游戏手柄与所连接电子设备的位置关系。响应于检测到拨档开关位于第一档位,则确定检测到游戏手柄与所连接电子设备的位置关系为第一位置关系;响应于检测到拨档开关位于第二档位,则确定检测到游戏手柄与所连接电子设备的位置关系为第二位置关系。The gamepad can detect the current gear of the toggle switch, so as to determine the positional relationship between the gamepad and the connected electronic device. In response to detecting that the shift switch is located at the first gear position, it is determined that the positional relationship between the game handle and the connected electronic device is the first position relationship; in response to detecting that the shift switch is at the second gear position, it is determined that the detection The positional relationship between the gamepad and the connected electronic device is the second positional relationship.

游戏手柄确定拨档开关的输出端输出第一输出信号,则确定拨档开关位于第一档位,游戏手柄的工作模式为第一模式;游戏手柄确定拨档开关的输出端输出第二输出信号,则确定拨档开关位于第二档位,游戏手柄的工作模式为第二模式。If the game handle determines that the output end of the dial switch outputs the first output signal, then it is determined that the dial switch is in the first gear position, and the working mode of the game handle is the first mode; the game handle determines that the output end of the dial switch outputs the second output signal , then it is determined that the dial switch is in the second gear position, and the working mode of the gamepad is the second mode.

示例性的,游戏手柄200的处理器210可以接收开关250的输出信号。如果处理器210 确定开关250的输出信号为第一输出信号,则确定游戏手柄200的工作模式为第一模式;如果处理器210确定开关250的输出信号为第二输出信号,则确定游戏手柄200的工作模式为第二模式。Exemplarily, the processor 210 of the gamepad 200 may receive the output signal of the switch 250 . If the processor 210 determines that the output signal of the switch 250 is the first output signal, it determines that the operating mode of the gamepad 200 is the first mode; if the processor 210 determines that the output signal of the switch 250 is the second output signal, it determines that the gamepad 200 The working mode is the second mode.

需要说明的是,本申请实施例以第一模式为左侧模式,第二模式为右侧模式为例进行说明。在实际使用中,用户也可以根据需要在电子设备上设置游戏手柄的模式。比如,游戏手柄的模式包括左利手模式和右利手模式。在左利手模式,第一模式为右侧模式,第二模式为左侧模式;即如果游戏手柄检测到其安装在电子设备的左侧,则确定游戏手柄的工作模式为右侧模式,如果游戏手柄检测到其安装在电子设备的右侧,则确定游戏手柄的工作模式为左侧模式。在右利手模式,第一模式为左侧模式,第二模式为右侧模式;即如果游戏手柄检测到其安装在电子设备的左侧,则确定游戏手柄的工作模式为左侧模式,如果游戏手柄检测到其安装在电子设备的右侧,则确定游戏手柄的工作模式为右侧模式。It should be noted that, the embodiments of the present application are described by taking the first mode as the left mode and the second mode as the right mode as an example. In actual use, the user can also set the mode of the gamepad on the electronic device as required. For example, the modes of the gamepad include a left-handed mode and a right-handed mode. In the left-handed mode, the first mode is the right mode, and the second mode is the left mode; that is, if the gamepad detects that it is installed on the left side of the electronic device, it is determined that the working mode of the gamepad is the right mode. When the gamepad detects that it is installed on the right side of the electronic device, it is determined that the working mode of the gamepad is the left mode. In the right-handed mode, the first mode is the left mode, and the second mode is the right mode; that is, if the gamepad detects that it is installed on the left side of the electronic device, it is determined that the working mode of the gamepad is the left mode, if When the gamepad detects that it is installed on the right side of the electronic device, it is determined that the working mode of the gamepad is the right mode.

示例性的,如图11,电子设备100可以接收用户对“设置”应用图标的点击操作(如单击操作)。响应于用户对“设置”应用图标的点击操作,电子设备100可以显示图11中设置界面。该设置界面中可以包括“飞行模式”选项、“WLAN”选项、“蓝牙”选项、“移动网络”选项和“游戏手柄”选项801等。其中,“飞行模式”选项、“WLAN”选项、“蓝牙”选项和“移动网络”选项的具体功能可以参考常规技术中的具体描述,本申请实施例这里不予赘述。Exemplarily, as shown in FIG. 11 , the electronic device 100 may receive a user's click operation (eg, click operation) on the "Settings" application icon. In response to the user's click operation on the "settings" application icon, the electronic device 100 may display the setting interface in FIG. 11 . The setting interface may include an "airplane mode" option, a "WLAN" option, a "Bluetooth" option, a "mobile network" option, and a "gamepad" option 801 and the like. The specific functions of the "airplane mode" option, the "WLAN" option, the "Bluetooth" option, and the "mobile network" option may refer to the specific description in the conventional technology, which will not be repeated in this embodiment of the present application.

电子设备100可以接收用户对“游戏手柄”选项801的点击操作(如单击操作)。响应于用户对“游戏手柄”选项801的点击操作,电子设备100可以显示图11中游戏手柄界面。该游戏手柄界面中包括“惯用手”选项802。电子设备100可以接收用户对“惯用手”选项802 的点击操作(如单击操作)。响应于用户对“惯用手”选项802的点击操作,电子设备100可以显示图11中惯用手界面。惯用手界面包括“左手”选项803和“右手”选项804。比如,响应于用户对“左手”选项803的点击操作,电子设备100可以设置为左利手模式。响应于用户对“右手”选项804的点击操作,电子设备100可以设置为右利手模式。The electronic device 100 may receive a user's click operation (eg, click operation) on the "Gamepad" option 801 . In response to the user's click operation on the "Gamepad" option 801, the electronic device 100 may display the gamepad interface in FIG. 11 . A "dominant hand" option 802 is included in the gamepad interface. The electronic device 100 may receive a user's click operation (eg, a click operation) on the "dominant hand" option 802 . In response to the user's click operation on the "dominant hand" option 802, the electronic device 100 may display the dominant hand interface in FIG. 11 . The dominant-handed interface includes a "left-handed" option 803 and a "right-handed" option 804 . For example, in response to the user's click operation on the "left-handed" option 803, the electronic device 100 may be set to a left-handed mode. In response to the user's click operation on the "right handed" option 804, the electronic device 100 may be set to a right-handed mode.

进一步的,电子设备100将设置的模式信息发送给游戏手柄200。游戏手柄200接收到模式信息,可以根据该模式信息设置游戏手柄为左利手模式或右利手模式。Further, the electronic device 100 sends the set mode information to the gamepad 200 . The gamepad 200 receives the mode information, and can set the gamepad to be a left-handed mode or a right-handed mode according to the mode information.

在第一模式(左侧模式)或第二模式(右侧模式),游戏手柄的操作键可以分别对应不同的功能。比如,左侧模式时,游戏手柄的操作键用于控制游戏模拟角色的幅度较大的动作;右侧模式时,游戏手柄的操作键用于控制游戏模拟角色的较精细的动作。电子设备的应用程序(比如,游戏)中,定义了每个操作键对应的功能,即定义了每个操作键对应的指令。比如,每个指令可以对应游戏中模拟角色的一个动作。In the first mode (left mode) or the second mode (right mode), the operation keys of the gamepad may respectively correspond to different functions. For example, in the left mode, the operation keys of the gamepad are used to control the larger movements of the game simulated character; in the right mode, the operation keys of the gamepad are used to control the finer movements of the game simulated character. In an application program (for example, a game) of an electronic device, a function corresponding to each operation key is defined, that is, an instruction corresponding to each operation key is defined. For example, each command can correspond to an action of the simulated character in the game.

用户可以通过对游戏手柄的操作键的操控,来实现对应的功能。比如,用户对游戏手柄的操作键的操控可以包括:用户对摇杆的推动操作,用户对按键的按压操作等。游戏手柄安装在电子设备的左侧或右侧,响应于用户对同一个操作键的操控,可以触发电子设备执行不同的指令。比如,响应于检测到游戏手柄与所连接电子设备的位置关系为第一位置关系,游戏手柄工作在第一模式,响应于用户对第一操作键的操控,游戏手柄触发电子设备执行第一指令;响应于检测到游戏手柄与所连接电子设备的位置关系为第二位置关系,游戏手柄工作在第二模式,响应于用户对第一操作键的操控,游戏手柄触发电子设备执行第二指令。其中,第一操作键为游戏手柄的任意一个操作键。The user can realize the corresponding function by manipulating the operation keys of the gamepad. For example, the user's manipulation of the operation keys of the gamepad may include: the user's pushing operation on the joystick, the user's pressing operation on the keys, and the like. The gamepad is installed on the left or right side of the electronic device, and in response to the user's manipulation of the same operation key, the electronic device can be triggered to execute different instructions. For example, in response to detecting that the positional relationship between the gamepad and the connected electronic device is the first positional relationship, the gamepad operates in the first mode, and in response to the user's manipulation of the first operation key, the gamepad triggers the electronic device to execute the first instruction ; In response to detecting that the positional relationship between the gamepad and the connected electronic device is the second positional relationship, the gamepad works in the second mode, and in response to the user's manipulation of the first operation key, the gamepad triggers the electronic device to execute the second instruction. Wherein, the first operation key is any operation key of the gamepad.

在一种实现方式中,游戏手柄的第一操作键,在左侧模式对应第一操作信号(比如,操作信号可以是编码信号);在右侧模式对应第二操作信号;其中,第一操作信号与第二操作信号不同。游戏手柄检测到用户对第一操作键的操控时,如果确定游戏手柄工作在左侧模式,可以响应于用户对第一操作键的操控,输出第一操作信号;如果确定游戏手柄工作在右侧模式,可以响应于用户对第一操作键的操控,输出第二操作信号。游戏手柄将第一操作信号或第二操作信号传输至电子设备。电子设备(或者电子设备的应用)中存储有第一规则,第一规则包括每个操作信号对应的指令。电子设备接收到第一操作信号或第二操作信号后,可以根据第一规则,在电子设备的一个应用中执行相应的指令。比如,该应用可以是电子设备的处理器当前运行的应用;或者,该应用可以是电子设备的显示界面当前显示的应用。In an implementation manner, the first operation key of the gamepad corresponds to the first operation signal in the left mode (for example, the operation signal may be an encoded signal); in the right mode, corresponds to the second operation signal; wherein, the first operation The signal is different from the second operating signal. When the gamepad detects the user's manipulation of the first operation key, if it is determined that the gamepad works in the left mode, the first operation signal can be output in response to the user's manipulation of the first operation key; if it is determined that the gamepad works on the right side In the mode, the second operation signal can be output in response to the user's manipulation of the first operation key. The gamepad transmits the first operation signal or the second operation signal to the electronic device. A first rule is stored in the electronic device (or an application of the electronic device), and the first rule includes an instruction corresponding to each operation signal. After receiving the first operation signal or the second operation signal, the electronic device can execute corresponding instructions in an application of the electronic device according to the first rule. For example, the application may be an application currently running on the processor of the electronic device; or, the application may be an application currently displayed on a display interface of the electronic device.

比如,响应于用户对游戏手柄的一个操作键的操控,操作键输出操控信息。游戏手柄的处理器根据游戏手柄的工作模式,和操控信息,生成对应的操作信号;并将该操作信号传输至游戏手柄的无线通信模块;游戏手柄的无线通信模块将该操作信号传输至电子设备的无线通信模块。电子设备的无线通信模块接收到操作信号后,将该操作信号传输至电子设备的处理器。电子设备的处理器接收到操作信号后,根据第一规则,在电子设备的一个应用中执行相应的指令。For example, in response to the user's manipulation of an operation key of the gamepad, the operation key outputs manipulation information. The processor of the gamepad generates a corresponding operation signal according to the working mode of the gamepad and the manipulation information; and transmits the operation signal to the wireless communication module of the gamepad; the wireless communication module of the gamepad transmits the operation signal to the electronic device wireless communication module. After receiving the operation signal, the wireless communication module of the electronic device transmits the operation signal to the processor of the electronic device. After receiving the operation signal, the processor of the electronic device executes a corresponding instruction in an application of the electronic device according to the first rule.

示例性的,如图12A,游戏手柄包括按键1、按键2、按键3、按键4和摇杆5。游戏手柄安装在手机左侧时,按键1、按键2、按键3、按键4和摇杆5,分别对应操作信号1、操作信号2、操作信号3、操作信号4和操作信号5。游戏手柄安装在手机右侧时,按键1、按键2、按键3、按键4和摇杆5,分别对应操作信号6、操作信号7、操作信号8、操作信号9 和操作信号10。游戏手柄确认其安装在手机的左侧时,接收到用户对按键1的按压操作,响应于用户对按键1的按压操作,输出操作信号1;手机接收到操作信号1,根据第一规则,确定操作信号1对应的指令为,在游戏中控制游戏模拟角色换游戏装备。游戏手柄确认其安装在手机的右侧时,接收到用户对按键1的按压操作,响应于用户对按键1的按压操作,输出操作信号6;手机接收到操作信号6,根据第一规则,确定操作信号6对应的指令为,在游戏中控制游戏模拟角色捡起游戏装备。Exemplarily, as shown in FIG. 12A , the gamepad includes a button 1 , a button 2 , a button 3 , a button 4 and a joystick 5 . When the gamepad is installed on the left side of the mobile phone, button 1, button 2, button 3, button 4 and joystick 5 correspond to operation signal 1, operation signal 2, operation signal 3, operation signal 4 and operation signal 5 respectively. When the gamepad is installed on the right side of the mobile phone, button 1, button 2, button 3, button 4 and joystick 5 correspond to operation signal 6, operation signal 7, operation signal 8, operation signal 9 and operation signal 10 respectively. When the gamepad confirms that it is installed on the left side of the mobile phone, it receives the user's pressing operation on the button 1, and outputs the operation signal 1 in response to the user's pressing operation on the button 1; the mobile phone receives the operation signal 1, and determines according to the first rule. The instruction corresponding to the operation signal 1 is to control the game simulation character to change the game equipment in the game. When the gamepad confirms that it is installed on the right side of the mobile phone, it receives the user's pressing operation on the button 1, and outputs the operation signal 6 in response to the user's pressing operation on the button 1; the mobile phone receives the operation signal 6, and determines according to the first rule. The instruction corresponding to the operation signal 6 is to control the game simulation character to pick up the game equipment in the game.

这样,游戏手柄安装在手机左边或右边时,响应于用户对同一个操作键的操控,执行不同的指令。In this way, when the gamepad is installed on the left or right side of the mobile phone, different instructions are executed in response to the user's manipulation of the same operation key.

在另一种实现方式中,游戏手柄的一个操作键,对应一个操作信号。游戏手柄检测到用户对一个操作键的操控时,将游戏手柄的工作模式信息,和响应于用户对一个操作键的操控输出的操作信号,传输至电子设备。电子设备(或者电子设备的应用)中存储有第二规则,第二规则包括,每个操作信号在不同的游戏手柄工作模式对应的指令。比如,对于第一操作信号,左侧模式对应指令1,右侧模式对应指令2。电子设备接收到第一操作信号和游戏手柄的工作模式信息后,根据游戏手柄的工作模式信息确定游戏手柄的工作模式;并根据接收到的第一操作信号、游戏手柄的工作模式和第二规则,在电子设备的一个应用中执行相应的指令。比如,该应用可以是电子设备的处理器当前运行的应用;或者,该应用可以是电子设备的显示界面当前显示的应用。In another implementation manner, one operation key of the game handle corresponds to one operation signal. When the gamepad detects the user's manipulation of an operation key, it transmits the working mode information of the gamepad and an operation signal output in response to the user's manipulation of an operation key to the electronic device. A second rule is stored in the electronic device (or an application of the electronic device), and the second rule includes instructions corresponding to each operation signal in different gamepad working modes. For example, for the first operation signal, the left mode corresponds to command 1, and the right mode corresponds to command 2. After receiving the first operation signal and the working mode information of the gamepad, the electronic device determines the working mode of the gamepad according to the working mode information of the gamepad; and according to the received first operation signal, the working mode of the gamepad and the second rule , and execute the corresponding instruction in an application of the electronic device. For example, the application may be an application currently running on the processor of the electronic device; or, the application may be an application currently displayed on a display interface of the electronic device.

比如,响应于用户对游戏手柄的一个操作键的操控,操作键输出操控信息。游戏手柄的处理器根据操控信息,生成对应的操作信号,并将该操作信号以及游戏手柄的工作模式信息,传输至游戏手柄的无线通信模块;游戏手柄的无线通信模块将该操作信号,以及游戏手柄的工作模式信息,传输至电子设备的无线通信模块。电子设备的无线通信模块接收到操作信号和游戏手柄的工作模式信息后,将该操作信号和游戏手柄的工作模式信息传输至电子设备的处理器。电子设备的处理器接收到操作信号和游戏手柄的工作模式信息,根据操作信号、游戏手柄的工作模式信息和第二规则,在电子设备的一个应用中执行相应的指令。For example, in response to the user's manipulation of an operation key of the gamepad, the operation key outputs manipulation information. The processor of the gamepad generates a corresponding operation signal according to the manipulation information, and transmits the operation signal and the working mode information of the gamepad to the wireless communication module of the gamepad; The working mode information of the handle is transmitted to the wireless communication module of the electronic device. After the wireless communication module of the electronic device receives the operation signal and the working mode information of the gamepad, it transmits the operation signal and the working mode information of the gamepad to the processor of the electronic device. The processor of the electronic device receives the operation signal and the working mode information of the gamepad, and executes corresponding instructions in an application of the electronic device according to the operation signal, the working mode information of the gamepad and the second rule.

示例性的,如图12A,游戏手柄包括按键1、按键2、按键3、按键4和摇杆5,分别对应操作信号1、操作信号2、操作信号3、操作信号4和操作信号5。游戏手柄接收到用户对按键1的按压操作,响应于用户对按键1的按压操作,输出操作信号1。游戏手柄将操作信号1和游戏手柄的工作模式信息传输至手机。手机接收到操作信号1和游戏手柄的工作模式信息,根据游戏手柄的工作模式信息确定游戏手柄的工作模式。比如,手机确认游戏手柄的工作模式为左侧模式,根据第二规则,确认操作信号1对应的指令为,在游戏中控制游戏模拟角色换游戏装备。手机确认游戏手柄的工作模式为右侧模式,根据第二规则,确认操作信号1对应的指令为,在游戏中控制游戏模拟角色捡起游戏装备。Exemplarily, as shown in FIG. 12A , the gamepad includes button 1 , button 2 , button 3 , button 4 and joystick 5 , corresponding to operation signal 1 , operation signal 2 , operation signal 3 , operation signal 4 and operation signal 5 respectively. The gamepad receives the pressing operation of the button 1 by the user, and outputs an operation signal 1 in response to the pressing operation of the button 1 by the user. The gamepad transmits the operation signal 1 and the working mode information of the gamepad to the mobile phone. The mobile phone receives the operation signal 1 and the working mode information of the gamepad, and determines the working mode of the gamepad according to the working mode information of the gamepad. For example, the mobile phone confirms that the working mode of the gamepad is the left mode, and according to the second rule, confirms that the instruction corresponding to the operation signal 1 is to control the game simulation character to change the game equipment in the game. The mobile phone confirms that the working mode of the gamepad is the right mode, and according to the second rule, confirms that the instruction corresponding to the operation signal 1 is to control the game simulation character to pick up the game equipment in the game.

这样,游戏手柄安装在手机左边或右边时,响应于用户对同一个操作键的操控,执行不同的指令。In this way, when the gamepad is installed on the left or right side of the mobile phone, different instructions are executed in response to the user's manipulation of the same operation key.

本申请实施例提供的游戏手柄的控制方法,游戏手柄安装在电子设备的左侧,则工作在第一模式(比如,左侧模式);游戏手柄安装在电子设备的右侧,则工作在第二模式(比如,右侧模式)。不同的工作模式下,游戏手柄的操作键对应不同的功能。从而,同一个游戏手柄,既可以安装在电子设备的左边,以第一模式工作;也可以安装在电子设备的右边,以第二模式工作。并且,可以将两个游戏手柄,一个安装在电子设备的左边,以第一模式工作;另一个安装在电子设备的右边,以第二模式工作;两个游戏手柄组合成双边手柄使用。游戏手柄的使用方式灵活,同一个游戏手柄可以实现不同的功能。降低了用户的使用成本,以及生产商的生产和维护成本。In the method for controlling a gamepad provided by the embodiment of the present application, if the gamepad is installed on the left side of the electronic device, it works in the first mode (for example, the left mode); if the gamepad is installed on the right side of the electronic device, it works in the first mode. Two modes (eg, right mode). In different working modes, the operation keys of the gamepad correspond to different functions. Therefore, the same gamepad can be installed on the left side of the electronic device and work in the first mode; it can also be installed on the right side of the electronic device and work in the second mode. In addition, two gamepads can be installed, one is installed on the left side of the electronic device and works in the first mode; the other is installed on the right side of the electronic device and works in the second mode; the two gamepads can be combined to form a bilateral handle. The use of the gamepad is flexible, and the same gamepad can achieve different functions. Reduce the user's cost of use, as well as the manufacturer's production and maintenance costs.

在一些实施例中,游戏手柄的工作模式还可以包括第三模式;第三模式不同于第一模式或第二模式。在第三模式,游戏手柄的操作键按照第三模式工作。比如,第三模式为自由模式。示例性的,如图3的(d),用户可以单独手持游戏手柄,用于遥控操作电子设备上的游戏。In some embodiments, the operating mode of the gamepad may further include a third mode; the third mode is different from the first mode or the second mode. In the third mode, the operation keys of the gamepad work according to the third mode. For example, the third mode is the free mode. Exemplarily, as shown in (d) of FIG. 3 , a user can hold a gamepad alone to remotely operate a game on an electronic device.

在一种实现方式中,游戏手柄确定其工作模式既不是第一模式,也不是第二模式,则确定其工作模式为第三模式。比如,在游戏手柄已开机的情况下,游戏手柄确定其未安装在电子设备的第一侧,并且,确定其未安装在电子设备的第二侧,则确定游戏手柄与所连接电子设备的位置关系为第三位置关系,其工作模式为第三模式。In an implementation manner, the gamepad determines that its working mode is neither the first mode nor the second mode, and then determines that its working mode is the third mode. For example, when the gamepad is turned on, the gamepad determines that it is not installed on the first side of the electronic device, and, if it is determined that it is not installed on the second side of the electronic device, the position of the gamepad and the connected electronic device is determined The relationship is the third positional relationship, and its working mode is the third mode.

在一种示例中,游戏手柄包括第一磁传感器和第二磁传感器,游戏手柄通过第一磁传感器或第二磁传感器的输出信号,确定游戏手柄安装在电子设备的左侧或者右侧。如果游戏手柄确定第一磁传感器和第二磁传感器都没有输出信号(即确定游戏手柄的工作模式既不是第一模式,也不是第二模式),则确定游戏手柄与所连接电子设备的位置关系为第三位置关系,游戏手柄的工作模式为第三模式。In an example, the gamepad includes a first magnetic sensor and a second magnetic sensor, and the gamepad determines that the gamepad is installed on the left or right side of the electronic device through the output signal of the first magnetic sensor or the second magnetic sensor. If the gamepad determines that neither the first magnetic sensor nor the second magnetic sensor outputs a signal (that is, it is determined that the operating mode of the gamepad is neither the first mode nor the second mode), then determine the positional relationship between the gamepad and the connected electronic device is the third positional relationship, and the working mode of the gamepad is the third mode.

示例性的,游戏手柄200的处理器210确定游戏手柄200处于开机状态,并且确定第一磁传感器240和第二磁传感器240都不存在输出信号,则确定游戏手柄200的工作模式为第三模式。Exemplarily, the processor 210 of the gamepad 200 determines that the gamepad 200 is in a powered-on state, and determines that there is no output signal from the first magnetic sensor 240 and the second magnetic sensor 240, then determines that the working mode of the gamepad 200 is the third mode. .

在另一种实现方式中,游戏手柄包括一个拨档开关,拨档开关包括第一档位、第二档位和第三档位。拨档开关可以包括按钮和输出端。响应于用户对拨档开关的按钮的拨动操作,拨档开关可以设置为不同的档位;拨档开关位于不同的档位时,输出端即输出不同的输出信号。比如,响应于用户对拨档开关的按钮的第一拨动操作,拨档开关设置为第一档位;拨档开关位于第一档位时,输出端输出第一输出信号(比如,第一电平);响应于用户对拨档开关的按钮的第二拨动操作,拨档开关设置为第二档位;拨档开关位于第二档位时,输出端输出第二输出信号(比如,第二电平);响应于用户对拨档开关的按钮的第三拨动操作,拨档开关设置为第三档位;拨档开关位于第三档位时,输出端输出第三输出信号(比如,第三电平)。其中,第一拨动操作为将按钮拨动至第一位置,第二拨动操作为将按钮拨动至第二位置,第三拨动操作为将按钮拨动至第三位置。In another implementation manner, the game handle includes a toggle switch, and the toggle switch includes a first gear, a second gear and a third gear. The toggle switch may include a button and an output. In response to the user's toggling operation on the button of the toggle switch, the toggle switch can be set to different gear positions; when the toggle switch is located in different gear positions, the output end outputs different output signals. For example, in response to the user's first toggle operation on the button of the toggle switch, the toggle switch is set to the first gear position; when the toggle switch is in the first gear position, the output terminal outputs the first output signal (for example, the first level); in response to the second toggle operation of the button of the dial switch by the user, the dial switch is set to the second gear position; when the dial switch is in the second gear position, the output terminal outputs a second output signal (for example, second level); in response to the third toggle operation of the button of the toggle switch by the user, the toggle switch is set to the third gear position; when the toggle switch is in the third gear position, the output terminal outputs the third output signal ( For example, the third level). The first toggle operation is to toggle the button to the first position, the second toggle operation is to toggle the button to the second position, and the third toggle operation is to toggle the button to the third position.

游戏手柄可以检测拨档开关的当前档位,从而确定游戏手柄与所连接电子设备的位置关系。响应于检测到拨档开关位于第一档位,则确定检测到游戏手柄与所连接电子设备的位置关系为第一位置关系;响应于检测到拨档开关位于第二档位,则确定检测到游戏手柄与所连接电子设备的位置关系为第二位置关系;响应于检测到拨档开关位于第三档位,则确定检测到游戏手柄与所连接电子设备的位置关系为第三位置关系。The gamepad can detect the current gear of the toggle switch, so as to determine the positional relationship between the gamepad and the connected electronic device. In response to detecting that the shift switch is located at the first gear position, it is determined that the positional relationship between the game handle and the connected electronic device is the first position relationship; in response to detecting that the shift switch is at the second gear position, it is determined that the detection The positional relationship between the gamepad and the connected electronic device is the second positional relationship; in response to detecting that the toggle switch is in the third gear, it is determined that the detected positional relationship between the gamepad and the connected electronic device is the third positional relationship.

游戏手柄确定拨档开关的输出端输出第一输出信号,则确定拨档开关位于第一档位,游戏手柄的工作模式为第一模式;游戏手柄确定拨档开关的输出端输出第二输出信号,则确定拨档开关位于第二档位,游戏手柄的工作模式为第二模式;游戏手柄确定拨档开关的输出端输出第三输出信号,则确定拨档开关位于第三档位,游戏手柄的工作模式为第三模式。If the game handle determines that the output end of the dial switch outputs the first output signal, then it is determined that the dial switch is in the first gear position, and the working mode of the game handle is the first mode; the game handle determines that the output end of the dial switch outputs the second output signal , then it is determined that the dial switch is in the second gear, and the working mode of the gamepad is the second mode; the gamepad determines that the output end of the dial switch outputs the third output signal, then it is determined that the dial switch is in the third gear, and the gamepad is in the third gear. The working mode is the third mode.

示例性的,游戏手柄200的处理器210可以接收开关250的输出信号。如果处理器210 确定开关250的输出信号为第一输出信号,则确定游戏手柄200的工作模式为第一模式;如果处理器210确定开关250的输出信号为第二输出信号,则确定游戏手柄200的工作模式为第二模式;如果处理器210确定开关250的输出信号为第三输出信号,则确定游戏手柄200 的工作模式为第三模式。Exemplarily, the processor 210 of the gamepad 200 may receive the output signal of the switch 250 . If the processor 210 determines that the output signal of the switch 250 is the first output signal, it determines that the operating mode of the gamepad 200 is the first mode; if the processor 210 determines that the output signal of the switch 250 is the second output signal, it determines that the gamepad 200 The working mode of the gamepad 200 is the second mode; if the processor 210 determines that the output signal of the switch 250 is the third output signal, it determines that the working mode of the gamepad 200 is the third mode.

在一种可能的设计中,在第三模式,游戏手柄的操作键对应不同于在第一模式和第二模式的功能。游戏手柄在第一模式、第二模式或第三模式,响应于用户对同一个操作键的操控,可以触发电子设备执行不同的指令。比如,响应于检测到游戏手柄与所连接电子设备的位置关系为第一位置关系,游戏手柄工作在第一模式,响应于用户对第一操作键的操控,游戏手柄触发电子设备执行第一指令;响应于检测到游戏手柄与所连接电子设备的位置关系为第二位置关系,游戏手柄工作在第二模式,响应于用户对第一操作键的操控,游戏手柄触发电子设备执行第二指令;响应于检测到游戏手柄与所连接电子设备的位置关系为第三位置关系,游戏手柄工作在第三模式,响应于用户对第一操作键的操控,游戏手柄触发电子设备执行第三指令。其中,第一操作键为游戏手柄的任意一个操作键。In a possible design, in the third mode, the operation keys of the gamepad correspond to functions different from those in the first mode and the second mode. When the gamepad is in the first mode, the second mode or the third mode, in response to the user's manipulation of the same operation key, the electronic device can be triggered to execute different instructions. For example, in response to detecting that the positional relationship between the gamepad and the connected electronic device is the first positional relationship, the gamepad operates in the first mode, and in response to the user's manipulation of the first operation key, the gamepad triggers the electronic device to execute the first instruction ; In response to detecting that the positional relationship between the gamepad and the connected electronic device is the second positional relationship, the gamepad works in the second mode, and in response to the user's manipulation of the first operation key, the gamepad triggers the electronic device to execute the second instruction; In response to detecting that the positional relationship between the gamepad and the connected electronic device is the third positional relationship, the gamepad operates in the third mode, and in response to the user's manipulation of the first operation key, the gamepad triggers the electronic device to execute the third instruction. Wherein, the first operation key is any operation key of the gamepad.

在一种实现方式中,游戏手柄的第一操作键,在左侧模式对应第一操作信号;在右侧模式对应第二操作信号;在自由模式对应第三操作信号。其中,第三操作信号不同于第一操作信号或第二操作信号。游戏手柄检测到用户对第一操作键的操控时,如果确定游戏手柄的工作模式为自由模式,可以响应于用户对第一操作键的操控,输出第三操作信号。游戏手柄将第三操作信号传输至电子设备。电子设备(或者电子设备的应用)中存储有第一规则,第一规则包括每个操作信号对应的指令。电子设备接收到第三操作信号后,可以根据第一规则,在电子设备的一个应用中执行相应的指令。比如,该应用可以是电子设备的处理器当前运行的应用;或者,该应用可以是电子设备的显示界面当前显示的应用。In an implementation manner, the first operation key of the game handle corresponds to the first operation signal in the left mode; corresponds to the second operation signal in the right mode; and corresponds to the third operation signal in the free mode. Wherein, the third operation signal is different from the first operation signal or the second operation signal. When the gamepad detects the user's manipulation of the first operation key, if it is determined that the working mode of the gamepad is the free mode, a third operation signal can be output in response to the user's manipulation of the first operation key. The gamepad transmits the third operation signal to the electronic device. A first rule is stored in the electronic device (or an application of the electronic device), and the first rule includes an instruction corresponding to each operation signal. After receiving the third operation signal, the electronic device can execute a corresponding instruction in an application of the electronic device according to the first rule. For example, the application may be an application currently running on the processor of the electronic device; or, the application may be an application currently displayed on a display interface of the electronic device.

示例性的,如图12B,游戏手柄包括按键1、按键2、按键3、按键4和摇杆5。游戏手柄安装在手机左侧时,按键1、按键2、按键3、按键4和摇杆5,分别对应操作信号1、操作信号2、操作信号3、操作信号4和操作信号5。游戏手柄安装在手机右侧时,按键1、按键2、按键3、按键4和摇杆5,分别对应操作信号6、操作信号7、操作信号8、操作信号9 和操作信号10。游戏手柄为自由模式时,按键1、按键2、按键3、按键4和摇杆5,分别对应操作信号11、操作信号12、操作信号13、操作信号14和操作信号15。游戏手柄确认其安装在手机的左侧时,接收到用户对按键1的按压操作,响应于用户对按键1的按压操作,输出操作信号1;手机接收到操作信号1,根据第一规则,确定操作信号1对应的指令为,在游戏中控制游戏模拟角色换游戏装备。游戏手柄确认其安装在手机的右侧时,接收到用户对按键1的按压操作,响应于用户对按键1的按压操作,输出操作信号6;手机接收到操作信号6,根据第一规则,确定操作信号6对应的指令为,在游戏中控制游戏模拟角色捡起游戏装备。游戏手柄确认其为自由模式时,接收到用户对按键1的按压操作,响应于用户对按键1的按压操作,输出操作信号11;手机接收到操作信号11,根据第一规则,确定操作信号11对应的指令为,在游戏中控制游戏模拟角色蹲下。Exemplarily, as shown in FIG. 12B , the gamepad includes a button 1 , a button 2 , a button 3 , a button 4 and a joystick 5 . When the gamepad is installed on the left side of the mobile phone, button 1, button 2, button 3, button 4 and joystick 5 correspond to operation signal 1, operation signal 2, operation signal 3, operation signal 4 and operation signal 5 respectively. When the gamepad is installed on the right side of the mobile phone, button 1, button 2, button 3, button 4 and joystick 5 correspond to operation signal 6, operation signal 7, operation signal 8, operation signal 9 and operation signal 10 respectively. When the gamepad is in free mode, button 1, button 2, button 3, button 4 and joystick 5 correspond to operation signal 11, operation signal 12, operation signal 13, operation signal 14 and operation signal 15 respectively. When the gamepad confirms that it is installed on the left side of the mobile phone, it receives the user's pressing operation on the button 1, and outputs the operation signal 1 in response to the user's pressing operation on the button 1; the mobile phone receives the operation signal 1, and determines according to the first rule. The instruction corresponding to the operation signal 1 is to control the game simulation character to change the game equipment in the game. When the gamepad confirms that it is installed on the right side of the mobile phone, it receives the user's pressing operation on the button 1, and outputs the operation signal 6 in response to the user's pressing operation on the button 1; the mobile phone receives the operation signal 6, and determines according to the first rule. The instruction corresponding to the operation signal 6 is to control the game simulation character to pick up the game equipment in the game. When the gamepad confirms that it is in free mode, it receives the user's pressing operation on the button 1, and outputs the operation signal 11 in response to the user's pressing operation on the button 1; the mobile phone receives the operation signal 11, and determines the operation signal 11 according to the first rule. The corresponding command is to control the game simulation character to crouch in the game.

这样,游戏手柄安装在手机左边或右边或独立于手机时,响应于用户对同一个操作键的操控,执行不同的指令。In this way, when the gamepad is installed on the left or right side of the mobile phone or is independent of the mobile phone, in response to the user's manipulation of the same operation key, different instructions are executed.

在另一种实现方式中,游戏手柄的一个操作键,对应一个操作信号。游戏手柄检测到用户对一个操作键的操控时,将游戏手柄的工作模式信息,和响应于用户对一个操作键的操控输出的操作信号,传输至电子设备。电子设备(或者电子设备的应用)中存储有第二规则,第二规则包括,每个操作信号在不同的游戏手柄工作模式对应的指令。比如,对于第一操作信号,左侧模式对应指令1,右侧模式对应指令2,自由模式对应指令3。电子设备接收到第一操作信号和游戏手柄的工作模式信息后,根据游戏手柄的工作模式信息确定游戏手柄的工作模式;并根据接收到的第一操作信号、游戏手柄的工作模式和第二规则,在电子设备的一个应用中执行相应的指令。比如,该应用可以是电子设备的处理器当前运行的应用;或者,该应用可以是电子设备的显示界面当前显示的应用。In another implementation manner, one operation key of the game handle corresponds to one operation signal. When the gamepad detects the user's manipulation of an operation key, it transmits the working mode information of the gamepad and an operation signal output in response to the user's manipulation of an operation key to the electronic device. A second rule is stored in the electronic device (or an application of the electronic device), and the second rule includes instructions corresponding to each operation signal in different gamepad working modes. For example, for the first operation signal, the left mode corresponds to command 1, the right mode corresponds to command 2, and the free mode corresponds to command 3. After receiving the first operation signal and the working mode information of the gamepad, the electronic device determines the working mode of the gamepad according to the working mode information of the gamepad; and according to the received first operation signal, the working mode of the gamepad and the second rule , and execute the corresponding instruction in an application of the electronic device. For example, the application may be an application currently running on the processor of the electronic device; or, the application may be an application currently displayed on a display interface of the electronic device.

示例性的,如图12B,游戏手柄包括按键1、按键2、按键3、按键4和摇杆5,分别对应操作信号1、操作信号2、操作信号3、操作信号4和操作信号5。游戏手柄接收到用户对按键1的按压操作,响应于用户对按键1的按压操作,输出操作信号1。游戏手柄将操作信号1和游戏手柄的工作模式信息传输至手机。手机接收到操作信号1和游戏手柄的工作模式信息,根据游戏手柄的工作模式信息确定游戏手柄的工作模式。比如,手机确认游戏手柄的工作模式为左侧模式,根据第二规则,确认操作信号1对应的指令为,在游戏中控制游戏模拟角色换游戏装备。手机确认游戏手柄的工作模式为右侧模式,根据第二规则,确认操作信号1对应的指令为,在游戏中控制游戏模拟角色捡起游戏装备。手机确认游戏手柄的工作模式为自由模式,根据第二规则,确认操作信号1对应的指令为,在游戏中控制游戏模拟角色蹲下。Exemplarily, as shown in FIG. 12B , the gamepad includes button 1 , button 2 , button 3 , button 4 and joystick 5 , corresponding to operation signal 1 , operation signal 2 , operation signal 3 , operation signal 4 and operation signal 5 respectively. The gamepad receives the pressing operation of the button 1 by the user, and outputs an operation signal 1 in response to the pressing operation of the button 1 by the user. The gamepad transmits the operation signal 1 and the working mode information of the gamepad to the mobile phone. The mobile phone receives the operation signal 1 and the working mode information of the gamepad, and determines the working mode of the gamepad according to the working mode information of the gamepad. For example, the mobile phone confirms that the working mode of the gamepad is the left mode, and according to the second rule, confirms that the instruction corresponding to the operation signal 1 is to control the game simulation character to change the game equipment in the game. The mobile phone confirms that the working mode of the gamepad is the right mode, and according to the second rule, confirms that the instruction corresponding to the operation signal 1 is to control the game simulation character to pick up the game equipment in the game. The mobile phone confirms that the working mode of the gamepad is the free mode, and according to the second rule, confirms that the instruction corresponding to the operation signal 1 is to control the game simulation character to crouch in the game.

这样,游戏手柄安装在手机左边或右边或独立于手机时,响应于用户对同一个操作键的操控,执行不同的指令。In this way, when the gamepad is installed on the left or right side of the mobile phone or is independent of the mobile phone, in response to the user's manipulation of the same operation key, different instructions are executed.

在一些实施例中,游戏手柄的操作键在第三模式的功能,可以与游戏手柄在第一模式或第二模式的功能相同。比如,在第一模式,响应于用户对第一操作键的操控,游戏手柄触发电子设备执行第一指令;在第二模式,响应于用户对第一操作键的操控,游戏手柄触发电子设备执行第二指令;在第三模式,响应于用户对第一操作键的操控,游戏手柄触发电子设备执行第一指令。或者,在第一模式,响应于用户对第一操作键的操控,游戏手柄触发电子设备执行第一指令;在第二模式,响应于用户对第一操作键的操控,游戏手柄触发电子设备执行第二指令;在第三模式,响应于用户对第一操作键的操控,游戏手柄触发电子设备执行第二指令。In some embodiments, the functions of the operation keys of the gamepad in the third mode may be the same as the functions of the gamepad in the first mode or the second mode. For example, in the first mode, in response to the user's manipulation of the first operation key, the gamepad triggers the electronic device to execute the first instruction; in the second mode, in response to the user's manipulation of the first operation key, the gamepad triggers the electronic device to execute the first instruction. The second instruction; in the third mode, in response to the user's manipulation of the first operation key, the gamepad triggers the electronic device to execute the first instruction. Alternatively, in the first mode, in response to the user's manipulation of the first operation key, the gamepad triggers the electronic device to execute the first instruction; in the second mode, in response to the user's manipulation of the first operation key, the gamepad triggers the electronic device to execute the first instruction The second instruction; in the third mode, in response to the user's manipulation of the first operation key, the gamepad triggers the electronic device to execute the second instruction.

本申请实施例提供的游戏手柄的控制方法,游戏手柄安装在电子设备的左侧,则工作在第一模式(比如,左侧模式);游戏手柄安装在电子设备的右侧,则工作在第二模式(比如,右侧模式);游戏手柄独立于电子设备,即不安装在电子设备的左侧,也不安装在电子设备的右侧,则工作在第三模式(比如,自由模式)。不同的工作模式下,游戏手柄的操作键可以对应不同的功能。从而,同一个游戏手柄,既可以安装在电子设备的左边,以第一模式工作;也可以安装在电子设备的右边,以第二模式工作;还可以独立于电子设备,以第三模式工作。并且,可以将两个游戏手柄,一个安装在电子设备的左边,以第一模式工作;另一个安装在电子设备的右边,以第二模式工作;两个游戏手柄组合成双边手柄使用。游戏手柄的使用方式灵活,同一个游戏手柄可以实现不同的功能。降低了用户的使用成本,以及生产商的生产和维护成本。In the method for controlling a gamepad provided by the embodiment of the present application, if the gamepad is installed on the left side of the electronic device, it works in the first mode (for example, the left mode); if the gamepad is installed on the right side of the electronic device, it works in the first mode. The second mode (eg, right side mode); the gamepad is independent of the electronic device, that is, not installed on the left side of the electronic device, nor on the right side of the electronic device, and works in the third mode (eg, free mode). In different working modes, the operation keys of the gamepad can correspond to different functions. Therefore, the same gamepad can be installed on the left side of the electronic device to work in the first mode; it can also be installed on the right side of the electronic device to work in the second mode; it can also be independent of the electronic device and work in the third mode. In addition, two gamepads can be installed, one is installed on the left side of the electronic device and works in the first mode; the other is installed on the right side of the electronic device and works in the second mode; the two gamepads can be combined to form a bilateral handle. The use of the gamepad is flexible, and the same gamepad can achieve different functions. Reduce the user's cost of use, as well as the manufacturer's production and maintenance costs.

在一些实施例中,游戏手柄还可以将其工作模式的信息传输至电子设备。电子设备根据游戏手柄的工作模式的信息确认游戏手柄的工作模式。并且,电子设备可以显示游戏手柄的工作模式的提示信息。In some embodiments, the gamepad may also transmit information about its operating mode to the electronic device. The electronic device confirms the operation mode of the gamepad according to the information of the operation mode of the gamepad. Also, the electronic device can display prompt information about the working mode of the gamepad.

示例性的,游戏手柄200的处理器210将游戏手柄200的工作模式的信息,通过游戏手柄200的无线通信模块220发送至电子设备100。电子设备100的无线通信模块120接收到游戏手柄200的工作模式的信息,并将该信息传输至电子设备100的处理器110。电子设备100的处理器110可以根据游戏手柄200的工作模式的信息确定游戏手柄200的工作模式。并且,电子设备100的显示屏130上可以显示游戏手柄200的工作模式的提示信息。Exemplarily, the processor 210 of the gamepad 200 sends the information of the working mode of the gamepad 200 to the electronic device 100 through the wireless communication module 220 of the gamepad 200 . The wireless communication module 120 of the electronic device 100 receives the information of the working mode of the gamepad 200 and transmits the information to the processor 110 of the electronic device 100 . The processor 110 of the electronic device 100 may determine the operation mode of the gamepad 200 according to the information of the operation mode of the gamepad 200 . In addition, the display screen 130 of the electronic device 100 may display prompt information of the working mode of the gamepad 200 .

在一种示例中,如图13,电子设备100可以接收用户对“游戏手柄”选项801的点击操作(如单击操作)。响应于用户对“游戏手柄”选项801的点击操作,电子设备100可以显示图13中游戏手柄界面。该游戏手柄界面中包括“惯用手”选项802,“工作模式”提示信息805。比如,游戏手柄确认其工作在左侧模式,相应的,电子设备的“工作模式”提示信息 805显示为“左手模式”。游戏手柄确认其工作在右侧模式,相应的,电子设备的“工作模式”提示信息805显示为“右手模式”。游戏手柄确认其工作在自由模式,相应的,电子设备的“工作模式”提示信息805显示为“自由模式”。In one example, as shown in FIG. 13 , the electronic device 100 may receive a user's click operation (eg, a click operation) on the "Gamepad" option 801 . In response to the user's click operation on the "Gamepad" option 801, the electronic device 100 may display the gamepad interface in FIG. 13 . The gamepad interface includes a "dominant hand" option 802 and a "working mode" prompt 805 . For example, if the gamepad confirms that it works in the left-hand mode, correspondingly, the "working mode" prompt message 805 of the electronic device is displayed as "left-hand mode". The gamepad confirms that it works in the right-hand mode, and accordingly, the "working mode" prompt 805 of the electronic device is displayed as "right-hand mode". The gamepad confirms that it is working in free mode, and accordingly, the "working mode" prompt message 805 of the electronic device is displayed as "free mode".

需要说明的是,不同的电子设备有不同的设计。例如,在部分电子设备中,上述“游戏手柄”选项801可以包括在蓝牙界面。比如,电子设备显示游戏手柄界面的方式包括响应于用户点击“设置-游戏手柄”的操作。比如,电子设备显示游戏手柄界面的方式也可以为,响应于用户点击“设置-蓝牙-游戏手柄”的操作。It should be noted that different electronic devices have different designs. For example, in some electronic devices, the above-mentioned "gamepad" option 801 may be included in the Bluetooth interface. For example, the manner in which the electronic device displays the gamepad interface includes responding to the operation of the user clicking "settings-gamepad". For example, the manner in which the electronic device displays the gamepad interface may also be in response to the operation of the user clicking "settings-bluetooth-gamepad".

在一个实施例中,以手机和游戏手柄为例。如图14,游戏手柄包括nRF52832,RKJXY10006,两个AK8789-L等。其中,NordicTMnRF52832为处理器和蓝牙模块二合一设计的一种芯片,可以实现本申请实施例中游戏手柄的处理器和无线通信模块的功能。ALPSRKJXY10006是一种手柄摇杆,可以实现本申请实施例中操作键的功能。AKM AK8789-L是一种霍尔传感器,分别设置在游戏手柄的左、右两端,可以实现本申请实施例中磁传感器的功能。当然,游戏手柄还可以包括按键,触摸板,以及显示屏等,图14中未示出。手机包括Hi3680,Hi1103,磁铁,手机壳等。手机壳安装在手机上。HisiliconTMHi3680是一种处理器,可以实现本申请实施例中手机的处理器的功能。Hi1103是一个蓝牙模块,可以实现本申请实施例中手机的无线通信模块的功能。磁铁设置在手机的手机壳上,分别位于手机壳左右两侧,磁铁的位置和AK8789-L的位置相匹配。In one embodiment, mobile phones and gamepads are used as examples. As shown in Figure 14, the gamepad includes nRF52832, RKJXY10006, two AK8789-L, etc. Among them, NordicTMnRF52832 is a chip designed by combining a processor and a Bluetooth module, and can implement the functions of the processor of the gamepad and the wireless communication module in the embodiment of the present application. ALPSRKJXY10006 is a handle rocker, which can realize the functions of the operation keys in the embodiments of the present application. AKM AK8789-L is a Hall sensor, which is respectively arranged on the left and right ends of the game handle, and can realize the function of the magnetic sensor in the embodiment of the present application. Of course, the gamepad may also include buttons, a touch pad, and a display screen, etc., which are not shown in FIG. 14 . Phones include Hi3680, Hi1103, magnets, phone cases, etc. The phone case is installed on the phone. HisiliconTMHi3680 is a processor, which can implement the function of the processor of the mobile phone in the embodiment of the present application. Hi1103 is a Bluetooth module, which can implement the function of the wireless communication module of the mobile phone in the embodiment of the present application. The magnets are set on the phone case of the mobile phone, respectively on the left and right sides of the phone case, and the position of the magnet matches the position of the AK8789-L.

当游戏手柄与手机连接时,两个霍尔传感器AK8789-L中的一个感应到手机上的磁铁的磁信号,存在输出信号。比如,安装在游戏手柄右侧的霍尔传感器AK8789-L感应到手机上的磁铁的磁信号。安装在游戏手柄右侧的霍尔传感器AK8789-L将输出信号传输至游戏手柄的处理器nRF52832;处理器nRF52832接收到对应的输出信号后,可以确认游戏手柄工作在左侧模式。游戏手柄的处理器nRF52832将游戏手柄的工作模式信息,通过蓝牙模块nRF52832 传输至手机的蓝牙模块Hi1103。手机蓝牙模块Hi1103接收到游戏手柄的工作模式信息后,将该信息传输至手机的处理器Hi3680;手机处理器Hi3680可以根据游戏手柄的工作模式信息确定游戏手柄的工作模式,并在手机的设置信息中显示游戏手柄的工作模式。When the gamepad is connected to the mobile phone, one of the two hall sensors AK8789-L senses the magnetic signal of the magnet on the mobile phone, and there is an output signal. For example, the Hall sensor AK8789-L installed on the right side of the gamepad senses the magnetic signal of the magnet on the phone. The Hall sensor AK8789-L installed on the right side of the gamepad transmits the output signal to the processor nRF52832 of the gamepad; after the processor nRF52832 receives the corresponding output signal, it can confirm that the gamepad is working in the left mode. The processor nRF52832 of the gamepad transmits the working mode information of the gamepad to the Bluetooth module Hi1103 of the mobile phone through the Bluetooth module nRF52832. After receiving the working mode information of the gamepad, the mobile phone Bluetooth module Hi1103 transmits the information to the processor Hi3680 of the mobile phone; the mobile phone processor Hi3680 can determine the working mode of the gamepad according to the working mode information of the gamepad, and set it in the setting information of the mobile phone. Displays the working mode of the gamepad.

当游戏手柄的摇杆RKJXY10006检测到用户的操作时,响应于用户对RKJXY10006的操控,输出对应的操控信息。游戏手柄的处理器nRF52832接收到操控信息,根据操控信息和游戏手柄的工作模式进行编码,生成编码信号,并将该编码信号通过蓝牙模块nRF52832传输至手机的蓝牙模块Hi1103。手机的蓝牙模块Hi1103将接收到的编码信号传输至手机的处理器Hi3680。手机的处理器Hi3680接收到编码信号后,根据编码信号和预先设定的规则,在当前的应用中执行对应的指令。When the joystick RKJXY10006 of the gamepad detects the user's operation, it outputs corresponding manipulation information in response to the user's manipulation of the RKJXY10006. The processor nRF52832 of the gamepad receives the manipulation information, encodes it according to the manipulation information and the working mode of the gamepad, generates an encoded signal, and transmits the encoded signal to the Bluetooth module Hi1103 of the mobile phone through the Bluetooth module nRF52832. The Bluetooth module Hi1103 of the mobile phone transmits the received encoded signal to the processor Hi3680 of the mobile phone. After receiving the encoded signal, the processor Hi3680 of the mobile phone executes the corresponding instruction in the current application according to the encoded signal and the preset rules.

在一个实施例中,以手机和游戏手柄为例。如图15,游戏手柄包括nRF52832,RKJXY10006,拨档开关等。NordicTMnRF52832为处理器和蓝牙模块二合一设计的一种芯片,可以实现本申请实施例中游戏手柄的处理器和无线通信模块的功能。ALPS RKJXY10006是一种手柄摇杆,可以实现本申请实施例中操作键的功能。拨档开关为常用的三档开关。手机包括Hi3680,Hi1103等。HisiliconTMHi3680是一种处理器,可以实现本申请实施例中手机的处理器的功能。Hi1103是一个蓝牙模块,可以实现本申请实施例中手机的无线通信模块的功能。In one embodiment, mobile phones and gamepads are used as examples. As shown in Figure 15, the gamepad includes nRF52832, RKJXY10006, toggle switch, etc. Nordic TM nRF52832 is a chip designed by combining a processor and a Bluetooth module, which can implement the functions of the processor and the wireless communication module of the gamepad in the embodiment of the present application. ALPS RKJXY10006 is a handle rocker, which can realize the functions of the operation keys in the embodiments of the present application. The dial switch is a commonly used three-speed switch. Mobile phones include Hi3680, Hi1103, etc. Hisilicon Hi3680 is a processor, which can implement the functions of the processor of the mobile phone in the embodiment of the present application. Hi1103 is a Bluetooth module, which can implement the function of the wireless communication module of the mobile phone in the embodiment of the present application.

当游戏手柄与手机连接时,游戏手柄的处理器nRF52832接收拨档开关的输出信号,并根据拨档开关的输出信号确定游戏手柄的工作模式。比如,处理器nRF52832接收到第一电平,则确定游戏手柄工作在左侧模式。游戏手柄的处理器nRF52832将游戏手柄的工作模式信息,通过蓝牙模块nRF52832传输至手机的蓝牙模块Hi1103。手机蓝牙模块Hi1103接收到游戏手柄的工作模式信息后,将该信息传输至手机的处理器Hi3680;手机处理器Hi3680可以根据游戏手柄的工作模式信息确定游戏手柄的工作模式,并在手机的设置信息中显示游戏手柄的工作模式。When the gamepad is connected to the mobile phone, the processor nRF52832 of the gamepad receives the output signal of the dial switch, and determines the working mode of the gamepad according to the output signal of the dial switch. For example, if the processor nRF52832 receives the first level, it is determined that the gamepad works in the left mode. The processor nRF52832 of the gamepad transmits the working mode information of the gamepad to the Bluetooth module Hi1103 of the mobile phone through the Bluetooth module nRF52832. After receiving the working mode information of the gamepad, the mobile phone Bluetooth module Hi1103 transmits the information to the processor Hi3680 of the mobile phone; the mobile phone processor Hi3680 can determine the working mode of the gamepad according to the working mode information of the gamepad, and set it in the setting information of the mobile phone. Displays the working mode of the gamepad.

当游戏手柄的摇杆RKJXY10006检测到用户的操作时,响应于用户对RKJXY10006的操控,输出对应的操控信息。游戏手柄的处理器nRF52832接收到操控信息,根据操控信息和游戏手柄的工作模式进行编码,生成编码信号,并将该编码信号通过蓝牙模块nRF52832传输至手机的蓝牙模块Hi1103。手机的蓝牙模块Hi1103将接收到的编码信号传输至手机的处理器Hi3680。手机的处理器Hi3680接收到编码信号后,根据编码信号和预先设定的规则,在当前的应用中执行对应的指令。When the joystick RKJXY10006 of the gamepad detects the user's operation, it outputs corresponding manipulation information in response to the user's manipulation of the RKJXY10006. The processor nRF52832 of the gamepad receives the manipulation information, encodes it according to the manipulation information and the working mode of the gamepad, generates an encoded signal, and transmits the encoded signal to the Bluetooth module Hi1103 of the mobile phone through the Bluetooth module nRF52832. The Bluetooth module Hi1103 of the mobile phone transmits the received encoded signal to the processor Hi3680 of the mobile phone. After receiving the encoded signal, the processor Hi3680 of the mobile phone executes the corresponding instruction in the current application according to the encoded signal and the preset rules.

在本申请的另一些实施例中,本申请实施例公开了一种游戏手柄,包括处理器,以及与处理器相连的存储器、通信接口。可选的,该游戏手柄还可以包括第一磁传感器、第二磁传感器。可选的,该游戏手柄还可以包括拨档开关。比如,该处理器可以是图6中的处理器210,存储器可以是处理器210中的存储器,通信接口可以是图6中的无线通信模块220,第一磁传感器、第二磁传感器可以是图6中的磁传感器240,拨档开关可以是图6中的开关250。其中一个或多个计算机程序被存储在上述存储器中并被配置为被该处理器执行,该一个或多个计算机程序包括指令,上述指令可以用于执行上述方法实施例中的各个步骤。In other embodiments of the present application, the embodiments of the present application disclose a gamepad, which includes a processor, a memory and a communication interface connected to the processor. Optionally, the game handle may further include a first magnetic sensor and a second magnetic sensor. Optionally, the gamepad may further include a toggle switch. For example, the processor may be the processor 210 in FIG. 6 , the memory may be the memory in the processor 210 , the communication interface may be the wireless communication module 220 in FIG. 6 , the first magnetic sensor and the second magnetic sensor may be Magnetic sensor 240 in FIG. 6 , the toggle switch may be switch 250 in FIG. 6 . One or more computer programs are stored in the above-mentioned memory and configured to be executed by the processor, and the one or more computer programs include instructions, and the above-mentioned instructions can be used to perform various steps in the above-mentioned method embodiments.

本申请实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机程序代码,当电子设备的处理器执行该计算机程序代码时,电子设备执行上述方法实施例中的各个步骤。Embodiments of the present application further provide a computer storage medium, where computer program codes are stored in the computer storage medium. When a processor of an electronic device executes the computer program code, the electronic device executes each step in the above method embodiments.

本申请实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述方法实施例中的各个步骤。The embodiments of the present application further provide a computer program product, which, when the computer program product runs on a computer, causes the computer to execute each step in the above method embodiments.

其中,本申请实施例提供的游戏手柄、计算机存储介质或者计算机程序产品均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Wherein, the gamepad, computer storage medium or computer program product provided by the embodiments of the present application are all used to execute the corresponding method provided above. Therefore, for the beneficial effects that can be achieved, reference may be made to the corresponding method provided above. The beneficial effects of , will not be repeated here.

通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。From the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be allocated as required. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. For the specific working process of the system, apparatus and unit described above, reference may be made to the corresponding process in the foregoing method embodiments, and details are not described herein again.

在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。Each functional unit in each of the embodiments of the embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage The medium includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: flash memory, removable hard disk, read-only memory, random access memory, magnetic disk or optical disk and other media that can store program codes.

以上所述,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto, and any changes or substitutions within the technical scope disclosed in the embodiments of the present application shall be covered by this within the protection scope of the application examples. Therefore, the protection scope of the embodiments of the present application should be subject to the protection scope of the claims.

Claims (18)

1. A method of controlling a joystick, the method comprising:
establishing connection between the gamepad and the electronic equipment;
detecting the position relation between the gamepad and the connected electronic equipment;
responding to the detection that the position relation between the game handle and the connected electronic equipment is a first position relation, and enabling a first operation key of the game handle to correspond to a first instruction;
responding to the fact that the position relation between the game handle and the connected electronic equipment is the second position relation, and enabling the first operation key of the game handle to correspond to the second instruction;
wherein the first positional relationship is different from the second positional relationship, and the first instruction is different from the second instruction.
2. The method of claim 1,
the first positional relationship is that the gamepad is mounted on a first side of the electronic device;
the second positional relationship is that the gamepad is mounted on a second side of the electronic device;
the first side is different from the second side, and when the electronic equipment is placed in a transverse screen or a vertical screen, the first side and the second side are the left side and the right side of the electronic equipment.
3. The method of claim 2, wherein the gamepad includes a first magnetic sensor and a second magnetic sensor, the first and second magnetic sensors being disposed on left and right sides of the gamepad, respectively, the method further comprising:
if the first magnetic sensor is determined to have the output signal, determining that the gamepad is installed on the first side of the electronic equipment;
and if the second magnetic sensor is determined to have the output signal, determining that the game handle is installed on the second side of the electronic equipment.
4. The method of claim 1, wherein the gamepad includes a toggle switch, said detecting a positional relationship of the gamepad to the connected electronic device; responding to the detection that the position relation between the game handle and the connected electronic equipment is a first position relation, and enabling a first operation key of the game handle to correspond to a first instruction; in response to the detection that the position relationship between the game handle and the connected electronic equipment is the second position relationship, the corresponding second instruction of the first operation key of the game handle comprises:
detecting the current gear of the gear shifting switch;
responding to the first instruction corresponding to the first operating key of the game handle when the gear shifting switch is detected to be positioned at the first gear;
and responding to the detection that the gear shifting switch is located at a second gear, wherein the first operation key of the game handle corresponds to a second instruction.
5. The method of claim 1, further comprising:
and responding to the third position relation detected by the position relation between the game handle and the connected electronic equipment, wherein the first operation key of the game handle corresponds to a third instruction.
6. The method of claim 5, further comprising:
under the condition that the gamepad is started, if the gamepad is determined not to be installed on the first side or the second side of the electronic equipment, determining that the position relation between the gamepad and the connected electronic equipment is a third position relation; wherein the first side is different from the second side.
7. The method of claim 6, wherein the gamepad includes a first magnetic sensor and a second magnetic sensor, the first and second magnetic sensors being disposed on left and right sides of the gamepad, respectively, the method further comprising:
and if the first magnetic sensor and the second magnetic sensor are determined to have no output signals, determining that the position relation between the gamepad and the connected electronic equipment is a third position relation.
8. The method of claim 4, further comprising:
and responding to the third gear position detected by the gear shifting switch, wherein the first operation key of the game handle corresponds to a third instruction.
9. A gamepad, comprising:
the communication interface is used for establishing the connection between the gamepad and the electronic equipment;
the processor is used for detecting the position relation between the gamepad and the connected electronic equipment; in response to the fact that the position relation between the game handle and the connected electronic equipment is a first position relation, determining that a first operation key of the game handle corresponds to a first instruction; in response to the fact that the position relation between the game handle and the connected electronic equipment is the second position relation, determining that a first operation key of the game handle corresponds to a second instruction;
wherein the first positional relationship is different from the second positional relationship, and the first instruction is different from the second instruction.
10. The gamepad of claim 9,
the first positional relationship is that the gamepad is mounted on a first side of the electronic device;
the second positional relationship is that the gamepad is mounted on a second side of the electronic device;
the first side is different from the second side, and when the electronic equipment is placed in a transverse screen or a vertical screen, the first side and the second side are the left side and the right side of the electronic equipment.
11. The gamepad according to claim 10, further comprising a first magnetic sensor and a second magnetic sensor, arranged on the left and right sides of the gamepad, respectively, the detecting of the positional relationship of the gamepad with the connected electronic device comprising:
determining output signals of the first and second magnetic sensors;
if the first magnetic sensor is determined to have the output signal, determining that the gamepad is installed on the first side of the electronic equipment; and if the second magnetic sensor is determined to have the output signal, determining that the game handle is installed on the second side of the electronic equipment.
12. The gamepad of claim 9, further comprising a shift switch that detects the positional relationship of the gamepad to a connected electronic device; in response to the fact that the position relation between the game handle and the connected electronic equipment is a first position relation, determining that a first operation key of the game handle corresponds to a first instruction; in response to detecting that the position relationship between the game handle and the connected electronic equipment is a second position relationship, determining that the first operation key of the game handle corresponds to the second instruction comprises the following steps:
detecting the current gear of the gear shifting switch;
in response to the fact that the gear shifting switch is located in a first gear, determining that a first operation key of the game handle corresponds to a first instruction;
and in response to the detection that the gear shifting switch is located in a second gear, determining that the first operation key of the game handle corresponds to a second instruction.
13. The gamepad of claim 9,
the processor is further configured to determine that the first operation key of the gamepad corresponds to the third instruction in response to detecting that the position relationship between the gamepad and the connected electronic device is the third position relationship.
14. The gamepad of claim 13,
determining that the position relationship of the gamepad and the connected electronic equipment is a third position relationship if the processor determines that the gamepad is not installed on the first side or the second side of the electronic equipment under the condition that the gamepad is turned on; wherein the first side is different from the second side.
15. The game pad of claim 14, further comprising a first magnetic sensor and a second magnetic sensor, the first magnetic sensor and the second magnetic sensor being disposed on left and right sides of the game pad, respectively,
the processor is further configured to determine output signals of the first and second magnetic sensors;
the processor is further configured to determine that the position relationship between the gamepad and the connected electronic device is a third position relationship if it is determined that no output signal exists from the first magnetic sensor or the second magnetic sensor.
16. The gamepad of claim 12,
the processor is further configured to determine that the first operation key of the game pad corresponds to the third instruction in response to detecting that the shift switch is located in the third gear.
17. A gamepad comprising a communications interface, a memory, one or more processors, at least one key and/or joystick, and one or more programs; wherein the one or more programs are stored in the memory; characterized in that the gamepad is adapted to perform the method according to any of the claims 1-8.
18. A computer storage medium comprising computer instructions that, when executed on an electronic device, cause the electronic device to perform the method of any of claims 1-8.
CN201910253426.0A 2019-03-29 2019-03-29 Control method and device of gamepad and storage medium Active CN109999486B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910253426.0A CN109999486B (en) 2019-03-29 2019-03-29 Control method and device of gamepad and storage medium
PCT/CN2020/081327 WO2020200025A1 (en) 2019-03-29 2020-03-26 Control method for gaming handle and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910253426.0A CN109999486B (en) 2019-03-29 2019-03-29 Control method and device of gamepad and storage medium

Publications (2)

Publication Number Publication Date
CN109999486A CN109999486A (en) 2019-07-12
CN109999486B true CN109999486B (en) 2020-09-29

Family

ID=67169026

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910253426.0A Active CN109999486B (en) 2019-03-29 2019-03-29 Control method and device of gamepad and storage medium

Country Status (2)

Country Link
CN (1) CN109999486B (en)
WO (1) WO2020200025A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110124304B (en) * 2019-03-29 2020-09-08 华为技术有限公司 Control method and device for gamepad
CN109999486B (en) * 2019-03-29 2020-09-29 华为技术有限公司 Control method and device of gamepad and storage medium
CN112525566B (en) * 2019-09-17 2022-12-13 Oppo广东移动通信有限公司 Equipment test method and device and electronic equipment

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120058821A1 (en) * 2010-09-04 2012-03-08 Cheng Uei Precision Industry Co., Ltd. Projecting handheld game console and operating method thereof
CN104639964B (en) * 2015-02-13 2018-03-13 青岛海信电器股份有限公司 A kind of method and device for determining direction keys of remote controller key assignments
CN104866199B (en) * 2015-05-29 2019-02-12 小米科技有限责任公司 Button operation processing method and processing device under singlehanded mode, electronic equipment
US10610776B2 (en) * 2015-06-12 2020-04-07 Nintendo Co., Ltd. Supporting device, charging device and controller system
CN205164115U (en) * 2015-10-30 2016-04-20 刘伯德 a gamepad
CN105302251A (en) * 2015-11-24 2016-02-03 深圳市爱坤电子科技有限公司 Tablet computer based on 2.4G removable gamepad and operating method of table computer
CN207066337U (en) * 2017-08-16 2018-03-02 潍坊歌尔电子有限公司 Earth induction handle
CN107519643B (en) * 2017-09-14 2018-06-15 深圳市利达成科技有限公司 Single free assembly type game paddle and assembly method
CN208599155U (en) * 2018-07-25 2019-03-15 深圳市艾柏祺生物科技有限公司 It is conveniently replaceable the handle of key position
CN208626604U (en) * 2018-08-10 2019-03-22 深圳瑞福来智能科技股份有限公司 A kind of projection game paddle
CN110124304B (en) * 2019-03-29 2020-09-08 华为技术有限公司 Control method and device for gamepad
CN109999486B (en) * 2019-03-29 2020-09-29 华为技术有限公司 Control method and device of gamepad and storage medium

Also Published As

Publication number Publication date
WO2020200025A1 (en) 2020-10-08
CN109999486A (en) 2019-07-12

Similar Documents

Publication Publication Date Title
CN110917614B (en) Cloud game system based on block chain system and cloud game control method
CN108234763B (en) Horizontal and vertical screen switching method and device and terminal
EP4123437A1 (en) Screen projection display method and system, terminal device, and storage medium
CN110124304B (en) Control method and device for gamepad
US9223348B2 (en) Split keyboard modification for a pull-out flexible display
JP7728258B2 (en) Application sharing method, electronic device and computer-readable storage medium
CN114115629B (en) Interface display method and device
CN102830909B (en) User interface icon management method and touch device
WO2018077207A1 (en) Viewing angle mode switching method and terminal
WO2018161534A1 (en) Image display method, dual screen terminal and computer readable non-volatile storage medium
US20210200861A1 (en) Control information processing method and apparatus, electronic device, and storage medium
WO2016173427A1 (en) Method, device and computer readable medium for creating motion blur effect
CN109999486B (en) Control method and device of gamepad and storage medium
CN106406924B (en) Control method and device for starting and quitting picture of application program and mobile terminal
US10698579B2 (en) Method, device for displaying reference content and storage medium thereof
TWI559759B (en) Apparatus and method of showing progress bar
CN110764675A (en) A control method and electronic device
WO2018120955A1 (en) Live-encoding method, apparatus, terminal, linked encoding server, and system
CN108513671A (en) A kind of 2D applies display methods and terminal in VR equipment
JP6371402B2 (en) Method and apparatus for updating device firmware
CN109710151B (en) A file processing method and terminal device
CN110045890A (en) The display methods and terminal device of application identities
CN107396178A (en) A kind of method and apparatus for editing video
US10073611B2 (en) Display apparatus to display a mirroring screen and controlling method thereof
KR20140085278A (en) Host apparatus, display apparatus, method for controlling of host apparatus and method for controlling of apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant