Page 1 of 1

[raiguard] [2.0.10] Alt + Click not registering on Linux

Posted: Fri Oct 25, 2024 6:28 am
by pipai
Running Factorio on Arch Linux.

The controls for Alt + Left/Right/Middle Click don't register. Pinning an item (default Alt + Right Click), opening Factoriopedia (Alt + Left Click), and also attempting a rebind to Alt + Left/Right/Middle Click doesn't work. Their functions do work with other combinations, such as Ctrl + Alt + Left/Right Click. Alt + other combinations are fine, it appears to specifically be Alt + Mouse controls that don't work.

Re: [2.0.10] Alt + Click not registering on Linux

Posted: Fri Oct 25, 2024 8:34 am
by teemu
I use MATE where Alt+mouse move drags the window instead. Perhaps that's absorbing the click event?

Re: [2.0.10] Alt + Click not registering on Linux

Posted: Fri Oct 25, 2024 10:03 am
by Ameb
Have you checked in Controls settings if you can bind combinations with Alt?

Re: [2.0.10] Alt + Click not registering on Linux

Posted: Fri Oct 25, 2024 10:20 am
by pipai
Alt + any keyboard combo is fine, so my window manager definitely isn't the problem.

I can definitely bind other combos with Alt, I checked with Ctrl + Alt + Left Click.

Re: [2.0.10] Alt + Click not registering on Linux

Posted: Fri Oct 25, 2024 1:38 pm
by esainane
Is your xfce4 configured to use Alt-click to drag windows around? I remember this being the default at some point, and it wouldn't interfere with Alt-keyboard or combined modifier click combos. Alt-click is working for me on my Linux installation, but I had to change Alt-click since it interfered with shortcuts in a lot of regular programs.

To check the current configuration, try:

Code: Select all

xfconf-query -c xfwm4 -p /general/easy_click
To change the configuration to the use the Super key instead:

Code: Select all

xfconf-query -c xfwm4 -p /general/easy_click -n -t string -s "Super"

Re: [2.0.10] Alt + Click not registering on Linux

Posted: Fri Oct 25, 2024 2:41 pm
by mward
I am having the same issue with Mageia 8.3, KDE Plasma 5.20

Re: [2.0.10] Alt + Click not registering on Linux

Posted: Fri Oct 25, 2024 7:32 pm
by pipai
Oh wow, I didn't even know that key combo existed. Thanks, @esainane, I switched it to use Super.

If you're running xfce like I am, check that first!

Re: [raiguard] [2.0.10] Alt + Click not registering on Linux

Posted: Sun Oct 27, 2024 6:55 pm
by gridstop
esainane wrote:
Fri Oct 25, 2024 1:38 pm
Is your xfce4 configured to use Alt-click to drag windows around? I remember this being the default at some point, and it wouldn't interfere with Alt-keyboard or combined modifier click combos. Alt-click is working for me on my Linux installation, but I had to change Alt-click since it interfered with shortcuts in a lot of regular programs.

To check the current configuration, try:

Code: Select all

xfconf-query -c xfwm4 -p /general/easy_click
To change the configuration to the use the Super key instead:

Code: Select all

xfconf-query -c xfwm4 -p /general/easy_click -n -t string -s "Super"
Huge thanks esainane!

If you don't want to install xconf-query and use that from the command line, you can find the same option in the Graphical Settings manager for xfce, under Settings Editor -> xfwm4 -> easy_click, change the value from "Alt" to "Super" as above.

Re: [raiguard] [2.0.10] Alt + Click not registering on Linux

Posted: Tue Oct 29, 2024 5:20 pm
by raiguard
Please launch the game from the terminal with SDL_EVENT_LOGGING=1 and see if the game receives SDL events for the click. If so, please post them so I can see.

This is what it looks like for me:

Code: Select all

