[raiguard][2.0.7][Linux][wayland] Videodriver set to wayland --> Keyboard doesnt work

This subforum contains all the issues which we already resolved.
p0lle
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Oct 21, 2024 2:01 pm
Contact:

[raiguard][2.0.7][Linux][wayland] Videodriver set to wayland --> Keyboard doesnt work

Post by p0lle »

Iam on Kubuntu 24.10 with wayland and kde Plasma 6.1.5.

If I set the setting "preferred Video driver" in the Factorio Settings menu to Wayland, I have to press AND hold the Left Shiftlock Button to be able to issue any Keyboard commands. For example: I cannot move with W,A,S,D. I have to Press and hold the left shiftlock button and W to move upwards.

If I set it back to X11, the Keyboard works fine.
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 580
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: [2.0.7][Linux][wayland] Videodriver set to wayland --> Keyboard doesnt work

Post by raiguard »

Thanks for the report. Can you post a log file so I can see your environment, and can you tell me which distribution and desktop environment you are running?
Don't forget, you're here forever.
p0lle
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Oct 21, 2024 2:01 pm
Contact:

Re: [2.0.7][Linux][wayland] Videodriver set to wayland --> Keyboard doesnt work

Post by p0lle »

Sorry for forgetting the log... I should read better. It should be attached now.

Kubuntu 24.10
KDE Plasma 6.1.5
Kernel: 6.11.0-8-generic
Graphics Platform: Wayland
GPU; Intel UHD Graphics 620
Attachments
factorio-current.log
(42.14 KiB) Downloaded 17 times
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 580
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: [2.0.7][Linux][wayland] Videodriver set to wayland --> Keyboard doesnt work

Post by raiguard »

Can you add SDL_EVENT_LOGGING=1 to your environment, reproduce the issue, then upload the log? I would like to see what the SDL keyboard events look like.

Edit: I just remembered that SDL won't print to the log, but only to stdout. So you really want to do this:

Code: Select all

SDL_EVENT_LOGGING=1 path/to/executable
Then copy/paste the terminal output into a file and upload that.

I tried redirecting SDL event logging to a file but couldn't get it to work...
Don't forget, you're here forever.
p0lle
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Oct 21, 2024 2:01 pm
Contact:

Re: [raiguard][2.0.7][Linux][wayland] Videodriver set to wayland --> Keyboard doesnt work

Post by p0lle »

Meanwhile i updated to [2.0.9] and I did use:

Code: Select all

SDL_EVENT_LOGGING=1 ~/Games/factorio-spaceage/bin/x64/factorio &> factorio-console.log
and got this output, is that what you are looking for? Before exiting the game i switched between going to the right by pressing D, with and without using the Left Shiftlock. The Interesting events should be direct at the end.

edit: I just realized i can also press CTRL instead of Shiftlock to walk
Attachments
factorio-console.log
(148.44 KiB) Downloaded 11 times
p0lle
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Oct 21, 2024 2:01 pm
Contact:

Re: [raiguard][2.0.7][Linux][wayland] Videodriver set to wayland --> Keyboard doesnt work

Post by p0lle »

more detailed:
if I just press the key d, i cannot walk and the log says:

Code: Select all

INFO: SDL EVENT: SDL_TEXTINPUT (timestamp=369484 windowid=1 text='d')
INFO: SDL EVENT: SDL_TEXTEDITING (timestamp=369484 windowid=1 text='' start=0 length=0)

If I press shiftlock and d, I can walk also walk and the log says:

Code: Select all

INFO: SDL EVENT: SDL_KEYDOWN (timestamp=533720 windowid=1 state=pressed repeat=false scancode=57 keycode=1073741881 mod=0)
INFO: SDL EVENT: SDL_KEYDOWN (timestamp=534285 windowid=1 state=pressed repeat=false scancode=7 keycode=100 mod=0)
INFO: SDL EVENT: SDL_TEXTINPUT (timestamp=534285 windowid=1 text='D')
INFO: SDL EVENT: SDL_KEYUP (timestamp=534756 windowid=1 state=released repeat=false scancode=7 keycode=100 mod=0)
INFO: SDL EVENT: SDL_KEYUP (timestamp=535038 windowid=1 state=released repeat=false scancode=57 keycode=1073741881 mod=0)

