MCPcopy
hub / github.com/Sentdex/pygta5 / PressKey

Function PressKey

original_project/Versions/v0.01/directkeys.py:50–55  ·  view source on GitHub ↗
(hexKeyCode)

Source from the content-addressed store, hash-verified

48# Actuals Functions
49
50def PressKey(hexKeyCode):
51 extra = ctypes.c_ulong(0)
52 ii_ = Input_I()
53 ii_.ki = KeyBdInput( 0, hexKeyCode, 0x0008, 0, ctypes.pointer(extra) )
54 x = Input( ctypes.c_ulong(1), ii_ )
55 ctypes.windll.user32.SendInput(1, ctypes.pointer(x), ctypes.sizeof(x))
56
57def ReleaseKey(hexKeyCode):
58 extra = ctypes.c_ulong(0)

Callers 10

straightFunction · 0.90
leftFunction · 0.90
rightFunction · 0.90
reverseFunction · 0.90
forward_leftFunction · 0.90
forward_rightFunction · 0.90
reverse_leftFunction · 0.90
reverse_rightFunction · 0.90
no_keysFunction · 0.90
directkeys.pyFile · 0.70

Calls 4

SendInputMethod · 0.80
Input_IClass · 0.70
KeyBdInputClass · 0.70
InputClass · 0.70

Tested by 9

straightFunction · 0.72
leftFunction · 0.72
rightFunction · 0.72
reverseFunction · 0.72
forward_leftFunction · 0.72
forward_rightFunction · 0.72
reverse_leftFunction · 0.72
reverse_rightFunction · 0.72
no_keysFunction · 0.72