To keep it short i'm almost positive
no. I have never seen it anywhere else where someone was able to bind a certain key to a script. I mean, if you really wanted to you could do something such as making a script that loops maybe every 0.1 seconds that will check if the player has his lantern out and if so you could make it so it spawns the entity and turns the lantern back off. It would be something to the effect of binding the "f" key to the script.
If you are interested in using this method though here's how I believe the script would be set up:
void OnStart()
{
//Goes to "LoopStart" function.
LoopStart();
}
void LoopStart()
{
//Adds timer to go to "LanternCheck" function.
AddTimer("lantern_check", 0.1f, LanternCheck);
}
void LanternCheck(string &in asTimer)
{
//Checks if lantern is on.
if(GetLanternActive() == true) {
//Sets your entity active. (Replace "your_entity" with your entity name.)
SetEntityActive("your_entity", true);
//Makes the lantern turn off.
SetLanternActive(false, false);
}
//Else if the lantern is not on.
else {
//Make it loop all over again. (Change "0.1f" with any number to change the time intervals it loops.)
AddTimer("LanternCheck", 0.1f, "LanternCheck");
}
}
Nothing too fancy but I believe if you wanted to use this method it would work. Best of luck on whatever you're aiming to do!