Home Creators Posts Import Register Favorites Logout

Downloads

Content

This plugin adds a simple window that will briefly appear and then automatically disappear when the player first connects their gamepad. This allows them to know their gamepad is successfully being picked up by the game, in case they may be having trouble with their gamepad.

! SEE BOTTOM OF POST FOR UPDATES !

Hi all, introducing [CGMZ] Gamepad Detected!

This plugin shows a simple window when the player connects their gamepad (controller). This can be useful information so they know their gamepad connected successfully and is being recognized by your game. See below gif for how it can look:

Customization

This plugin is mostly plug and play with no setup required from you to start with. However, it does offer some customization parameters. You can choose to show the window in any corner of the screen, with an x/y offset as well to further fine-tune the window position.

You can also control the window width/height, the text and text alignment, and the fade in/out speed as well as the display time.

A sound effect can also play when the window displays.

Integrations

This plugin comes with additional features when used alongside the following plugins:

[CGMZ] Window Backgrounds - Show an image as the window's background, including an animated scrolling parallax image. This plugin works for any window in your game, and this integration makes it no-code for this plugin's window.

[CGMZ] Window Settings - Control the window's tone, windowskin, padding, style, and more. This plugin works for any window in your game, and this integration makes it no-code for this plugin's window.

[CGMZ] Rumble - Rumble the controller when the player first connects it to provide additional haptic feedback that their gamepad is recognized.

Roadmap

Future updates for this plugin include any customizations people would like added. I will also look into allowing a window for if the gamepad disconnects.

Casper Gaming plugins are made much better through user suggestions. If you have an idea for a feature you'd like to see implemented that is not already covered above, please let me know. You can leave suggestions in the comments below or in the #suggestions channel of the Casper Gaming Discord.

Quick Facts

✅ RPG Maker MZ✅ No obfuscation✅ All future updates included✅ No AI used at any point in the creation of this plugin

Support

Casper Gaming provides quick support to any user who needs it. You can leave a comment below with your question or issue, I try to check my Patreon at least once a day. For even quicker support, you can come into the Casper Gaming Discord and ask for help in the #support channel.

Credit & Requirements

Please see terms of use here: Terms of Use

Requires CGMZ Core plugin: CGMZ Core

Happy RPG Making!

This version adds the option to also show when the gamepad disconnects. This can occur if the player unplugs it, or if there is a problem that causes the gamepad to disconnect. This could provide feedback to the player for why their gamepad controls stop working. See below gif for how it can look:

You can set different text and play a different sound effect when the disconnect event occurs. You can also now opt to not show either the connect or disconnect event, in case you want only one event to be shown to the player.

This version also fixes a slight bug that could cause other plugins that listen to gamepad connect events to not work.

This version adds an integration with [CGMZ] Rumble to let you rumble the controller when the gamepad connects. This can help provide haptic feedback to the player that their gamepad was recognized.

Files

Comments

John Henson

I don’t know if it’s possible, but extending this to include detecting the type of controller could be very handy. It could also allow for integration with the Controls Window so that the window shows the correct or user selectable buttons. An example would be if I connect a Playstation controller the controls window shows Playstation buttons but if I were to connect an Xbox controller it would show the Xbox buttons.

Casper Gaming

Hi, I have thought about this and even bought a few controllers to test with before, but in my tests Windows seemed to emulate all of my controllers as xbox 360 controllers so I couldn't find a way to tell them apart. I did not test with every controller though, if you have a non-xbox controller and would like to help test, you can start a playtest, make sure your controller inputs are being recognized, and then type in the following to the console: navigator.getGamepads()[0]; and expand the result to see the id property and let me know what it is.

John Henson

