for a DS4 use the program DS4windows. It allows you to map your bottons to key inputs. Just map the controller buttons as you want, and make the buttons correspond with the default keyboard scheme of the game.
also make sure there are no other programs running that automatically use the controller, like steam. If you play around enough youll see that the controller acts like a 360 aftermarket controller in your window settings. So for it to read properlly in ds4 windows you have to have ds4windows be the only program addressing the controller.