🍺 Join Clicknium for quality support, growth opportunities, and a supportive community


def send_hotkey(
hotkey: str,
preaction: Literal["setfocus", "click"] = PreAction.SetFocus,
timeout: int = 30
) -> None

Send hotkey to target element.

 hotkey [Required]: str
   Hotkey string represents one key or combined keys. For example, to represent the letter A, input string “A”. To represent the letters A, B, and C, input paremeter “ABC”. For special keys, please refer to hotkeys.
 preaction: PreAction
   The action to be taken before sending hotkey.
   setfocus: default value, setting the target element to focused state before sending hotkey.
   click: click the target element before sending hotkey.
 timeout: int
   Timeout for the operation, the unit is second, and the default value is 30 seconds.



from clicknium import clicknium as cc, locator, ui

#send Ctrl+a

#send Shift+End

#send Win+e, first press 'Win', then press 'E' and release, and finally release 'Win'
ui(locator.chrome.bing.search_sb_form_q).send_hotkey('{WIN DOWN}e{WIN UP}')
What are your feelings
Updated on 29 August 2023