When looking up how to use keybd_event on Microsoft Learn, it says:
Note This function has been superseded. Use SendInput instead.
But when looking at how to use SendInput, it looks a lot more complex for not much, if any, gain, even though it can handle mouse and keyboard similarly.
For instance: Pressing Ctrl down with minimal effort:
keybd_event:
windll.user32.keybd_event(0x11, 0, 0, 0)
sendInput takes 6 more lines while also calling a very similar-looking function, KEYBDINPUT:
lib = WinDLL('user32')
lib.SendInput.argtypes = w.UINT,POINTER(INPUT),c_int
lib.SendInput.restype = w.UINTi = INPUT()
i.type = INPUT_KEYBOARD
i.ki = KEYBDINPUT(0,0x11,0,0,0)
lib.SendInput(1,byref(i),sizeof(INPUT))
As a comment on SendInput vs. keybd_event says, emphasis mine: