Keyboard Input in Scripts and Delete Object Keybind



  • I hope I'm not making another suggestion which is already in the game and I'm just too stupid to find it, but I feel like it would be useful to use the DEL key as a way of quickly deleting something you have selected. (e.g. double press the DEL key to delete a structure/construction site) I'd like to have this because it would make deleting a bunch of things not so painfully slow.

    My second suggestion would be allowing keyboard input in scripts. For example: You could quickly type out commands. You could make shortcuts for controlling your creeps such as telling them to create different formations for attacking.

    Here is how I propose keyboard input would work: We could have access to a keyboard object and it might have an array with it's indexes as the keycode of the key and the value could be an object containing two values. One would be whether or not the key is currently down at the time of indexing and the other could be if the key was pressed at all on the last tick. Obviously that might be harder than I think it would be considering that the first value would be completely separate from ticks.

    The keyboard object might either instead of or in addition to the above contain a function which would generate a promise for when a specific keycode is pressed to allow for fast input that isn't based from tick to tick.

    The reason I include both of these is if we could use keyboard input we could program the first suggestion anyways.

    I apologize for making so many suggestions that probably won't even get added but I'm just super obsessed with the game and I like to share my extremely over complicated and usually useless ideas.


  • Dev Team

    Hello Hexcede,

    As Screeps is the game more about automation rather than interacting, I doubt that many players need the improvements you suggested. I'd say if you really need it, you can implement them yourself based on ScreepsSC or similar extension for UI/keys handling (and put UI/keys commands into a queue in your memory) and implement reaction to those commands in your codebase. That's exactly what I did to handle 'selected object' thing (draw path/task of creep I selected in UI, display spawn queue if I selected a spawner etc)