| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| mafril How do I cheat?
 
 ![]() Reputation: 1 
 Joined: 19 Oct 2014
 Posts: 6
 
 
 | 
			
				|  Posted: Fri May 08, 2020 1:13 pm    Post subject: getPS4ControllerState |     |  
				| 
 |  
				| Hello, this is my first "contribution" to CE. So, bear with me. 
 I made this simple DLL file that adds a similar function to getXBox360ControllerState.
 
 
 Simple example:
 
  	  | Code: |  	  | cc = require("getPS4ControllerState") state =  cc.GAMEPAD_DPAD_DOWN()
 if state then print ("pressed")
 else print ("not pressed") end
 | 
 
 Here is a list of what you can do:
 
 
  	  | Quote: |  	  | GAMEPAD_DPAD_UP	                boolean	D-PAD Up GAMEPAD_DPAD_DOWN	        boolean	D-PAD Down
 GAMEPAD_DPAD_LEFT	        boolean	D-PAD Left
 GAMEPAD_DPAD_RIGHT	        boolean	D-PAD Right
 GAMEPAD_OPTIONS	                boolean	Options button
 GAMEPAD_SHARE	                boolean	Share button
 GAMEPAD_LEFT_THUMB	        boolean	Left thumbstick down
 GAMEPAD_RIGHT_THUMB	        boolean	Right thumbstick down
 GAMEPAD_LEFT_SHOULDER	boolean	Left shoulder button
 GAMEPAD_RIGHT_SHOULDER	boolean	Right shoulder button
 GAMEPAD_CROSS	                boolean	Cross button
 GAMEPAD_CIRCLE	                boolean	Circle button
 GAMEPAD_SQUARE	                boolean	Square button
 GAMEPAD_TRIANGLE	                boolean	Triangle button
 GAMEPAD_LEFT_TRIGGER	        boolean	Left trigger button
 GAMEPAD_RIGHT_TRIGGER	boolean	Right trigger button
 GAMEPAD_PS	                        boolean	PS button
 GAMEPAD_TOUCH_PAD	        boolean	Press on the touchpad
 LeftTrigger                           	integer      ranging from 0 to 255	Left trigger
 RightTrigger	                        integer      ranging from 0 to 255	Right trigger
 ThumbLeftX	                        integer      ranging from -32768 to 32767	Horizontal position of the left thumbstick
 ThumbLeftY	                        integer      ranging from -32768 to 32767	Vertical position of the left thumbstick
 ThumbRightX	                        integer      ranging from -32768 to 32767	Horizontal position of the right thumbstick
 ThumbRightY	                        integer      ranging from -32768 to 32767	Vertical position of the right thumbstick
 
 | 
 
 To install it just put the file in the CE folder.
 
 Download:
 https://mega.nz/file/qwAwyKRT#lmkd5YKNnDP0P7hQwaqGhW6x-YnrGWJEpshwWTpevsc
 
 If there is a better way to share it or do it, please let me know.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| mgr.inz.Player I post too much
 
  Reputation: 222 
 Joined: 07 Nov 2008
 Posts: 4438
 Location: W kraju nad Wisla. UTC+01:00
 
 | 
			
				|  Posted: Fri May 08, 2020 5:28 pm    Post subject: |   |  
				| 
 |  
				| Usually extensions here have source files. Dlls statically linked (imported dlls count as little as possible, e.g. /MT compiler flag or -static) For now I see it imports:
 lua53-64.dll
 WINMM.dll
 KERNEL32.dll
 ADVAPI32.dll
 MSVCP140.dll
 VCRUNTIME140.dll
 api-ms-win-crt-heap-l1-1-0.dll
 api-ms-win-crt-runtime-l1-1-0.dll
 api-ms-win-crt-math-l1-1-0.dll
 api-ms-win-crt-stdio-l1-1-0.dll
 
 
 
 
 32 bit version inside clibs32 and 64bit version inside clibs64 folder.
 
 I'll try it tomorrow with real PS4 joy pad. What's needed? ds4windows?
 
 Also, CE autocomplete doesn't look nice:
 
   _________________
 
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| mafril How do I cheat?
 
 ![]() Reputation: 1 
 Joined: 19 Oct 2014
 Posts: 6
 
 
 | 
			
				|  Posted: Fri May 08, 2020 6:17 pm    Post subject: |   |  
				| 
 |  
				| I will share the source after I better organize the code. 
 For CE autocomplete, I think it’s CE fault. I could rename them to camel case but I wanted to mimic getXBox360ControllerState.
 
 And to use it you don’t need ds4windwos.
 I made it because some games support ds4 natively (e.g. the surge).
 
 And for  the 32/64 bit , I think I will make it 32-bit strictly.
 
 Thank you for the suggestions.
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  |