If I press CTRL and d, I can walk and the log says:

Code: Select all

INFO: SDL EVENT: SDL_KEYDOWN (timestamp=476609 windowid=1 state=pressed repeat=false scancode=224 keycode=1073742048 mod=64)
INFO: SDL EVENT: SDL_KEYDOWN (timestamp=477076 windowid=1 state=pressed repeat=false scancode=7 keycode=100 mod=64)
INFO: SDL EVENT: SDL_KEYUP (timestamp=477427 windowid=1 state=released repeat=false scancode=7 keycode=100 mod=64)
INFO: SDL EVENT: SDL_KEYUP (timestamp=477713 windowid=1 state=released repeat=false scancode=224 keycode=1073742048 mod=0)
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 580
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

Re: [raiguard][2.0.7][Linux][wayland] Videodriver set to wayland --> Keyboard doesnt work

Post by raiguard »

If SDL is not receiving the correct keyboard events then there isn't really anything I can do.

This looks like something wacky in your keyboard configuration. Perhaps updating SDL (which we plan to do in the relatively near future) will fix it, but beyond that you're on your own. I'm sorry.
Don't forget, you're here forever.
daaaana
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Oct 28, 2024 3:27 pm
Contact:

Re: [raiguard][2.0.7][Linux][wayland] Videodriver set to wayland --> Keyboard doesnt work

Post by daaaana »

I was also encountering this issue, and managed to find a workaround. I'm also using KDE plasma on Wayland, and in my case, the root cause was that I had ibus configured as a virtual keyboard. Disabling this setting fixed the issue and allowed me to play the game as expected.
10-28-2024, 11-33-16.png
10-28-2024, 11-33-16.png (83.68 KiB) Viewed 384 times
For reference, here's the software I'm using:

Distro: Arch Linux
Kernel: 6.6.58-1-lts
Desktop environment: KDE Plasma 6.2.2 (running with wayland)
Factorio version: 2.0.11
p0lle
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Oct 21, 2024 2:01 pm
Contact:

Re: [raiguard][2.0.7][Linux][wayland] Videodriver set to wayland --> Keyboard doesnt work

Post by p0lle »

nice find! Removing the virtualkeyboard (which KDE suggests to enable via notification), resolved the issue for me, too.
chayleaf
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Nov 02, 2024 11:26 pm
Contact:

Re: [raiguard][2.0.7][Linux][wayland] Videodriver set to wayland --> Keyboard doesnt work

Post by chayleaf »

Can confirm keyboard input doesn't work when you use an IME such as fcitx5.
nasa62
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Nov 06, 2024 8:10 pm
Contact:

Re: [raiguard][2.0.7][Linux][wayland] Videodriver set to wayland --> Keyboard doesnt work

Post by nasa62 »

Still occurs in 2.0.14, I also had `iBus Wayland` virtual keyboard and setting that to None did fix it, thank you!
nasa62
Manual Inserter
Manual Inserter
Posts: 2
Joined: Wed Nov 06, 2024 8:10 pm
Contact:

Re: [raiguard][2.0.7][Linux][wayland] Videodriver set to wayland --> Keyboard doesnt work

Post by nasa62 »

Additional information, still occurs in 2.0.16 after the SDL update listed in that log.

However (tested in both 2.0.15 & .16) the issue only occurs if `IBus Wayland` is enabled *at game startup*.
If you disable IBus Wayland Virtual Keyboard to "None" while the game is running & re-enable it (even without regaining focus on the game) inputs work properly even with it enabled.

So it's just that it has to toggle off... maybe it's reading the Virtual Keyboard first and not trying to read other input devices and when you toggle it it swaps to a different input device and then sticks there?
Post Reply

Return to “Resolved Problems and Bugs”