Eonirr

Untitled

Jan 20th, 2026
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. public string KeyToBindingPath(Key key)
  2. {
  3. return $"<Keyboard>/{key.ToString().ToLower()}";
  4. }
  5.  
  6. public void RebindMove(Key key)
  7. {
  8. var action = moveAction.action;
  9.  
  10. int bindingIndex = action.GetBindingIndexForControl(
  11. action.controls[0]
  12. );
  13.  
  14. string path = KeyToBindingPath(key);
  15.  
  16. action.ApplyBindingOverride(bindingIndex, path);
  17. }
  18.  
  19. //tu fais, ça va forcé la touche appuyé, pas la physic key
  20. RebindMove(Key.Q);
  21.  
  22. // pour display
  23. string display = moveAction.action.bindings[bindingIndex]
  24. .ToHumanReadableString(
  25. InputBinding.DisplayStringOptions.DontOmitDevice
  26. );
  27.  
Advertisement
Add Comment
Please, Sign In to add comment