INFO: SDL EVENT: SDL_KEYDOWN (timestamp=639166 windowid=1 state=pressed repeat=false scancode=226 keycode=1073742050 mod=256)
INFO: SDL EVENT: SDL_MOUSEBUTTONDOWN (timestamp=639239 windowid=1 which=0 button=1 state=pressed clicks=1 x=1552 y=705)
INFO: SDL EVENT: SDL_MOUSEBUTTONUP (timestamp=639315 windowid=1 which=0 button=1 state=released clicks=1 x=1552 y=705)
INFO: SDL EVENT: SDL_KEYUP (timestamp=639481 windowid=1 state=released repeat=false scancode=226 keycode=1073742050 mod=0)

Re: [raiguard] [2.0.10] Alt + Click not registering on Linux

Posted: Tue Oct 29, 2024 5:33 pm
by smegma_yogurt
Hi, had a similar issue while running the game in Linux mint. Installation through Steam.

I found this thread where someone had a similar issue.

Raiguard suggested to run with SDL logging but since I installed from Steam, all I managed to log was this:

Code: Select all

0.000 Initializing Steam API.
steam.sh[11275]: Running Steam on linuxmint 22 64-bit
steam.sh[11275]: STEAM_RUNTIME is enabled automatically
setup.sh[11467]: Steam runtime environment up-to-date!
0.000 Steam requires game restart, restarting...


Either way, I managed to fix the issue by turning off the Virtual Keyboard. In Linux Mint (Cinnamon) it is found on System Settings > Acessibility > Keyboard and turning off the Virtual Keyboard.

That did the trick for me and now Alt + Click is working properly.

Hope this helps someone.


Edit: Ignore that above. I'm an idiot and didn't realize I used shift+click instead of alt+click.

Re: [raiguard] [2.0.10] Alt + Click not registering on Linux

Posted: Wed Oct 30, 2024 3:13 am
by pipai
Steam version has the same logs as smegma_yogurt, so I downloaded the actual Linux binary. Switched xfce's setting back to Alt with:

Code: Select all

xfconf-query -c xfwm4 -p /general/easy_click -n -t string -s "Alt"
These are the logs for the relevant section:

Code: Select all

// Pressed Alt.
INFO: SDL EVENT: SDL_KEYDOWN (timestamp=33732 windowid=1 state=pressed repeat=false scancode=226 keycode=1073742050 mod=4352)
INFO: SDL EVENT: SDL_KEYUP (timestamp=34115 windowid=1 state=released repeat=false scancode=226 keycode=1073742050 mod=4096)
// Clicked Mouse left.
INFO: SDL EVENT: SDL_MOUSEBUTTONDOWN (timestamp=35901 windowid=1 which=0 button=1 state=pressed clicks=1 x=1269 y=661)
INFO: SDL EVENT: SDL_MOUSEBUTTONUP (timestamp=36250 windowid=1 which=0 button=1 state=released clicks=1 x=1269 y=661)
// Pressed Alt.
INFO: SDL EVENT: SDL_KEYDOWN (timestamp=37451 windowid=1 state=pressed repeat=false scancode=226 keycode=1073742050 mod=4352)
// Clicked Mouse left, no response.
// Released Alt.
INFO: SDL EVENT: SDL_KEYUP (timestamp=39169 windowid=1 state=released repeat=false scancode=226 keycode=1073742050 mod=4096)
It appears that it detects the Alt button, and it detects the Mouse down buttons, but for some reason it doesn't detect it when I use both. So xfce is definitely getting in the way somehow.

Re: [raiguard] [2.0.10] Alt + Click not registering on Linux

Posted: Wed Oct 30, 2024 9:14 am
by ct402
Hi, using Linux Mint 21.3 Cinnamon here, I have the same issue with Left alt+click not working (it works when i use the right alt though) :

Code: Select all

// Using Left Alt :
// Pressed and released Left Alt
INFO: SDL EVENT: SDL_KEYDOWN (timestamp=172032 windowid=1 state=pressed repeat=false scancode=226 keycode=1073742050 mod=4352)
INFO: SDL EVENT: SDL_KEYUP (timestamp=172148 windowid=1 state=released repeat=false scancode=226 keycode=1073742050 mod=4096)

