00:00
00:00
Newgrounds Background Image Theme

BlakeNator72 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Controller Mapping for Flash Games!

6,071 Views | 185 Replies
Respond to this Topic

Oh damn, this is huge! I was experimenting with something similar by embedding flash games in Construct 3 within a iframe running Ruffle, and then using a batch file to stealth launch an open source mapping software. The intention was to potentially package up a collection of games into a Steam-ready package, so this update could potentially just save me doing all those workarounds!


Presumably, the controller mapping extends to the self hosted version of Ruffle as well?


Awesome work as always and thank you to the whole team developing Ruffle <3


Nearly all my stuff! MadeByChaz.com


At 5/12/25 01:45 PM, Belyaevs-Fox wrote:Has this feature being tested with DirectInput gamepads like the Dualsense, Switch Pro, and Stadia controllers? I know Xbox and similar gamepads are supposed to be the gold standard for PC gaming, but Xinput doesn't support certain feature likes touchpad and motion controls. I think the latter would be really handy for games that use pointer controls like first person shooters and point-and-click adventures.

I'm also curious to know if this feature will work on the mobile version of this site. I've seen dedicated controllers like the Razer Kishi and Backbone One meant for portable gaming along with phone mounts to be used with more standard gamepads.


I made that pointy-motion controlls work with steam (I posted a gif of that in action here), if you go the settings of your Steam menu, you got some controller options, there you have a submenu for a desktop layout, where you can map all your mouse-keyboard stuff, to your controllers + motion/gyro settings.

Tested it with Joy-Cons, PS-1 & PS-5 controllers, Gamecube Controller (GC adapter with a PC-mode switch) and cheap 3rd-party pro-controller.


No no motion stuff with PS1 and GC controllers, obviously, but using the sticks as cursor atill work fine, and can be adjusted pretty well.

Response to Controller Mapping for Flash Games! 2025-05-13 06:40:24


At 5/13/25 06:25 AM, Chaz wrote:Oh damn, this is huge! I was experimenting with something similar by embedding flash games in Construct 3 within a iframe running Ruffle, and then using a batch file to stealth launch an open source mapping software. The intention was to potentially package up a collection of games into a Steam-ready package, so this update could potentially just save me doing all those workarounds!

Presumably, the controller mapping extends to the self hosted version of Ruffle as well?

Awesome work as always and thank you to the whole team developing Ruffle <3


It sounds like you might be able to use something @BoMToons made, RufflePad!


https://github.com/pestoforce/RufflePad


Working on Nightmare Cops!

BBS Signature

Response to Controller Mapping for Flash Games! 2025-05-13 06:47:18


At 5/13/25 02:37 AM, Emrox wrote:Added a mapping for my game dwarf planet one. It feels a lot nicer than keyboard controls! I might update the game to integrate gamepad support a little better, since the keyboard controls have some goofy stuff like using the down arrow as an action button (and then that makes menuing funny). If there was some way to detect that someone's using a gamepad so I could switch to gamepad mode automatically that might be a cool feature.


I think Josh has been considering an API call to check for a gamepad, although you might also need to check if someone turns on their gamepad mid-game as well.


Working on Nightmare Cops!

BBS Signature

Response to Controller Mapping for Flash Games! 2025-05-13 06:58:58


At 5/13/25 06:40 AM, TomFulp wrote:
At 5/13/25 06:25 AM, Chaz wrote:Oh damn, this is huge! I was experimenting with something similar by embedding flash games in Construct 3 within a iframe running Ruffle, and then using a batch file to stealth launch an open source mapping software. The intention was to potentially package up a collection of games into a Steam-ready package, so this update could potentially just save me doing all those workarounds!

Presumably, the controller mapping extends to the self hosted version of Ruffle as well?

Awesome work as always and thank you to the whole team developing Ruffle <3

It sounds like you might be able to use something @BoMToons made, RufflePad!

https://github.com/pestoforce/RufflePad


I didn't know about this, thanks! Looks like it's AS2 specific though...


Nearly all my stuff! MadeByChaz.com

Response to Controller Mapping for Flash Games! 2025-05-13 06:59:00


At 5/12/25 10:15 PM, Dungeonation wrote:Oh WHOA this shows up now on games in general, Flash or not!


