Although keys can be allocated to various tasks at game start there are quite a few left unused.
It would be handy to be able to allocate these keys to run code in mods.
Similar to the invoke keys in the Use menu but removing the necessity of opening the menu.
Possibly a nightmare to implement but it would IMO add a good option to the game.

An example would be to allocate 2 keys, preferably side by side to regulate the Jotun deflector. Pressing one key would set the Jotun to level 1 and pressing the other one would set it to level 4. Much quicker than using the Use menu.
Or pressing a key would allow a mod to automatically lay/launch of a series of mines at set distances as the playership moved.
Both examples are aimed at reducing keystrokes or mouseclicks to perform an operation; this is the main downside of the Use menu.

In these examples it removes the clunkiness of using the 'U'se menu to change settings on the shield or having to press the Launcher fire key multiple times at set distances.

The other main methods of running code is either programatically inside a mod without input from the player which, from what I've seen, usually leaves something to be desired in terms of control and dockscreens which work well but, as with the Use menu, have a level of clunkiness about them. Opening the dockscreen and selecting the action is roughly equivalent to using the Use menu and selecting the item.

Dockscreens also fill up quite quickly making them difficult to use with multiple mods as stacked dockscreens are required once the actions fill the screen. A problem when scrAddAction is used on existing game dockscreens. And the Use menu can become very wide requiring a lot of scrolling to get to an item.

nms 20 Apr 2018:

Technically, this should be possible in the next release using the uiIsKeyPressed function. You would probably need to have a recurring event that runs every tick and stores the state of the key so you can detect when it goes from up to down. But it would be easier if the engine handled it and you could have something like an <OnKeyPressed> event.

george moromisato 7 May 2018:

The main problem here is that people can re-assign keys at will. We'll need a somewhat more complicated scheme of defining custom commands and allowing users to assign keys to them.

Another possibility is to define a key/command to generic functions, such as "shield action" or "armor action". For example, if we map key 'Y' to "shield action", then the Jotun shield could define what happens when you press it.

relanat 18 Jun 2018:

Random thoughts.

Possibly a number of keys could be allocated to "Run code" duties at game start/key select whether they are used or not. I haven't thought it through and haven't worked out how to assign them but code in the mods could use a preset value like (@ keyPress 1) or something like that.

There would need to be some way of calculating how many keys would be needed, especially if multiple mods used this, and I've no idea how to handle it if too many keys are required. Just some more ideas to throw into the mix.

relanat 4 Apr 2019:

Another idea is for the game to have a way to detect if a mod uses uiIsKeyPressed.
As a default the 'keyPressed' key would be used as allocated in the mod based on the standard key settings. The modder would be responsible for making sure the key wasn't already in use.
If the player entered the "Keyboard Settings" feature from the intro screen there could be a 'tag' showing for each mod use of uiIsKeyPressed in addition to the standard tags, "Game Stats", "VolumeDown", etc.
As an example one could be "Commander's Log" to enter the Log dockscreen or two for AP's One Frame Turn mod, "One Frame Turn Left" and "One Frame Turn Right" as required.
The naming of the tags would be included in the mod.

This would prevent the setting of one key to two features which is the biggest problem I can see (well, except for all the code needed!).
I'm not sure how it works but some way of remembering these key settings for the next time Transcendence was loaded would be desirable.