Presssing Ctrl + Alt switches to tty4


As the title says, pressing Ctrl + Alt switches to tty4.
It appears that sometimes my keyboard is pressing F4 by itself.

I sometimes see this in terminal just writing out:


I checked my keyboard key and it is not sticky.
I checked my keyboard in BIOS Diagnostics and everything is in order.

When I run sudo kbd_mode it shows:

The keyboard is in unknown mode

Running sudo kbd_mode -s fixes the problem until reboot.

Is there any permanent fix for this?

inxi -Faz

System:    Kernel: 5.14.14-zen1-1-zen x86_64 bits: 64 compiler: gcc v: 11.1.0
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=9d9588e0-3528-417d-969b-f7675645849e rw [email protected] quiet splash
rd.udev.log_priority=3 random.trust_cpu=on vt.global_cursor_default=0
systemd.unified_cgroup_hierarchy=1 resume=UUID=915bc289-3518-43ad-83a3-f27ed97bb979
nvme_core.default_ps_max_latency_us=0 loglevel=3
Desktop: KDE Plasma 5.23.1 tk: Qt 5.15.2 info: latte-dock wm: kwin_x11 vt: 1 dm: SDDM
Distro: Garuda Linux base: Arch Linux
Machine:   Type: Laptop System: Dell product: XPS 15 9500 v: N/A serial: <filter> Chassis: type: 10
serial: <filter>
Mobo: Dell model: 0W4CRC v: A03 serial: <filter> UEFI: Dell v: 1.9.1 date: 08/11/2021
Battery:   ID-1: BAT0 charge: 5.1 Wh (9.3%) condition: 54.8/54.9 Wh (99.9%) volts: 10.7 min: 11.4
model: BYD DELL DVG8M11 type: Li-poly serial: <filter> status: Discharging
CPU:       Info: Quad Core model: Intel Core i5-10300H bits: 64 type: MT MCP arch: Comet Lake
family: 6 model-id: A5 (165) stepping: 2 microcode: EA cache: L2: 8 MiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 39999
Speed: 800 MHz min/max: 800/2500 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800
5: 800 6: 800 7: 800 8: 800
Vulnerabilities: Type: itlb_multihit status: KVM: VMX disabled
Type: l1tf status: Not affected
Type: mds status: Not affected
Type: meltdown status: Not affected
Type: spec_store_bypass
mitigation: Speculative Store Bypass disabled via prctl and seccomp
Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
Type: spectre_v2 mitigation: Enhanced IBRS, IBPB: conditional, RSB filling
Type: srbds status: Not affected
Type: tsx_async_abort status: Not affected
Graphics:  Device-1: Intel CometLake-H GT2 [UHD Graphics] vendor: Dell driver: i915 v: kernel
bus-ID: 00:02.0 chip-ID: 8086:9bc4 class-ID: 0300
Device-2: Realtek Integrated_Webcam_HD type: USB driver: uvcvideo bus-ID: 1-11:3
chip-ID: 0bda:5510 class-ID: fe01 serial: <filter>
Display: x11 server: X.Org 1.20.13 compositor: kwin_x11 driver: loaded: intel
unloaded: modesetting alternate: fbdev,vesa display-ID: :0 screens: 1
Screen-1: 0 s-res: 1920x1200 s-dpi: 96 s-size: 508x317mm (20.0x12.5")
s-diag: 599mm (23.6")
Monitor-1: eDP1 res: 1920x1200 dpi: 143 size: 340x210mm (13.4x8.3") diag: 400mm (15.7")
OpenGL: renderer: Mesa Intel UHD Graphics (CML GT2) v: 4.6 Mesa 21.2.4 direct render: Yes
Audio:     Device-1: Intel Comet Lake PCH cAVS vendor: Dell driver: snd_hda_intel v: kernel
alternate: snd_soc_skl,snd_sof_pci_intel_cnl bus-ID: 00:1f.3 chip-ID: 8086:06c8
class-ID: 0403
Sound Server-1: ALSA v: k5.14.14-zen1-1-zen running: yes
Sound Server-2: JACK v: 1.9.19 running: no
Sound Server-3: PulseAudio v: 15.0 running: no
Sound Server-4: PipeWire v: 0.3.38 running: yes
Network:   Device-1: Intel Comet Lake PCH CNVi WiFi vendor: Rivet Networks driver: iwlwifi v: kernel
bus-ID: 00:14.3 chip-ID: 8086:06f0 class-ID: 0280
IF: wlp0s20f3 state: up mac: <filter>
Bluetooth: Device-1: Intel AX201 Bluetooth type: USB driver: btusb v: 0.8 bus-ID: 1-14:4
chip-ID: 8087:0026 class-ID: e001
Report: bt-adapter ID: hci0 rfk-id: 1 state: down bt-service: enabled,running rfk-block:
hardware: no software: yes address: <filter>
Drives:    Local Storage: total: 476.94 GiB used: 109.82 GiB (23.0%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: A-Data model: SX6000LNP size: 476.94 GiB
block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD
serial: <filter> rev: V9002s65 temp: 32.9 C scheme: GPT
Partition: ID-1: / raw-size: 459.76 GiB size: 459.76 GiB (100.00%) used: 109.77 GiB (23.9%)
fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-2: /boot/efi raw-size: 260 MiB size: 256 MiB (98.46%) used: 49.4 MiB (19.3%) fs: vfat
dev: /dev/nvme0n1p1 maj-min: 259:1
ID-3: /home raw-size: 459.76 GiB size: 459.76 GiB (100.00%) used: 109.77 GiB (23.9%)
fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-4: /var/log raw-size: 459.76 GiB size: 459.76 GiB (100.00%) used: 109.77 GiB (23.9%)
fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
ID-5: /var/tmp raw-size: 459.76 GiB size: 459.76 GiB (100.00%) used: 109.77 GiB (23.9%)
fs: btrfs dev: /dev/nvme0n1p2 maj-min: 259:2
Swap:      Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: partition size: 16.92 GiB used: 0 KiB (0.0%) priority: -2
dev: /dev/nvme0n1p3 maj-min: 259:3
ID-2: swap-2 type: zram size: 15.25 GiB used: 0 KiB (0.0%) priority: 100 dev: /dev/zram0
Sensors:   System Temperatures: cpu: 41.0 C mobo: N/A
Fan Speeds (RPM): cpu: 0 fan-2: 0
Info:      Processes: 283 Uptime: 20m wakeups: 2607 Memory: 15.25 GiB used: 3.13 GiB (20.5%)
Init: systemd v: 249 tool: systemctl Compilers: gcc: 11.1.0 clang: 12.0.1 Packages:
pacman: 1595 lib: 496 Shell: fish v: 3.3.1 default: Bash v: 5.1.8 running-in: konsole
inxi: 3.3.07

Have you tried different kernels such as linux or linux-lts?


Yes, same thing.

I have the solution to it but looking for a permanent one.
Guess I will have to set up a script that start when system boots up.

Solved it by creating a cron job that runs a script at boot.

Creating a script:

vim /home/username/Documents/

Write this inside:

sudo kbd_mode -s

Edit the crontab with crontab -e and write this:

@reboot /home/username/Documents/

Now this still won't work since we need to run the command as sudo.
Change file ownership to root.

sudo chown root /path/to/

Now to be able to execute the file we need to give it execution and suid permission. (suid so we can execute it as owner of the file, root)

sudo chmod +sx /path/to/

Just to make sure that you don't have any security issues, make sure that after running ls -l permissions look exactly like this: .rwsr--r--

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.