It's been tempting to let non-Flash devs also fill out their controls, just to have a consistent point of reference on each game. If we got really crazy, html5 games could use our API for controller mapping, allowing end users to customize their mapping via NG instead of building an in-game system. Dunno if anyone would actually implement that if it was offered, though.


Working on Nightmare Cops!

BBS Signature

Response to Controller Mapping for Flash Games! 2025-05-13 08:50:09


This sounds freaking cool holy shit !


Kind of a bummer that Super Mario 63 isn't around anymore. Would have been interesting to play that game with a controller

Response to Controller Mapping for Flash Games! 2025-05-13 09:44:14


Epic! I can't wait to play Alien Hominid and NG Rumble with a controller!


"Everything by Everyone"

BBS Signature

Response to Controller Mapping for Flash Games! 2025-05-13 10:52:05


At 5/12/25 08:05 PM, Belyaevs-Fox wrote:Here's so more mappings I did myself.


A bunch of these aren't ready for Ruffle but I did the ones that are!


Working on Nightmare Cops!

BBS Signature

Response to Controller Mapping for Flash Games! 2025-05-13 10:54:05


At 5/12/25 09:49 PM, Dungeonation wrote:Now that I've been able to sit down and actually toy around with a controller on some Flashes... (This update ROCKSSSS)


These are done!


Working on Nightmare Cops!

BBS Signature

Response to Controller Mapping for Flash Games! 2025-05-13 10:57:07


At 5/13/25 04:28 AM, orbitz wrote:fun!

https://www.newgrounds.com/portal/view/526596


Four player G-Switch is a go!


Working on Nightmare Cops!

BBS Signature

Response to Controller Mapping for Flash Games! 2025-05-13 10:59:02


At 5/13/25 06:10 AM, Guidodinho wrote:I also need this in my life on a controller:
https://www.newgrounds.com/portal/view/151706

Its my Favorite Classic Sonic Platformer of all time.


Done!


Working on Nightmare Cops!

BBS Signature

At 5/13/25 06:59 AM, TomFulp wrote:
At 5/12/25 10:15 PM, Dungeonation wrote:Oh WHOA this shows up now on games in general, Flash or not!

It's been tempting to let non-Flash devs also fill out their controls, just to have a consistent point of reference on each game. If we got really crazy, html5 games could use our API for controller mapping, allowing end users to customize their mapping via NG instead of building an in-game system. Dunno if anyone would actually implement that if it was offered, though.


That kinda reminds me of a few years ago when I wrote this gamepad mapper

I was working on a different problem - I noticed that different gamepads don't always map their buttons and axes the same way (specifically the gamepad button mapping with my Switch controller didn't jive with Xbox controller button mapping), so this was meant to be a way for gamedevs to let anyone using any gamepad map their own buttons however they want.


It sounds like what you have in mind is making a layer between a hosted game and the player's browser that would take the player's gamepad input and translate it to keyboard / mouse click input going to the game. This is different, but it was written in pure JavaScript in plaintext so would be a lightweight implementation and might help as a starting point to reverse-engineer / cannibalize.


My newsfeed has random GameDev tips & tricks

Response to Controller Mapping for Flash Games! 2025-05-13 11:14:57


!WOW TOM ITS SO COOL! I DID IN MY PS4 CONTROLLER


It was awesome😍 does that work in other flash game?


iu_1397626_15474508.png


Sussy-baka22

BBS Signature

Response to Controller Mapping for Flash Games! 2025-05-13 13:12:14


At 5/12/25 11:57 AM, TomFulp wrote:@PsychoGoldfish just rolled out an exciting new feature for Flash fanatics:

Controller Mapping!

Traditional Flash games never had gamepad support but now that games are running via Ruffle, we are able to interface with them directly using our own controller mapping.

We store mapping data for each game individually so there’s a long road ahead, however you can try these games with a gamepad to demo the feature:

