Ryochan7 / DS4Windows

Like those other ds4tools, but sexier
https://ryochan7.github.io/ds4windows-site/
GNU General Public License v3.0
6.99k stars 808 forks source link

PSO2NGS DualSense KB+M=sendinput handler doesn't work after gameguard update April 5th 2023 #2900

Closed ArsRaha closed 1 year ago

ArsRaha commented 1 year ago

Describe the bug KB+M handler=sendinput doesn't work after gameguard update

To Reproduce Steps to reproduce the behavior:

  1. Connected DualSense via Bluetooth 4.0
  2. Using right touchpad, PS button, and option button as keyboard macro
  3. Windows recognize the macro, but not in-game PSO2NGS

Expected behavior Before the gameguard update, I have same issue with this. but installing then uninstalling fakerinput works before

Screenshots and Logs (I'm not sure if screenshot nor logs can describe the bug)

Desktop (please complete the following information):

Additional context Currently I use fakerinput now and KB+M input in-game works. Unfortunately, there are some buttons didn't work e.g OemPlus. I have remap OemPlus to any button on my DualSense but no work too. So I'm forced to use another keyboard button which can be recognized in-game. Honestly this is not a big issue for now. But I'm really curious and worry if someday it suddenly broken again after gameguard update. So here, please if someone can help me figure out how to fix it without using fakerinput since this input has much problem for me.

Note: I'm done reading this https://docs.ds4windows.app/troubleshooting/kb-mouse-issues/ and because no one discussing about PSO2NGS GameGuard, so I decided to report here.

Update: now, each windows restart, KB+M handler=fakerinput not recognize windows nor in-game. need to re-install fakerinput to make it works again.

Perseonn commented 1 year ago

Please allow me to add more information as I am also affected by this.

Parameter difference from OP

Screenshots and Logs DS4 Windows Logs does not show any abnormality ds4windows_log_20230405.1.txt

Desktop

Additional context

PS: Sorry to alert OP, but I used the wrong account to post.

Ryochan7 commented 1 year ago

Haven't played PSO2 since its initial US launch. When anti-cheat systems are used in a game, it is almost guaranteed that any app that uses SendInput to fake device events will not work. The use of the FakerInput driver and mapping system will be mandatory. In some games (Valorant for example), you might also be restricted to one mouse pointer device as the game will only use the first device it detects events from; it might be the case you cannot use fake mouse events and a physical mouse at the same time.

I'll look into the OemPlus key mapping for FakerInput and see if it works on my end.

Edit: The mapping works as intended on my end. I never got around to abstracting OEM key mappings so maybe that would help.

Edit 2: It looks like the + mapping should work in any region according to Microsoft. Are you sure you are holding the Shift key modifier when you try to type a + character with that key (= key normally)?

https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes

idealism101 commented 1 year ago

LS and RS select none,Disable the virtual handle in other,hide ds4 controller in setting,When my Bluetooth is connected, the handle test recognizes but does not respond

Perseonn commented 1 year ago

I would like to add that, different from OP, FakerInput works consistently after restarts. Updated my post up there for easier reference.

ArsRaha commented 1 year ago

Haven't played PSO2 since its initial US launch. When anti-cheat systems are used in a game, it is almost guaranteed that any app that uses SendInput to fake device events will not work. The use of the FakerInput driver and mapping system will be mandatory. In some games (Valorant for example), you might also be restricted to one mouse pointer device as the game will only use the first device it detects events from; it might be the case you cannot use fake mouse events and a physical mouse at the same time.

I'll look into the OemPlus key mapping for FakerInput and see if it works on my end.

Edit: The mapping works as intended on my end. I never got around to abstracting OEM key mappings so maybe that would help.

Edit 2: It looks like the + mapping should work in any region according to Microsoft. Are you sure you are holding the Shift key modifier when you try to type a + character with that key (= key normally)?

https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes

I'm sorry for late reply...

oh,, so that is the problem.. I don't use shift key modifier to OemPlus as in-game PSO2 perhaps recognize it as "=" instead. I change my OemPlus to OemMinus which doesn't need shift as PSO2 recognize it as "-". this changing actually solve my problem.

now, the main problem is as @Perseonn who use Windows 10 said about FakerInput still consistently works after restart. Unfortunately no for me. I need reinstalling FakerInput everytime I restart my PC. Not sure what's going on, but yes FakerInput still help me to regain KB+M access in-game PSO2NGS.

Is it because I use Windows 11?

Additional: after restart then reinstalling FakerInput, always got notification "Need Restart". I'm ignore it without restarting, FakerInput does works for me

Perseonn commented 1 year ago

@ArsRaha If you Sleep or Hibernate, does the FakerInput also stopped working after waking up?

Additional info not mentioned: PSO2NGS, starting from this update is hidden from Task Manager. Added to my initial post.

ArsRaha commented 1 year ago

@ArsRaha If you Sleep or Hibernate, does the FakerInput also stopped working after waking up?

Additional info not mentioned: PSO2NGS, starting from this update is hidden from Task Manager. Added to my initial post.

Never try it before. I never use PC Sleep nor Hibernate. Let me try later to see UPDATE: Aready tried it. Sleep or Hibernate didn't make FakerInput stop working

Are you sure PSO2NGS now hidden from task manager? because I still can see it at apps listing. grouped with GameGuard

Ryochan7 commented 1 year ago

I have never had that problem with the FakerInput driver. I cannot run Windows 11 on my old PC (~11 years old) and I cannot test suspend as my PC will never resume afterwards. Not sure if UMDF drivers work differently on Windows 11 or if there might be some conflict with other possible mapper software and drivers installed on your PC; when I test reWASD, I usually remove at least the HidHide driver and never run DS4Windows while reWASD is installed.

Ryochan7 commented 1 year ago

Just had a idea and looked at the power function code. The key mentioned in this issue was using Suspend functionality. DS4Windows does not disconnect from FakerInput when it runs the routine after calling for the PC to suspend. A disconnect only occurs when closing DS4Windows completely. That could be a big problem; it is too bad I cannot test suspend support properly on my PC.

It should be a fairly easy fix to make. Just have to move the disconnect call to the service stop method rather than the app shutdown method.

Ryochan7 commented 1 year ago

Made the change. Running the app normally still works as intended. That is about all I can test on my end.

https://github.com/Ryochan7/DS4Windows/commit/ee4aae91c30ec5cf8a9bae189ada09f8b31516ff

ArsRaha commented 1 year ago

Just had a idea and looked at the power function code. The key mentioned in this issue was using Suspend functionality. DS4Windows does not disconnect from FakerInput when it runs the routine after calling for the PC to suspend. A disconnect only occurs when closing DS4Windows completely. That could be a big problem; it is too bad I cannot test suspend support properly on my PC.

It should be a fairly easy fix to make. Just have to move the disconnect call to the service stop method rather than the app shutdown method.

I uses DS4Windows and JoyToKey. I don't use another software like reWASD or even Steam Controller Settings. I did unchecked all Steam Controller Settings feature. So I'm sure there is no conflict, because I turn on JoyToKey after DS4Windows and my controller paired. With both DS4Windows and JoyToKey activated same time also no problem with any connection and function.

Honestly, I don't understand about your explanation, I'm sorry for not having tech/programming knowledge. I just can say, I have been using DS4Windows for long time. as I remember, I never had issue with FakerInput when using DS4Windows v2.x.x with my DualShock 4 v2 at Windows 10. Then I started decide to uninstalling FakerInput because at that time PSO2 no need it anymore.

The issue of FakerInput just happen when I use Windows 11, because before GameGuard rollback, I'm facing this problem too at that time (by I mean when GameGuard updates before now, it break SendInput then dev rolling back GameGuard to prev version).

So here from my experience, I'm curious if it caused by using Windows 11 (not sure tho).

And again, I'm sorry for my lack understanding. So what I need to do now to tracking or logging FakerInput restart issue?

Perseonn commented 1 year ago

@ArsRaha I double checked, it is still hidden on both Process and Details tab on Windows 10's Task Manager (along with the GameGuard Process). When sorted by GPU%, the overall shows 97%+ usage, but the Task Manager does not show anything that uses the GPU that high. Task Manager 2023_04_09 10_55_13

What if you run DS4Windows without JoyToKey? I remember JoyToKey doesnt play well with my work environment few years ago.

The only other program manipulating KB+M in my side is Microsoft Mouse and Keyboard Center (to turn off Caps Lock Button), but this program doesnt run on PSO2NGS (Caps Lock can still be used when PSO2NGS window is activated)

ArsRaha commented 1 year ago

@Perseonn I did run DS4Windows without JoyToKey and still same. FakerInput need to be reinstalled. Also tried disabling DS4Windows autostart then nihil.

Reason I need both of DS4Windows and JoyToKey because DS4Windows able to map touchpad, analog sensitivity, L2 and R2 adaptive trigger full click to limit deep press and many more. While JoyToKey can't do that, Virtual Joystick Mapping more customizable than DS4Windows Shift Modifier (I use 6 Virtual Joystick to map keyboard buttons F1-F10 and 1-0. used to using Force or Phantom at PSO2 Base which subpalette and weapon palette need to be switched as fast as possible)

Not sure if it caused by Windows 11. Need to ask someone if they have same with me

about hidden PSO2NGS task, here's mine Screenshot_98

Ryochan7 commented 1 year ago

Funny how after that initial change, suspend kind of worked on my PC. Found out that ViGEmBus would constantly fail to reconnect with the current version 3.2.9 but would reconnect fine with the latest change; some type of conflict must have been at play. However, since the last Patch Tuesday, Microsoft patched something and now I cannot get suspend to work on my PC again. Finally got the ability to test suspend for a few days and then Microsoft takes it away.

ArsRaha commented 1 year ago

After sending feedback and much people complaining about 3rdparty app controller settings didn't work. SEGA update (not sure it's update or revert back) GameGuard. now SendInput mode works again.

@Ryochan7 Again, I'm sorry for my not understanding about tech software. I hope you can find the way to test suspend more at Windows 11. Maybe FakerInput need update to fix messing thing in Windows 11. Still, FakerInput needed just in case if GameGuard update suck again.

Perseonn commented 1 year ago

Can confirm the GameGuard seems to be reverted as the PSO2 executables are now visible again in Task Manager.