ipygame.key
pygame-compatible key module.
ScancodeWrapper Objects
Section titled “ScancodeWrapper Objects”class ScancodeWrapper(tuple)Tuple subclass returned by get_pressed() — indexed by key constant.
get_focused
Section titled “get_focused”def get_focused() -> boolTrue when the display is receiving keyboard input.
get_pressed
Section titled “get_pressed”def get_pressed() -> ScancodeWrapperGet the state of all keyboard buttons.
get_just_pressed
Section titled “get_just_pressed”def get_just_pressed() -> ScancodeWrapperGet keys that were just pressed this frame.
get_just_released
Section titled “get_just_released”def get_just_released() -> ScancodeWrapperGet keys that were just released this frame.
get_mods
Section titled “get_mods”def get_mods() -> intGet the state of modifier keys.
set_mods
Section titled “set_mods”def set_mods(mods: int) -> NoneSet the state of modifier keys.
set_repeat
Section titled “set_repeat”def set_repeat(delay: int = 0, interval: int = 0) -> NoneControl how held keys are repeated.
get_repeat
Section titled “get_repeat”def get_repeat() -> tuple[int, int]Get the repeat delay and interval.
def name(key: int, use_compat: bool = True) -> strReturn the descriptive name of a key constant.
key_code
Section titled “key_code”def key_code(name_str: str) -> intGet the key constant from a descriptive name.
start_text_input
Section titled “start_text_input”def start_text_input() -> NoneStart receiving TEXTINPUT events.
stop_text_input
Section titled “stop_text_input”def stop_text_input() -> NoneStop receiving TEXTINPUT events.
set_text_input_rect
Section titled “set_text_input_rect”def set_text_input_rect(rect) -> NoneSet the IME candidate list rectangle (no-op in ipygame).