[2.0.60] Capture of ALT MOUSE-WHEEL-UP and DOWN not working

This subforum contains all the issues which we already resolved.
JustGoFly
Inserter
Inserter
Posts: 30
Joined: Fri Dec 18, 2020 6:12 pm
Contact:

[2.0.60] Capture of ALT MOUSE-WHEEL-UP and DOWN not working

Post by JustGoFly »

I'm trying to disable in my Brave New Oarc mod the ALT mouse wheel. This functionality is making a higher quality duplicates of items I allow in the players inventory and making same level duplicates and drops on the ground stacks of 50 of those items. The issue is just that I can't disable this functionality.

Instructions:
Join game.
Give yourself a box
put in the box some speed modules
pick up a stack of speed modules, hold ALT and scroll the mouse wheel up.

Then pick up any item like an assembler with the Q key.
ALT Mouse Up - and your bots will pick up and place the stacks of those you are dropping into yellow boxes

In data.lua:

Code: Select all

data:extend({
  {
    type = "custom-input",
    name = "suppress-alt-scroll",
    key_sequence = "ALT + MOUSE-WHEEL-UP",
    consuming = "game-only"
  },
  {
    type = "custom-input",
    name = "suppress-alt-scroll-down",
    key_sequence = "ALT + MOUSE-WHEEL-DOWN",
    consuming = "game-only"
  }
})
In control.lua:

Code: Select all

--=================================================================================================
-- Remove Alt-Scroll ability
script.on_event("suppress-alt-scroll", function(event)
  -- Do nothing
end)

script.on_event("suppress-alt-scroll-down", function(event)
  -- Also do nothing
end)
Attachments
brave-new-oarc_4.3.17.zip
Unreleased version of the code with the above events added
(2.61 MiB) Downloaded 8 times
BNO-VoidBlock-July-15 (debug).zip
Save file
(35.91 MiB) Downloaded 9 times
JustGoFly
Inserter
Inserter
Posts: 30
Joined: Fri Dec 18, 2020 6:12 pm
Contact:

Re: [2.0.60] Capture of ALT MOUSE-WHEEL-UP and DOWN not working

Post by JustGoFly »

More importantly I should not be getting an inventory changed event on an alt mouse up scroll, if that item is not in my inventory. Since I drop Iitems not allowed in inventory, it's free replication of items or free replication and quality change of items I do allow in inventory.. this would not solve the original problem, but I would not need to disable the key press. Which would continue to offer free items if the player changed the key binding. So not such a great work around to the larger but.
JustGoFly
Inserter
Inserter
Posts: 30
Joined: Fri Dec 18, 2020 6:12 pm
Contact:

Re: [2.0.60] Capture of ALT MOUSE-WHEEL-UP and DOWN not working

Post by JustGoFly »

I see this in the log file:
Error ControlSettings.cpp:1042: suppress-alt-scroll (custom-input): unknown key_sequence: ALT + MOUSE-WHEEL-UP

Note that this is a side issue to the actual issue of my mod receiving a inventory changed event on a ALT Mouse Wheel Up showing inventory in hand that was never in inventory, but was Q copied or a copy of something in a chest.
JustGoFly
Inserter
Inserter
Posts: 30
Joined: Fri Dec 18, 2020 6:12 pm
Contact:

Re: [2.0.60] Capture of ALT MOUSE-WHEEL-UP and DOWN not working

Post by JustGoFly »

modified code to be:
ALT + mouse-wheel-up
ALT + mouse-wheel-down

It works now, BUT Still not the primary issue of receiving an event on inventory changed when a legitimate alt mouse wheel is used.
JustGoFly
Inserter
Inserter
Posts: 30
Joined: Fri Dec 18, 2020 6:12 pm
Contact:

Re: [2.0.60] Capture of ALT MOUSE-WHEEL-UP and DOWN not working

Post by JustGoFly »

Issue has to do with my dropping items in on_player_cursor_stack_changed
You can delete this post - alt mouse-wheel-up event works. My issue is some incompatibility between v 1.1 and 2.0 and I'm working through it.
Rseding91
Factorio Staff
Factorio Staff
Posts: 15877
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [2.0.60] Capture of ALT MOUSE-WHEEL-UP and DOWN not working

Post by Rseding91 »

Thanks for the report however after reading your posts here I have no idea what it is you're thinking is actually broken.

Do you have some steps to do, where an action happens that you think should not happen?

Your save file has the player in the god controller with cheat_mode = true. So alt + scroll will put the item in the cursor stack back into the players inventory, and then *give for free* the new stack of items of a different quality. That's intended because the player is *in cheat mode*.
If you want to get ahold of me I'm almost always on Discord.
JustGoFly
Inserter
Inserter
Posts: 30
Joined: Fri Dec 18, 2020 6:12 pm
Contact:

Re: [2.0.60] Capture of ALT MOUSE-WHEEL-UP and DOWN not working

Post by JustGoFly »

ok thanks for the info. Cheat Mode is needed to enable them to function in god mode. But all of the cheat ability is patch'd. They can't craft, or really cheat. What I did to correct this issue was to disable the permission to Alt Mouse Scroll and I turned off my support for Quality mod, since they could easily replicate a quality module if they had a lower quality one in their inventory. I only allow some items in their inventory.

My original issue is resolved, so please feel free to close this issue. The ALT MOUSE-WHEEL-UP needed to be ALT mouse-wheel-up. I couldn't find any documentation on the case sensitivity of this.

Thank you for your time!
Post Reply

Return to “Resolved Problems and Bugs”