Switch
Class for button inputs
__init__(self, seat, name)
special
Initializes the switch
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seat |
int |
controller seat |
required |
name |
str |
controller name |
required |
Source code in game_sdk/controller/inputs/switch.py
def __init__(self, seat: int, name: str):
"""
Initializes the switch
Arguments:
seat: controller seat
name: controller name
"""
super().__init__(seat, name)
off(self, seat)
async
Called when switch is released
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seat |
int |
controller seat |
required |
Source code in game_sdk/controller/inputs/switch.py
async def off(self, seat: int):
"""
Called when switch is released
Arguments:
seat: controller seat
"""
logging.info("Set switch %s to off", self.name)
on(self, seat)
async
Called when switch is pressed
Parameters:
Name | Type | Description | Default |
---|---|---|---|
seat |
int |
controller seat |
required |
Source code in game_sdk/controller/inputs/switch.py
async def on(self, seat: int):
"""
Called when switch is pressed
Arguments:
seat: controller seat
"""
logging.info("Set switch %s to on", self.name)