python packages keyboard/ctypes etc. not able to detect key strokes while playing gta5

I had written a script to record the input that one would give while using a computer. However, this script doesn’t work while playing GTA5.

import keyboard def hook_call(kb_event):     print('up arrow pressed')  keyboard.hook_key('up',hook_call) while True:     if keyboard.is_pressed('esc'):         break 

The above script would print ‘up arrow pressed’ whenever I press up arrow key, however this code doesn’t detect up arrow press while playing gta5. What am I missing here? Any suggestions how can I make this work? I want to record the input a user gives while playing gta5.

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.