I'll see what shows up for my Playstation controllers; I have a PS5 controller that I use for game controller testing. However, I also have PS4 and PS3 controllers that I can test with too. I'm also using MacOS (on Intel and M Series processors) as well as Windows 10 and 11 develop my game so there may be some differences in how the OS reports the information. There’s a tool that I use on Windows; DS4 Windows (https://ds4-windows.com) that helps provide better support for PS4 & PS5 controllers so that may also detect the controller correctly. I think Windows just automatically detects every game controller as an Xbox controller so DS4-Windows may report the correct controller info if it’s a Playstation controller. I’ll do some testing and reply with what I find.

Casper Gaming

Ok, that would be great! I use an xbox controller for my main pc gaming so I am a bit unfamiliar with other controllers and any helper programs they have for windows.

John Henson

I was able to do some testing across MacOS 26 and Windows 11. On both operating systems id the PS5 controllers as "DualSense Wireless Controller (STANDARD GAMEPAD Vendor: 054c Product: 0ce6)” when inputting navigator.getGamepads()[0]; in the console on RPG Maker MZ. Just out of curiosity, I plugged in my Thrustmaster T.Flight Hotas 4, which is compatible with PlayStation. It was detected as “T.Flight Hotas (Vendor: 044f Product: b67b).” After doing a little digging online I found that devicehunt.com seems to have a list of vendors using the same coding. Doing a search on the site under USB devices shows the PlayStation 5 controller using the vendor and product id’s listed above. I’m not sure the list is complete because it doesn’t list the T.Flight Hotas 4 but the vendor id (Thrustmaster) is correct. I suspect that the vendor id and the device id are unique and assigned as part of a standard. I’m thinking it would be possible to at least use the id information to set the button images for at least some controllers (maybe official Microsoft and Sony ones) with a fallback to default button images if the controller id is unknown. I’m sure there’s thousands of USB controllers so it would be impossible to detect and show the correct buttons for all of them. Something else could be allowing the person using the plugin to set custom buttons based off of what controller id information they get, if they're using a generic controller.

Echocondria Inc.

Is there any way to extend this to add a switch select option to the settings of the plugin that turns it on or off when the controller is detected. Then I'll be able to add Gamepad or keyboard specific dialog and stuff like that

Casper Gaming

I can add a switch that turns on when a gamepad is connected, thanks for the suggestion

Casper Gaming

I will have to test on my mac to see if there is any difference, for some reason all my controllers get reported as "Xbox 360 Controller (XInput STANDARD GAMEPAD)" for the gamepad id without any product or vendor ids, even though the spec says it should include those https://developer.mozilla.org/en-US/docs/Web/API/Gamepad/id When I test on itch.io one of my plugins that can run in browser, on chrome it reports it again as "Xbox 360 Controller (XInput STANDARD GAMEPAD)" but on firefox it reports it simply as "xinput" 😅 I will need to do some more tests, I might be able to check for various strings like xbox/xinput and dualsense/dualshock/playstation and then fall back to xbox controls if it is a third party controller. That way if it may work for some people who have their controller being recognized more properly...I did test somewhat back when I first added keyboard / gamepad input type tracking, as I wanted to track which gamepad was being used to show the correct buttons, but ran into this issue and thought everyone would see the same thing so stopped work on it. Are you able to go to somewhere like https://casper-gaming.itch.io/cgmz-game-info on firefox / safari and in the console type the same navigator.getGamepads()[0]; in after your controller is recognized by the in-browser game?

John Henson

Sorry for the delay in replying. I checked (via Firefox) https://casper-gaming.itch.io/cgmz-game-info with my PS5 Controller and it was reported as: Gamepad {id: "054c-0ce6-DualSense Wireless Controller", index: 0, connected: true, ...} I was also able to pick up an Xbox Controller just a few days ago so I tested that as well. It showed: Gamepad {id: "045e-0b13-Xbox Wireless Controller", index: 0, mapping: standard, ...} Both controllers do work on the website. Testing with RPG Maker MZ using the playtest option shows the controllers as well but lists them differently: PlayStation 5 Controller: Gamepad {id: "DualSense Wireless Controller (STANDARD GAMEPAD Vendor: 054c Product: 0ce6)", index: 0 ...} Xbox Controller: Gamepad {id: "Xbox Wireless Controller (Vendor: 045e Product: 0b13)", index: 0 ...} It looks like the USB vendor data is there, but shown somewhat differently depending on the platform (possibly due to the Java Script implementation or version.) I've got screen shots of all this, I just don't see how to upload them to my post here.

Casper Gaming

Hi, no worries. I did ask people in my discord to test out their controllers as well. Some people did have the same issue I have where it just reports every controller as an xbox 360 controller, while others had their controllers reported correctly and on web it also differed. I did add into my latest Core update a function to check for things like playstation, dualshock, dualsense, xbox, xinput, nintendo, etc. to try and get the controller brand. Chances are some people will see xbox even when they are not using an xbox controller but others will see the correct controller and the difference seems to be on the user's side, so I think it is better than nothing. If you are on version 1.34.0 of [CGMZ] Core you should be able to type $cgmzTemp.getLastGamepadBrand() into the console and it should spit out the right brand for you. It also has parameters to force it to identify the controller as a specific brand so you can test what other controllers will see even if you do not have a controller of that brand yourself.