It would be really useful for https://mods.factorio.com/mod/SpidertronWaypoints and other similar mods to be able to detect which modifier keys (shift, control etc) have been pressed along with the click.
Currently the only way to use modifiers is to define a CustomInput, which you can listen for and act upon when the player is holding a remote. This means that you can either detect a normal click and its position (using on_player_used_spider_remote) or a normal click and its modifiers (using various CustomInputs), but not both at the same time.
Alternatively, being able to get the cursor position from a CustomInput that uses mouse-button-x would be amazing, but I presume that it isn't possible to implement?
Add modifier keys used to on_player_used_spider_remote
Add modifier keys used to on_player_used_spider_remote
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Re: Add modifier keys used to on_player_used_spider_remote
When I requested modifier keys and mouse buttons for on_player_used_capsule, I was denied, so I wouldn't get your hopes up.
Don't forget, you're here forever.
Re: Add modifier keys used to on_player_used_spider_remote
Depending on event order, you might be able to listen for both the CustomInput and the on_player_used_spider_remote events, and amalgamate them. If a shift-click happens in the same tick that the player used a spider remote, then ta-da there's your modifier keys on the spider remote!
Re: Add modifier keys used to on_player_used_spider_remote
Don't worry, I never had much hopeRaiguard wrote: Sun Nov 08, 2020 2:45 am When I requested modifier keys and mouse buttons for on_player_used_capsule, I was denied, so I wouldn't get your hopes up.

My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Re: Add modifier keys used to on_player_used_spider_remote
That's a very intriguing idea. I suppose that I could set a flag with both of the events and respond to them in the following tick (depending on which flag was set). I may try that some day.PFQNiet wrote: Sun Nov 08, 2020 5:22 am Depending on event order, you might be able to listen for both the CustomInput and the on_player_used_spider_remote events, and amalgamate them. If a shift-click happens in the same tick that the player used a spider remote, then ta-da there's your modifier keys on the spider remote!
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Re: Add modifier keys used to on_player_used_spider_remote
Unfortunately this isn't possible. If you shift-click, then only the CustomInput is raised - you don't get the `on_player_used_spider_remote` because that event is only triggered by normal clicks.PFQNiet wrote: Sun Nov 08, 2020 5:22 am Depending on event order, you might be able to listen for both the CustomInput and the on_player_used_spider_remote events, and amalgamate them. If a shift-click happens in the same tick that the player used a spider remote, then ta-da there's your modifier keys on the spider remote!
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Re: Add modifier keys used to on_player_used_spider_remote
The idea to use a custominput was a brilliant one, and I would like to use it as well for Tapeline. However, capsules suffer the same problem as the spider remote - you simply cannot use them while holding shift or control. If that could be changed, then that would be enough to make it work!
Don't forget, you're here forever.
Re: Add modifier keys used to on_player_used_spider_remote
This should be fully possible to implement in 1.1 (albeit somewhat hacky) because you can now get the mouse position from CustomInput. From that you can check if the player is holding a spidertron remote and set the autopilot_target to that position (might be slightly more complex because you can't target any position eg in water...).
My mods
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings
Content: Lunar Landings | Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings