I've just bought a new laptop from Asus: Rog Strix Scar G17 G733QS and I tried installing Ubuntu 20.04 on it.
The problem is that every time I press any key on the laptop keyboard, the shut-down dialog/pop-up appears and if I forget about this and mistakenly press multiple keys, the laptop shuts down.
It seems that I can use Ubuntu just fine with a USB keyboard, but this is clearly not okay.
Do you have any idea about what I could do?
Update 1: I encountered the same behaviour on Fedora 33, but the live OS worked fine. Maybe the driver in the kernel is not compatible with the controller of the keyboard?
Update 2: I also tested Linux Mint with Cinnamon and everything works fine so far! Since both Ubuntu 20.04 and Fedora 33 use GNOME, I suspect it is somehow related to the DE. I further suspect that the underlying problem has to do with the preinstalled nouveau drivers which at the moment do not support the RTX 3080 laptop in the laptop because I got a warning, right before the DE gest loaded at boot time, saying that the device was not recognized.
Update 3: Now, one day later, the same behaviour started on Linux Mint too. When I press any key on the laptop's keyboard, the associated letter is generated if inside a text editor, but also the shut down dialog appears. When using an external keyboard, everything works fine. As recommended by Jason Croyle, here is the output of xev
associated with me pressing a key on the laptop's keyboard:
MappingNotify event, serial 44, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
KeyPress event, serial 44, synthetic NO, window 0x5000001,
root 0x50f, subw 0x0, time 423525, (-550,168), root:(942,438),
state 0x0, keycode 24 (keysym 0x71, q), same_screen YES,
XLookupString gives 1 bytes: (71) "q"
XmbLookupString gives 1 bytes: (71) "q"
XFilterEvent returns: False
KeyRelease event, serial 45, synthetic NO, window 0x5000001,
root 0x50f, subw 0x0, time 423602, (-550,168), root:(942,438),
state 0x0, keycode 24 (keysym 0x71, q), same_screen YES,
XLookupString gives 1 bytes: (71) "q"
XFilterEvent returns: False
MappingNotify event, serial 45, synthetic NO, window 0x0,
request MappingKeyboard, first_keycode 8, count 248
FocusOut event, serial 45, synthetic NO, window 0x5000001,
mode NotifyGrab, detail NotifyAncestor
FocusIn event, serial 46, synthetic NO, window 0x5000001,
mode NotifyUngrab, detail NotifyAncestor
KeymapNotify event, serial 46, synthetic NO, window 0x0,
keys: 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
as opposed to the output of xev
when pressing a key on the external keyboard:
KeyPress event, serial 38, synthetic NO, window 0x6200001,
root 0x50f, subw 0x0, time 826960, (-20,-2), root:(841,452),
state 0x0, keycode 24 (keysym 0x71, q), same_screen YES,
XLookupString gives 1 bytes: (71) "q"
XmbLookupString gives 1 bytes: (71) "q"
XFilterEvent returns: False
KeyRelease event, serial 38, synthetic NO, window 0x6200001,
root 0x50f, subw 0x0, time 827056, (-20,-2), root:(841,452),
state 0x0, keycode 24 (keysym 0x71, q), same_screen YES,
XLookupString gives 1 bytes: (71) "q"
XFilterEvent returns: False
After searching the extra events, I found out that KeymapNotify happens everytime an application is awakened and is a way to inform that application about the state of the keyboard. I suspect this happens because the shut-down dialog is the awakened application in this case.
The MappingNotify event, on the other hand, seems to point out that the mapping of the physical key press has changed. And it seems like this happens once for the key press and once for the key release.