Can I call the std clear cursor routine (default Q)?
Posted: Wed Jul 20, 2016 1:53 pm
One of the users of my Picker mod told me that he bound it to Q, together with the usual "clear cursor" control. Now I'm trying to design it to replace that control, because it works even better if it can take it over completely.
Unfortunately, this kills the nice new red/green wire behavior in .13, where the first Q cancels a connection in progress, and the second Q clears the cursor. Rail laying also gets changed.
I think the ideal behavior for Picker would be to call the vanilla "clear cursor" routine if the held item is red/green wire or a rail, otherwise do its own thing. Is there a way to accomplish this?
I think maybe the right way to do it is for the player to have Q bound both to Picker and to "clear cursor", and make Picker not consume the Q press, so that it passes on to the default clear cursor handler. I wonder if I can do this with the "consuming" parameter in data.lua, which currently looks like this:
I haven't been able to find a reference on the other possible values for "consuming" and what they do. Even if I can't accomplish what I'm trying here, I'd like to know where I can find a reference on custom controls.
Thanks for any help!
Unfortunately, this kills the nice new red/green wire behavior in .13, where the first Q cancels a connection in progress, and the second Q clears the cursor. Rail laying also gets changed.
I think the ideal behavior for Picker would be to call the vanilla "clear cursor" routine if the held item is red/green wire or a rail, otherwise do its own thing. Is there a way to accomplish this?
I think maybe the right way to do it is for the player to have Q bound both to Picker and to "clear cursor", and make Picker not consume the Q press, so that it passes on to the default clear cursor handler. I wonder if I can do this with the "consuming" parameter in data.lua, which currently looks like this:
Code: Select all
data:extend({
{
type = "custom-input",
name = "picker-select",
key_sequence = "Q",
consuming = "all"
},
})
Thanks for any help!