https://www.newgrounds.com/portal/view/59593
https://www.newgrounds.com/portal/view/581168
https://www.newgrounds.com/portal/view/301341
https://www.newgrounds.com/portal/view/529992
https://www.newgrounds.com/portal/view/511754
https://www.newgrounds.com/portal/view/586756
https://www.newgrounds.com/portal/view/399956
https://www.newgrounds.com/portal/view/555072
https://www.newgrounds.com/portal/view/347399
https://www.newgrounds.com/portal/view/254456
https://www.newgrounds.com/portal/view/587787
https://www.newgrounds.com/portal/view/484931
https://www.newgrounds.com/portal/view/493665
https://www.newgrounds.com/portal/view/580355
https://www.newgrounds.com/portal/view/512407
https://www.newgrounds.com/portal/view/552005
https://www.newgrounds.com/portal/view/429765
https://www.newgrounds.com/portal/view/535370
https://www.newgrounds.com/portal/view/381115

Supporters have the ability to set up their own controller mapping on a per-game basis, in cases where we haven’t set a default or you want to change from the default. We made this a Supporter feature because it’s a niche feature and NG needs more Supporters, however if you have accessibility needs that require this feature, please message me about it.

If a Flash game already has controller mapping, you will see a note in the info box under the tags, with a link to view the existing mapping (or create your own if you’re a Supporter).

Flash devs can add mapping to their existing games, which would be a huge help! You’ll find the mapping option on your Project Details page, under your SWF file in the same area as the Ruffle Emulation toggle. If you want to really get wild, you could also make your title screens and menus controller friendly, since a lot of those will still depend on a mouse. If you do update your game with mapping, share a link in this thread!


To kick things off, anyone can help right in this thread! Reply with a link to a Flash game you like that doesn’t have controller mapping and include a list of how you would map the controls. We’ll use an Xbox controller as the template for button names.


For example, here’s how I would explain the Alien Hominid mapping:

Left Stick - Arrow Keys - Move
D-Pad - Arrow Keys - Move
X Button - A Key - Shoot
A Button - S Key - Jump

We’ll start mapping games based on your replies and once we create a new moderator type, we’ll invite some of you to come aboard as mapping mods! In the meantime, staff and existing Portal Mods have access to add mapping.

Note: If a game doesn’t have a “Ruffle” loader at the start, it is likely an HTML5 game and this feature does not apply.

If your favorite Flash game isn’t currently running via Ruffle, you can help test and report on it in the Ruffle Testing / Flash Preservation Crew.

Future splash: We're not done adding new ways to play Flash games!


OOOOOOH YEAHHHH

Response to Controller Mapping for Flash Games! 2025-05-13 13:13:38


The dangerous dungeons games before the tiny dangerous remake!

unfortunately, the first two games don't work on Ruffle

Response to Controller Mapping for Flash Games! 2025-05-13 13:34:03


!WOW TOM ITS SO COOL! I DID IN MY PS4 CONTROLLER

It was awesome😍 does that work in other flash game?


iu_1397626_15474508.png


Hey other People Try This Niggo! It's So Cool!


Sussy-baka22

BBS Signature

Response to Controller Mapping for Flash Games! 2025-05-13 14:08:03


When you told us about this coming @ PAX I was super pumped, I'm super excited to try out some classics with a controller!


BBS Signature

Response to Controller Mapping for Flash Games! 2025-05-13 14:10:44


Gotta say outside of the few required touch input moments, this works pretty well. Hooked up my ps5 controller with Bluetooth on my S22 and it picked it up just like that.

Response to Controller Mapping for Flash Games! 2025-05-13 14:39:04


Here's another Flash classic deserving of some attention.


Arrow Keys = D-Pad, Space = Cross, Esc = Options

Response to Controller Mapping for Flash Games! 2025-05-13 14:59:11


At 5/13/25 02:39 PM, Belyaevs-Fox wrote:Here's another Flash classic deserving of some attention.

https://www.newgrounds.com/portal/view/523677
Arrow Keys = D-Pad, Space = Cross, Esc = Options


Added!


Working on Nightmare Cops!

BBS Signature

This is an awesome feature, well done!


I'll share some thoughts as I try it with a few games.


