PluginName: SDJB_ UnifiedFusionBridge + Controller
Author: ShadowDragon
I leave the plugin in here, its in WIP as I cannot test the GamePad yet.
works for HTML DOM and EDITOR for Conditional Branch.
PS:
Gamepad is untested, but so far I read, it's constant updated, never checked for "release".
This one change that, give you more control how keyboard/gamepad works.
(it uses its default keymapper (include all trigger for gamepad (untested), but if you map "menu",
it trigger both on keyboard and gamepad[0] if plugged in.
if any issues, please report back and I try to fix them (hopefully I can test gamepad soon.
Open plugin to alter the default keys (use event.key or event.code only (keyCode = deprecated)).
=== TERMS OF USE ===
Free for Non-Commercial and Commercial use when credit is given.
credit one of the following:
ShadowDragon
ShadowDragonJB
Version + UPDATE'S
09-04-2025 Version 0.1.0 first release
21-04-2025 Vesion 1.0.0 BIG UPDATE
=== WARNING ===
YOU ARE NOT ALLOWED TO REDISTRIBUTE OR SELL IT OR TAKE CODE FOR YOUR OWN.
DO NOT REMOVE THE HEADER.
Author: ShadowDragon
Code:
Methods: (controller only)
→ mapKey.trigger(action)
Trigger the action when holding down for 1 frame or more.
→ mapKey.press(action)
Trigger and repeats when holding down the press button
→ mapKey.longPress(action, duration = 24)
Holding down longPress Trigger the action after 24 frames (default),
you may alter it using mapKey.longPress(action, 40) so it will be 40 frames.
→ mapKey.release(action)
Trigger on releasing with minimum of 1 frame or more.
→ mapKey.repeat(action, repeats = 3, interval = 12)
Trigger only if you repeat within the interval 3x, if over, it wont trigger,
alter it with mapKey.repeat(action, 7, 6)
→ mapKey.any([actions])
Trigger is any of the buttons is used: mapkey.any(["left", "right", "D"])
→ mapKey.rebind(action, ...keys)
rebind keys to set buttons: mapKey.rebind("left", "A", "Digit4", "Numpad4")
and "A", Digit4 and Numpad4 will works as "left" on trigger.
What is UnifiedFusionBridge and UnifiedFusionController
It's a unique bridge between GamePad and Keyboard combined!
the base can work in each game using it, and has default
GamePad and Keyboard settings, but can be overridden!
Example:
let uniqueVar = new UnifiedFusionBridge(); // uses default mapping.
let uniqueVar = new UnifiedFusionBridge({
keyMap: { "KeyX": "shoot" },
gamepadMap: { 2: "shoot" }
}); // extend or rewrite the default mapping
let uniqueVar = new UnifiedFusionBridge({
keyMap: { "KeyX": "shoot", "KeyC": "cancel" },
gamepadMap: { 2: "shoot", 3: "pause" }
}, true); // overwrite the entire mapping
Same is true for UnifiedFusionController.
By default, the controller is set to "mapKey", my htmlBase uses
htmlInput by default.
So what is the difference between Bridge and Controller?
UnifiedFusionBridge is used to manipulated the DOM
UnifiedFusionController is used for the maker to use all keys
only you defined in it, easy to remap with mapKey.rebind(action, ...keys).
I leave the plugin in here, its in WIP as I cannot test the GamePad yet.
works for HTML DOM and EDITOR for Conditional Branch.
PS:
Gamepad is untested, but so far I read, it's constant updated, never checked for "release".
This one change that, give you more control how keyboard/gamepad works.
(it uses its default keymapper (include all trigger for gamepad (untested), but if you map "menu",
it trigger both on keyboard and gamepad[0] if plugged in.
if any issues, please report back and I try to fix them (hopefully I can test gamepad soon.
Open plugin to alter the default keys (use event.key or event.code only (keyCode = deprecated)).
=== TERMS OF USE ===
Free for Non-Commercial and Commercial use when credit is given.
credit one of the following:
ShadowDragon
ShadowDragonJB
Version + UPDATE'S
09-04-2025 Version 0.1.0 first release
21-04-2025 Vesion 1.0.0 BIG UPDATE
=== WARNING ===
YOU ARE NOT ALLOWED TO REDISTRIBUTE OR SELL IT OR TAKE CODE FOR YOUR OWN.
DO NOT REMOVE THE HEADER.