Jump to content

Existing mods that use keyboard shortcuts??


Mulbin

Recommended Posts

Ok, odd request here..

Some might already know that I'm constructing a simpit for ksp (simulator cockpit) but I've hit a real wall when it comes to controlling the various functions... basically KSP only recognises a few commands/keystrokes and only has 10 action groups (no where near enough!)... my simulator will have roughly 50 switches to control systems in detail. But only 10 action groups... you get the problem.

I've tried to raise enthusiasm from modders but none seem interested in making a mod to simulate extra hotkeys through a GUI. So I need to find other ways of linking functions to my controls!

So the question is, what mods are out there that currently have their own hotkeys - without having to put them in an action group? I can assign anything with a keyboard shortcut to a switch or controller.

Some I have found...

Infernal robotics (has shortcuts for controlling parts).

KAS (has shortcuts for winch controls)

Any more that people know about would be great, particularly keen to find any mods that assign keystrokes to engine/fuel commands (without having to use an action group).

Link to comment
Share on other sites

I only use a single key, but my Vertical Velocity mod uses a keyboard key.

I also have code for rebinding the key to another key dynamically in game and saving that key binding.

I don't have conflict checking with existing key bindings however.

I am not able to help on the hotkeys thing. This request is starting to come up more and more, but in the 5 minutes of thought I've put into it, it is significantly more complicated then it sounds.

Load Keybinding from .cfg file


public void Start()
TWR1Node = ConfigNode.Load(KSPUtil.ApplicationRootPath + "GameData/Diazo/TWR1/TWR1.cfg"); //load .cfg file
TWR1KeyCodeString = TWR1Node.GetValue("TWR1Key"); //read keybind from .cfg as text string
TWR1KeyCode = (KeyCode)Enum.Parse(typeof(KeyCode), TWR1KeyCodeString); //convert from text string to KeyCode item

Execute code on keypress


public void Update()
if (Input.GetKeyDown(TWR1KeyCode) == true) //Does the Key get pressed? Note this is only true on the first Update frame the key is pressed, the second and subsequent Update frames this is false even though the key is still physically held down.
{
//Run Code Here
}

if (Input.GetKeyUp(TWR1KeyCode) == true) //Key just got released, again only true for a single Update frame.
{
//Run Code here if needed
}

Rebind key. Note that this method works for multiple input types including keyboard, mouse button, joystick and controller buttons. Also, if I read the Unity documentation right, you could bind the switches to unused Unicode characters that don't physically exist on the keyboard so you are not using up keyboard keys to bind to the switches.


if (Event.current.keyCode != KeyCode.None) //wait for keypress
{
TWR1KeyCode = Event.current.keyCode; //assign new key
TWR1KeyCodeString = TWR1KeyCode.ToString(); //convert Keycode to text string
TWR1Node.SetValue("TWR1Key", TWR1KeyCodeString); //save text string to config node
TWR1Node.Save(KSPUtil.ApplicationRootPath + "GameData/Diazo/TWR1/TWR1.cfg"); //save config node with new keybinding
}

D.

edit: Got ninja'd apparently. :)

Edited by Diazo
Link to comment
Share on other sites

...I've tried to raise enthusiasm from modders but none seem interested in making a mod to simulate extra hotkeys through a GUI. ...

Me too, at least twice I made proposals for more actions, also making clear those were not to be tied to actual keybinds. Still not know if even possible in theory, so good luck.

As KAS and HullcamVDS are already nominated, I can only add PreciseNode for what I know (default O and P keys, only active in mapview).

Link to comment
Share on other sites

Vertical velocity looks great! I'll have a play with it.

Agree with you both that the need for more action groups in some form is becoming a more common request (either using the existing action group code or overlaying a plugin that assigns its own action groups)... the game is becoming far more detailed. Even a single engine can easily use up 2 action groups just to toggle thrust and gimbal. By my last estimate to make my simulator have the level of control I'd like I would need 80 action groups :D

Even the first panel has useless switches as I've run out of groups.

q0NicyR.jpg

Until there is a mod to assign my own hotkeys to parts I'll just have to keep searching for mods that already have key bindings

Link to comment
Share on other sites

I have been turning over a keybindings mod in my head for a few days and with the comments in this thread I think I'm going to take a stab at it.

See my thread here (Link pending as I am still making it.)

D.

Awesome! would be great to see one made, something that works a bit like the action groups would be awesome where you can add parts/functions in a gui and assign a keystroke.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...