– The automatic WASD/Arrow key option is a very good idea to include. (Although it didn't work for me until I set each key manually – possible bug? The directional keys showed as N/A in “View Mapping” until I changed all four separately.)


– It's a pity it doesn't work with mouse input. A good portion of games also require you to click to start the game so you can't use a gamepad right away (that's not a big problem), although there are games that require mouse interaction between levels (which is a bit trickier as you keep switching) or in dialogue (e.g. Coma has keyboard movement and mouse dialogue).

But that's more on each game to solve than on this feature. Getting old games to support gamepads at all is already a monumental achievement.


– I thought this is going to be fun with different keyboard layouts, and sure enough, the mapping displays (most likely) English QWERTY keys no matter the reality of the key you're pressing in your locale. So some users might be a bit confused when it shows a completely different key than what they pressed (especially if they revisit the mapping later, or inspect the default binding set by somebody else).


French AZERTY must be fun with their ZQSD instead of WASD when they see different characters in the default binding.

(For this reason, some game engines or libraries have been trying to do mapping using the more reliable physical key position instead of the specific letter in your locale.)


But it's probably not that big of a deal. People with foreign keyboard layouts (myself included) usually learn to keep the English keyboard layout to switch to when key rebinding isn't possible and the default layout seems weird.


– Trying to bind the 'Esc' key to go to the pause menu works, but it also closes the remapping window.


– It'd be nice if you could copy and paste the mapping as some form of code if you want to share it with other people (also for you here).


At 5/13/25 06:59 AM, TomFulp wrote:I think Josh has been considering an API call to check for a gamepad, although you might also need to check if someone turns on their gamepad mid-game as well.


That's definitely something you're going to want to support gamepads “properly”, especially if you display input prompts on screen so you can update them.


Often, there's something like "On Input Device Changed → Device Type" so you can tell somebody went back to mouse & keyboard (controller disconnected, or simply put controller down and started using keyboard again) or grabbed a different gamepad brand, so you need to change the input icons and gamepad pictures.

