smallest-cock / RL-Custom-Quickchat

Enables custom quick chats (and more) in Rocket League using keypress automation
4 stars 0 forks source link

Inputs not being received by Rocket League #3

Closed yep-ok closed 7 months ago

yep-ok commented 7 months ago

Hey man, great work, this is a fun project!

I'm trying to get it working and I'm having an issue with the inputs that pyautogui sends not being picked up by the Rocket League window. I can see in the terminal window that the chat messages are being output, and if I have something like Notepad open I can see the output working. But it's like Rocket League is eating the inputs, when I do a quickchat nothing happens.

Did this ever happen to you in testing, and do you happen to have any ideas for how to get it working?

I've tried running RL in different window modes, unbound the default quick chat binds, made sure the T, Y, and U keys are bound correctly, made sure my chat is enabled. I'm not sure what I'm missing.

I'm using a PS5 controller, but I don't think that should be the issue. I updated the button bindings and they seem to work like I mentioned. Also, since you don't have one I figured I'll leave the button array here if you wanted to update it:

buttons = { 'x': 0, 'circle': 1, 'square': 2, 'triangle': 3, 'light': 4, 'ps': 5, 'options': 6, 'left stick': 7, 'right stick': 8, 'L1': 9, 'R1': 10, 'up': 11, 'down': 12, 'left': 13, 'right': 14, 'touchpad': 15, 'mic': 16 }

Any insight you have would be appreciated, would be cool to have this working in game. Thanks!

smallest-cock commented 7 months ago

@yep-ok Sorry to hear that, I haven't personally come across any issue where inputs aren't detected by RL.

Reading your issue, at first I thought it could maybe be a case of you running RL on a non-primary display, but that would only cause a problem with the autoclicker (because pyautogui's screenshot functions only work on the primary display). Pyautogui key presses, however, should be display agnostic because all it does is simulate a key press on your system, which should work on any window that's focused..

So these may be a dumb questions, but are you sure RL is the focused window whenever you're doing the controller inputs (i.e. the script terminal window isn't in focus)? And are you able to manually type out chats with your keyboard? If you can manually type chats, but the pyautogui simulated keypresses don't work, that tells me it's something to do with pyautogui or the script itself.. or maybe even some weird file permissions issue with RL or the script.

Also, I noticed your button dictionary for the PS5 controller doesn't have any tuple values for the D-pad button hats. Is this confirmed to be working for your controller? If so, I may need to update the PS5 buttons dict on the repo because I was under the impression PS5 controllers used hats, based on whats shown here: https://www.pygame.org/docs/ref/joystick.html#playstation-5-controller-pygame-2-x

yep-ok commented 7 months ago

Thanks for the quick reply!

I feel a little silly. It seems like it was a permissions issue, it works if I run the script as admin. Not sure why that wasn't one of the first things I tried...

As for the button bindings, I think the pygame docs are incorrect or out of date. The ones I posted above work for me. I also noticed that the controller is recognized as 'Dualsense Wireless Controller' instead of 'Sony Interactive Entertainment Wireless Controller' like they say in the docs.

Thanks again, sorry for taking your time :)

smallest-cock commented 7 months ago

@yep-ok No worries, I appreciate the feedback! It's happened to me in the past where I've tried to run a script in my downloads folder and it somehow gets restricted to "safe mode" in VS Code and doesn't work properly. I think some folders may have different permissions associated with them, idk

And I'll probably update the PS5 script with those button bindings because 'Dualsense Wireless Controller' sounds more legit than a generic 'Sony Interactive Entertainment Wireless Controller' lol. Thanks for bringing it to my attention.