[Full Project] 's UMG Rebindable Key System, Rebind keys at Runtime!

You’re welcome enzoravo!

:slight_smile:

(You asked to be reminded) so I’m wondering if you’ve given any consideration to updating Victory Key Binding to support InputAxis mappings or multiple inputs per action…?

Upgraded to 4.8!

Dear Community,

I’ve upgraded my Rebindable Keys sample project to 4.8!

The project uses the 4.8 version of my Victory BP Library plugin to handle the changing of input bindings during runtime based on key presses you enter.


**Download**

Here's the full project for you!

**Wiki Link to Download Page**
https://wiki.unrealengine.com/File:ReBindableKeys.zip

Enjoy!

:slight_smile:

PS:

Yup its on my list of things to do soon as I can! :slight_smile:

Update ~ Multiple Keys and Axis Mappings

Dear Community,

Major update!

I’ve added support for rebinding axis keys and scales during runtime!

My new implementation also easily supports rebinding mappings during runtime which have multiple keys associated with them!


**Download**

Here's the full project for you!

**Wiki Link to Download Page**
https://wiki.unrealengine.com/File:ReBindableKeys.zip

Enjoy!

I think I may have found a bug with the way your new axis keybind system works, . Essentially, it seems that the “original” keybind reference is based on an Axis Name and an associated key… But while it accepts the “value” parameter, it doesn’t distinguish it?

If, for example, I go into my menu and “accidentally” bind W to both Moveforward 1 and Moveforward -1, and I then try to bind an axis value to MoveForward 1, it will overwrite both the Moveforward 1 and Moveforward -1 bindings with the new binding, since it cannot tell them apart…? The only way to recover from this once it happens is to go into Project Settings to manually change it, as it will then show two duplicate copies of a moveforward 1 binding with no way to differentiate them.

EDIT: put another way, I think the shortcoming here that can’t be solved is that there’s no way, using your system, to add or remove keybinds, only to replace them. It would be possible to avoid this issue, at least on my end (since it happens when loading preset lists of keybinds) by simply doing a Get All Victory Keybinds > ForEach > RemoveKeybind and then calling an Array of Victory Keybinds > ForEach > AddKeybind. As it stands, the problem is if there’s any sort of mismatch between the existing keybinds and the ones that are supposed to be added, because the user accidentally pared the list down from two keybinds to one (for example, by double-binding a movement command twice to the same key) he permanently loses one keybind since the system can only modify keybinds, it can’t add or subtract them from the list.

That’s correct, the use of my nodes and my project is for a rebinding key menu for a final game, by the end user.

There’d be no point in adding new bindings in a final game that are not used anywhere in code or blueprints :slight_smile:

:slight_smile:

Updated to 4.8 ~ Action and Axis Key Rebinding Project For You!

Dear community,

This video demonstrates how my Runtime Rebindable Key System does actually have a scrolling feature!

You can have infinite key bindings in your list!

I also demonstrate how easy and fast it is to add new keybindings usig Project Settings -> Input!

And!

Remember that I am giving you this whole project for your own use!

:slight_smile:

Hey, I was wondering if you were going to make the mouse buttons an option for keys (make jump LMB). I noticed you had the MouseButtonDown Override, but there is nothing in it, so does that mean you’re working on it right now? Or are you able to use mouse buttons and I’m just encountering a problem. (I have actually made the mouse buttons usable including Mouse X/Y, but for LMB you have to click the button, then click somewhere else, it won’t let me click the button again to set it)

I’ve not attempted mouse buttons yet, you can implement the mouse events in the widget class if you want, or wrap the input element with a border widget which captures mouse click events easily, including double clicks!

:slight_smile:

Well, here’s how I have been doing it so far, if you want to use it or improve it!

Mouse Clicks: (this is using the OnMouseButtonDown Override)

Mouse X/Y: (this is using the OnMouseMove Override)

Is this compatible with UE 4.9.1? im getting build fail when trying to put this into my project! :frowning:

I like the idea behind this, but I don’t like how you are kinda stuck with MoveRight twice, once for 1 movement one for -1 movement. That’s just not how most games work for binding keys. I REALLY wish this was something that Epic would pay attention to as a need and work on.

Thanks for sharing GMC !

I haven’t done a 4.9.1 upgrade, you can just get the latest version of my Victory Plugin as it has all the nodes used in this project

Victory Plugin

:slight_smile:

, I have been banging my head against a wall for a while with this, but think I have it all worked out. At least for key presses and mouse (as gmc figured out). I have been working on a long tutorial, when I get a to add the section on this stuff I’ll let you know, maybe you’ll see something I can do better.

gmc, I used your idea for the Mouse Clicks. Seems to work well, but noticed I can not get the ‘Left Mouse Button’ to come up… only right and the side buttons I have. Does yours do the same?

Also, SpaceBar will not assign…

Arbopa, I can get LMB and Space on 4.9.2. (And by ‘get’ you mean set them to a binding, correct?) Mind posting pics of the bp? (Have not tested in 4.10)

Yes, I mean binding. Am using 4.9.2, but changed a lot as I wanted my set up way different than 's example that just pulls what is there. So my ‘window’ looks like this:

My onkeydown for action input (similar to for axis input):

I added the print so it prints the key as text with ]'s around it, works for all keyboard stuff, but not the space, nothing prints at all… the button you are on simply toggles color like it has been selected when you hit space.

For my OnMouseButtonDown for action input:

The printstring there shows ‘right mouse button’ and ‘middle mouse button’ and mouse button 2 and 3 … but no left mouse button. Like the space, it just acts like the button was hit again rather than getting the input.

Ok, I set up my bp and was able to set Space and LMB. Two quick things, for LMB, when trying to set it you have to click off of the button; for space, make sure your Main by has Set Keyboard Focus! (I set this in my Element by when the button is clicked) If you are doing that, the only thing different from mine to yours is that you have the Key TXT and Old VIC Key and Victory Action Key variables, while I am getting these straight from the Widget (Element by), I don’t know if that really matters, but try getting/setting them straight from the widget and see if it then works. If that still does not work, then I have no other idea other than something is eating your Space and LMB (like when you click on the button trying to set the binding to LMB)

I am not using element by or his BP’s … so my key txt and victoryactionkey are direct from the blueprint. I have a MM_Controls which contains the scroll box, and create axis and action widgets in it based on what inputs are set up.

I had the SetKeyboardFocus to MM_Controls, when I changed it to a reference to self the space bar now comes out right. But still missing the left mouse button, and I see no ‘set mouse focus’ to set to that widget as well. Hmm…

I will keep trying some things… Thanks.

Got it. When a button is clicked, I set ‘Is Enabled’ to false, then at the end of onmouse and onkey, reenable it. Now it captures the left mouse button fine. Now if up and down mouse wheel didn’t return ‘none’ … lol. thanks again.

I’m glad you got everything working! As for the mouse wheel, I actually do not have that working either! If you have not figured it out by tomorrow, I’ll take a look at it!