StoneBlue / ASET-Consolidated-Props

Repo for the adopted ASET Consolidated Props Pack by Alexustas for Kerbal Space Program
4 stars 2 forks source link

Make kosTerminal buttons actually work #3

Open JonnyOThan opened 1 year ago

MOARdV commented 1 year ago

That's a lot of colliders... I think the MAS version has 85 colliders.

JonnyOThan commented 1 year ago

Yeah...the colliders are actually already in the model, they were just never hooked up to anything.

MOARdV commented 1 year ago

I did a test page in MAS that supported text entry, enough to make sure the keyboard worked as expected. There are a few things that'd be cool to use it for outside of kOS. Like a "target celestial" page where you could start typing the name, and it'd apply the text as a filter to the list of options.

StoneBlue commented 1 year ago

rename your crafts... customizing crew/mission/etc logs.... Notes (like the Notes mod)... would be super-cool to be able to edit variables in cfgs, right in IVA :P ... (not to be applied till next game restart tho, of course)... something to write up/edit/display mission plans... :P i know... going out of scope now...

StoneBlue commented 1 year ago

Related? https://github.com/Alexustas/Props-requests/issues/35

Might be nice to get Crew Log page setup on it, so you could do text entries/edits? vOv

This also has the ALCOR Pod Cams page, that could mebbe be replaced, as well vOv

Also, seem to be two untextured (un-used/un-assigned) buttons above the "D-Pad" vOv

JonnyOThan commented 1 year ago

Oh yikes, it’s completely implemented with rpm custom variables.

No, I’d rather just hook the keyboard directly up to the kos (as in, the mod - not the prop) terminal. Or build a more general platform within rpm for text input.

JonnyOThan commented 1 year ago

Yeah, outside of VR the bang-for-buck seems pretty low because the user always has a keyboard right in front of them. You’d just need some way to “lock in” like kospropmonitor does. At least the clickable keys would make it plausible that you’re able to type on that screen. And you could do something fun like animate/light up the buttons as they’re pressed on the real-life keyboard.

StoneBlue commented 1 year ago

Linking this as interesting related FYI vOv https://forum.kerbalspaceprogram.com/index.php?/topic/211905-1125-181-aset-consolidated-avionics-props-iva-packs-adopted/&do=findComment&comment=4260588

supercrazylash commented 1 year ago

Hello, I'm thinking of potentially forking the repo to add in kOs functionality to the kOs monitor (as well as making all the buttons work with it) and making a pull request to merge it, are there any pages on the kOs monitor that wouldn't be problematic if they were replaced by a kOs page?

JonnyOThan commented 1 year ago

Hello, I'm thinking of potentially forking the repo to add in kOs functionality to the kOs monitor (as well as making all the buttons work with it) and making a pull request to merge it, are there any pages on the kOs monitor that wouldn't be problematic if they were replaced by a kOs page?

I'd suggest just adding it to one of the existing buttons (clicking multiple times will cycle through the pages that are assigned to that button).

Do you have a plan for how to pipe the button clicks from the colliders to the kos terminal? There are a lot of bad ways to do this, and I think the only good way involves some C# code which should probably be part of kosPropMonitor.

supercrazylash commented 1 year ago

My plan to get the collider clicks piped into the kOs terminal is to have all of the keyboard button id's be sequential for the key board for all keys except delete/modifier keys and write a custom page handler where the ButtonProcessor method has a switch-case statement that manually processes function keys/arrow keys/delete+modifier keys but, if the button id is greater than the id of the last key in the previous list, then the id of the first key not belonging to the above list will be subtracted from the id of the key pressed, the resulting number will match an index on a key map array that will contain all the characters on the keyboard, the character at the provided index will then be passed to the terminal.

I will then just write code that passes the keystrokes to kOs and the output from kOs to a custom variable that is then displayed on the kOs terminal screen.

I have a few more features planned but this is the gist of it.

My roadmap so far is:

P.S. should I leave visual studio files with the assembly info in the git files or just the source code?

P.P.S. the kOs console is currently accessed by pressing the MJ button twice.

JonnyOThan commented 1 year ago

@supercrazylash you are aware of the kospropmonitor mod right? Some of your comments gives me a hunch you might not be. It already does some of the things you mention. If you’d like some feedback on your approach I’d be happy to look over what you’ve got so far.

the kOs console is currently accessed by pressing the MJ button twice.

sounds perfect!

supercrazylash commented 1 year ago

@JonnyOThan I am aware of kospropmonitor and I am using the source code of that project as the basis for my code, however kospropmonitor contains a series of features which are not needed and feels unnecessarily complex, that mixed with my desire to minimize dependencies is my reason to not use it's methods as they are in my implementation, thanks for the advice though. Also my code can already read the output from kOs and I am now working on input.

supercrazylash commented 1 year ago

quick status update, I got kOS input and output working as well as the cursor and command history, I also got the break key to act like ctrl+c, these changes have already been committed to my fork but I'm not making a pull request yet as I haven't added the F-key scripts feature and the page is also missing the menu bar at the top that exists in all other pages