(But that's more about general gamepad support than about reacting to NG controller mapping events.)


What if the mapping changes mid-game, would you get a callback for that to potentially update your UI? Just food for thought.


At 5/13/25 06:59 AM, TomFulp wrote:If we got really crazy, html5 games could use our API for controller mapping, allowing end users to customize their mapping via NG instead of building an in-game system. Dunno if anyone would actually implement that if it was offered, though.


Handling rebinding keys is a pain, so it could save a lot of hassle if people recognize how it could help them, even though it's not as exciting as medals and scoreboards. Cloud saves for example are also an absolutely amazing feature, but I didn't see it used that much yet.

I can see it being used if it's flexible and sufficiently easy to set up (for example, bundled in the Newgrounds.io libraries). Mapping only as some layer in between, I wouldn't want to handle all input via Newgrounds.


---


(Going even crazier, it'd be nice to rebind keyboard out of the box as well. Speaking from years of experience with QWERTZ keyboard layout when all games out there assume QWERTY and use Z X C as action keys; it would be a great quality of life improvement – as I don't usually expect most smaller games around here to bother with supporting keyboard keys rebinding.)

Response to Controller Mapping for Flash Games! 2025-05-13 15:59:00


At 5/13/25 03:46 PM, Ralix wrote:This is an awesome feature, well done!

I'll share some thoughts as I try it with a few games.

– The automatic WASD/Arrow key option is a very good idea to include. (Although it didn't work for me until I set each key manually – possible bug? The directional keys showed as N/A in “View Mapping” until I changed all four separately.)


This is the first report I've seen of that not working... Was the game already running when you got started with the keys? If a game is running when you add your initial keys, you'll need to refresh the page. If you had set up gamepad support previously but then edit keys while the game is running, it updates real-time. It's the games that launch without any key data at all that need the refresh for changes to kick in.


– I thought this is going to be fun with different keyboard layouts, and sure enough, the mapping displays (most likely) English QWERTY keys no matter the reality of the key you're pressing in your locale. So some users might be a bit confused when it shows a completely different key than what they pressed (especially if they revisit the mapping later, or inspect the default binding set by somebody else).


It gets kinda overwhelming to think about, we'll likely be sticking with this unless millions of people come back to NG for Flash games.


– Trying to bind the 'Esc' key to go to the pause menu works, but it also closes the remapping window.


This one is noted!


– It'd be nice if you could copy and paste the mapping as some form of code if you want to share it with other people (also for you here).


I love this idea, we also plan to let mods browse and promote user-made maps.


(Going even crazier, it'd be nice to rebind keyboard out of the box as well. Speaking from years of experience with QWERTZ keyboard layout when all games out there assume QWERTY and use Z X C as action keys; it would be a great quality of life improvement – as I don't usually expect most smaller games around here to bother with supporting keyboard keys rebinding.)


I assumed a lot of ASD and ZXC going into this but it does feel like there's a ton of variation from game to game, where a standard default might just confuse people if it doesn't work.


Working on Nightmare Cops!

BBS Signature

Response to Controller Mapping for Flash Games! 2025-05-13 17:02:05


Just mapped Ivan Drago: Justice Enforcer for myself (I don't have access to do it for everyone):


Arrows - move

Attack - Controller A = keyboard A

Block - Controller B, X, Y = keyboard S

Crouch - Controller LB, LT, RB, RT = Keyboard D


Response to Controller Mapping for Flash Games! 2025-05-13 17:06:41


At 5/13/25 05:02 PM, BoMToons wrote:Just mapped Ivan Drago: Justice Enforcer for myself (I don't have access to do it for everyone):


Mapped!


Working on Nightmare Cops!

BBS Signature

At 5/13/25 03:59 PM, TomFulp wrote:This is the first report I've seen of that not working... Was the game already running when you got started with the keys? If a game is running when you add your initial keys, you'll need to refresh the page. If you had set up gamepad support previously but then edit keys while the game is running, it updates real-time. It's the games that launch without any key data at all that need the refresh for changes to kick in.


The game was running. However, I can invalidate the layout by editing it now even after refreshing the page and setting the initial buttons.

See the video.

I.e. if the gamepad mapping is correct and working (all keys set one-by-one), and I use the "apply WASD" option, it shows as N/A in View Mapping (the Customize screen still shows the correct keys). If I change it afterwards manually, it doesn't update in real-time while the game is running, I have to refresh the page.

Arrow keys are fine, which leads me to believe keyboard layout might affect it (although WASD is still WASD in mine).


Chrome / Czech QWERTZ keyboard (let me know if you need to test something specific or give more information).


Game controller mappings



Left Stick – WASD – [Movement]

Button South – J – [Action]

Button West – Space – [Possession]



Left Stick (without up!) – Arrow keys – horizontal [Movement], i.e. not jumping; it's way too easy to jump by accident

Button South – Z – [Jump]

Button West – X – [Shoot]



Left Stick (left/right only) – Arrow keys – horizontal [Movement]

Button South – Space – [Jump]

(rare mouse interaction in the game but nothing major)



Left Stick (left/right only) – Arrow keys – horizontal [Movement]

Button South – Up – [Jump]

D-pad Down – Down – [Activate]

Start – Esc – [Pause]

Select – Mute – [Mute]

Response to Controller Mapping for Flash Games! 2025-05-13 17:43:31


At 5/13/25 05:02 PM, BoMToons wrote:Just mapped Ivan Drago: Justice Enforcer for myself (I don't have access to do it for everyone):

Arrows - move
Attack - Controller A = keyboard A
Block - Controller B, X, Y = keyboard S
Crouch - Controller LB, LT, RB, RT = Keyboard D

https://www.newgrounds.com/portal/view/355796

Honestly, many of Mockery and pesto's games deserve mapping! So do yours and Luis' games. Again, this is worth celebrating and the possibilities are endless!!

Response to Controller Mapping for Flash Games! 2025-05-13 18:47:32


Just mapped Buccaneer Battle!

Response to Controller Mapping for Flash Games! 2025-05-13 19:29:18


Hey this is dope!! Universal gamepad mapping for web games is something I’ve thought about in the context of html5 games. Tricky thing is that different browsers and game engines are inconsistent with how / if they handle gamepad input.


Ohh this potentially opens the door to playing flash games on mobile with my backbone gamepad! I’ll see if it works


Banner by @MigMoog

BBS Signature

Response to Controller Mapping for Flash Games! 2025-05-13 23:05:00


iu_1397886_10040742.webp

I love navigating mouse-only menus with gamepads. Welcome to the future!