// Pressed and released Left click
INFO: SDL EVENT: SDL_MOUSEBUTTONDOWN (timestamp=173648 windowid=1 which=0 button=1 state=pressed clicks=1 x=1885 y=1489)
INFO: SDL EVENT: SDL_MOUSEBUTTONUP (timestamp=173783 windowid=1 which=0 button=1 state=released clicks=1 x=1885 y=1489)

// Trying to do Left Alt + Click (here it seems the window manager intercepted the event as mentionned before)
INFO: SDL EVENT: SDL_KEYDOWN (timestamp=174683 windowid=1 state=pressed repeat=false scancode=226 keycode=1073742050 mod=4352)
INFO: SDL EVENT: SDL_WINDOWEVENT (timestamp=174852 windowid=1 event=SDL_WINDOWEVENT_TAKE_FOCUS data1=0 data2=0)
INFO: SDL EVENT: SDL_KEYUP (timestamp=175200 windowid=1 state=released repeat=false scancode=226 keycode=1073742050 mod=4096)

// Using Right Alt and doing the same :
// Pressed and released Right Alt
INFO: SDL EVENT: SDL_KEYDOWN (timestamp=309793 windowid=1 state=pressed repeat=false scancode=230 keycode=1073742054 mod=4608)
INFO: SDL EVENT: SDL_KEYUP (timestamp=309909 windowid=1 state=released repeat=false scancode=230 keycode=1073742054 mod=4096)

// Pressed and released Left click
INFO: SDL EVENT: SDL_MOUSEBUTTONDOWN (timestamp=310776 windowid=1 which=0 button=1 state=pressed clicks=1 x=1695 y=1519)
INFO: SDL EVENT: SDL_MOUSEBUTTONUP (timestamp=310926 windowid=1 which=0 button=1 state=released clicks=1 x=1695 y=1519)

// Doing Right Alt + Click (Here it works and Factoriopedia opens)
INFO: SDL EVENT: SDL_KEYDOWN (timestamp=311642 windowid=1 state=pressed repeat=false scancode=230 keycode=1073742054 mod=4608)
INFO: SDL EVENT: SDL_MOUSEBUTTONDOWN (timestamp=311893 windowid=1 which=0 button=1 state=pressed clicks=1 x=1695 y=1519)
INFO: SDL EVENT: SDL_MOUSEBUTTONUP (timestamp=311994 windowid=1 which=0 button=1 state=released clicks=1 x=1695 y=1519)
INFO: SDL EVENT: SDL_KEYUP (timestamp=312225 windowid=1 state=released repeat=false scancode=230 keycode=1073742054 mod=4096)
INFO: SDL EVENT: SDL_WINDOWEVENT (timestamp=313558 windowid=1 event=SDL_WINDOWEVENT_LEAVE data1=0 data2=0)

Re: [raiguard] [2.0.10] Alt + Click not registering on Linux

Posted: Thu Oct 31, 2024 1:49 pm
by gridstop
For cinnamon users,

Open System Settings, click the 'Window' icon, then go the Behavior tab.
Change the "Special key to move and resize windows" from Alt to something else, like Super (the windows key) or just disable it.

Re: [raiguard] [2.0.10] Alt + Click not registering on Linux

Posted: Sat Nov 02, 2024 12:29 am
by raiguard
Thanks for all of your reports. This is 100% the fault of your desktop environments / window managers and/or SDL. Moving to "won't fix".

The fact that some DEs take alt+click is baffling to me. There's a super key right there!

Re: [raiguard] [2.0.10] Alt + Click not registering on Linux

Posted: Sun Nov 03, 2024 3:44 am
by wahming
gridstop wrote:
Thu Oct 31, 2024 1:49 pm
For cinnamon users,

Open System Settings, click the 'Window' icon, then go the Behavior tab.
Change the "Special key to move and resize windows" from Alt to something else, like Super (the windows key) or just disable it.
Thanks, this became very relevant with Factoriopedia. I suspect there's probably a lot of Linux users suffering from it.