godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.54k stars 21.26k forks source link

Certain key combinations fail to register with the Input system #47634

Closed nickgirga closed 3 years ago

nickgirga commented 3 years ago

Godot version:

Tested on v3.2.3.stable.flathub and v3.2.3.stable.official

OS/device including version:

Computer Information:
    Manufacturer:  Unknown
    Model:  Unknown
    Form Factor: Desktop
    No Touch Input Detected

Processor Information:
    CPU Vendor:  AuthenticAMD
    CPU Brand:  AMD Ryzen 5 2600X Six-Core Processor           
    CPU Family:  0x17
    CPU Model:  0x8
    CPU Stepping:  0x2
    CPU Type:  0x0
    Speed:  3600 Mhz
    12 logical processors
    6 physical processors
    HyperThreading:  Supported
    FCMOV:  Supported
    SSE2:  Supported
    SSE3:  Supported
    SSSE3:  Supported
    SSE4a:  Supported
    SSE41:  Supported
    SSE42:  Supported
    AES:  Supported
    AVX:  Supported
    AVX2:  Unsupported
    AVX512F:  Unsupported
    AVX512PF:  Unsupported
    AVX512ER:  Unsupported
    AVX512CD:  Unsupported
    AVX512VNNI:  Unsupported
    SHA:  Unsupported
    CMPXCHG16B:  Supported
    LAHF/SAHF:  Supported
    PrefetchW:  Unsupported

Operating System Version:
    "Arch Linux" (64 bit)
    Kernel Name:  Linux
    Kernel Version:  5.10.25-1-lts
    X Server Vendor:  The X.Org Foundation
    X Server Release:  12010000
    X Window Manager:  KWin
    Steam Runtime Version:  steam-runtime_0.20210126.2

Video Card:
    Driver:  AMD Radeon RX 580 Series (POLARIS10, DRM 3.40.0, 5.10.25-1-lts, LLVM 11.1.0)
    Driver Version:  4.6 (Compatibility Profile) Mesa 20.3.4
    OpenGL Version: 4.6
    Desktop Color Depth: 24 bits per pixel
    Monitor Refresh Rate: 60 Hz
    VendorID:  0x1002
    DeviceID:  0x67df
    Revision Not Detected
    Number of Monitors:  2
    Number of Logical Video Cards:  1
    Primary Display Resolution:  1600 x 900
    Desktop Resolution: 2960 x 900
    Primary Display Size: 17.44" x 9.80" (20.00" diag)
                                            44.3cm x 24.9cm (50.8cm diag)
    Primary VRAM: 8192 MB

Sound card:
    Audio device: USB Mixer

Memory:
    RAM:  15996 Mb

VR Hardware:
    VR Headset: None detected

Miscellaneous:
    UI Language:  English
    LANG:  en_US.UTF-8
    Total Hard Disk Space Available:  459932 Mb
    Largest Free Hard Disk Block:  42745 Mb

Storage:
    Number of SSDs: 2
    SSD sizes: %s1
    Number of HDDs: 1
    HDD sizes: %s1

(Pulled from Steam > Help > System Information)

Issue description:

When making a first person shooter that features sprinting (shift), walking (alt), and crouching (control), I noticed my movement would get a bit wacky when transitioning from crouching to walking while moving left. I realized this was because I was pressing Control + Alt + A, which is sometimes used as a shortcut (although I don't have one bound to that on my system). I created a simple test project to test my theory and I was correct.

Steps to reproduce: Write a basic script to test if pressing A will be detected if Control and Alt are being held. For a control, use the exact same logic to test other key combinations. Observe that it is not possible to detect if Control and Alt are being held while pressing A.

Minimal reproduction project:

Test Godot Project.zip

nickgirga commented 3 years ago

I actually found a default bind in KDE that uses Control + Alt + A: Kwin > Activate Window Demanding Attention. It appears to not do anything when no windows are demanding attention (which is what led me to believe I didn't have anything bound to it). After disabling that shortcut, the test project actually works as intended in Godot. That being said, knowing system shortcuts interfere with Godot's input system and that Control + Alt + A is a common one for systems using KDE (a pretty common desktop environment), it's probably best to avoid using that key combination.

As this issue isn't necessarily an inherent problem with Godot, I'm closing it.