hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
19.66k stars 830 forks source link

Finnish keyboard layout dead keys do not register in any terminal emulator #7160

Closed aapo-kossi closed 1 month ago

aapo-kossi commented 1 month ago

Regression?

No

System Info and Version

System/Version info ```sh Hyprland, built from branch at commit 918d8340afd652b011b937d29d5eea0be08467f5 (flake.lock: update). Date: Tue Jun 25 12:06:02 2024 Tag: v0.41.2, commits: 4886 flags: (if any) System Information: System name: Linux Node name: IdeaPad Release: 6.10.2-arch1-1 Version: #1 SMP PREEMPT_DYNAMIC Sat, 27 Jul 2024 16:49:55 +0000 GPU information: 04:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Renoir [Radeon Vega Series / Radeon Vega Mobile Series] [1002:1636] (rev c3) (prog-if 00 [VGA controller]) os-release: NAME="Arch Linux" PRETTY_NAME="Arch Linux" ID=arch BUILD_ID=rolling ANSI_COLOR="38;2;23;147;209" HOME_URL="https://archlinux.org/" DOCUMENTATION_URL="https://wiki.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues" PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/" LOGO=archlinux-logo plugins: ``` [hyprland.conf.txt](https://github.com/user-attachments/files/16478593/hyprland.conf.txt)

Description

First, I will briefly motivate why I don't simply switch to a reasonable layout. On my desktop machine, that is exactly what I did as I could control what physical keyboard I use. However, on my laptop I still like that what key I input matches what is physically printed on the laptop, and using the Finnish layout is simpler than having to manually go through remapping a set of keys on a reasonable layout when the physical locations and layout of the keys on a Finnish keyboard do not match the positions of a US one. I expect this to affect all nordic layouts.

The Finnish layout has two dead keys, which input ¨,^,~ and ',`,¸ with unmodified, shift and AltGraph modifiers respectively. In GUI applications like firefox, wofi and thunar, this works perfectly. Similarly, in virtual console, no problem. However, when I try to refer to home (~) in a terminal emulator, nothing. alacritty --print-events says the key is unidentified(xkb(0xFE57)) even though wev correctly reports dead_tilde. That made me think this was an alacritty/wayland issue so I tried another terminal emulator, but no luck. No output is received from either dead key in alacritty, xterm or kitty on their own, with a space after, or composed with other keys (ã, ä, é, etc.). At this point I am a bit lost as I can't think of a workaround that doesn't either break the dead key functionality or require an excessive amount of reconfiguring for the scope of the problem. The layout mostly works as intended, but the issue just happens to be a very common key so if I don't find a fix I may simply go back to X. This is the behaviour with 0 xkb configuration files manually modified, only the hyprland.conf fi layout.

Before simply saying this is an xkb issue, I would like to reiterate that that does not seem to be the case as wev registers the correct key and even shows the correct symbols in its log. But when I try to input the characters inside any terminal emulator, they are not recognised. At first I thought that this issue was an incompatibility with alacritty and wayland, but that also does not match the behaviour as I also tried installing other terminal emulators and the issue was identical with both kitty and xterm. I doubt all of these would have the same bug, so Hyprland to me as a new wayland user seems to be the common denominator.

How to reproduce

set localectl keymap to fi open Hyprland open wev and try the key:

[14:     wl_keyboard] key: serial: 24247; time: 3146755; key: 108; state: 1 (pressed)
                      sym: ISO_Level3_Shift (65027), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000080: Mod5
                      latched: 00000000
                      locked: 00000000
[14:     wl_keyboard] key: serial: 24249; time: 3146907; key: 35; state: 1 (pressed)
                      sym: dead_tilde   (65107), utf8: ''
[14:     wl_keyboard] key: serial: 24250; time: 3147026; key: 35; state: 0 (released)
                      sym: dead_tilde   (65107), utf8: ''
[14:     wl_keyboard] key: serial: 24251; time: 3147106; key: 108; state: 0 (released)
                      sym: ISO_Level3_Shift (65027), utf8: ''
[14:     wl_keyboard] modifiers: serial: 0; group: 0
                      depressed: 00000000
                      latched: 00000000
                      locked: 00000000

open Alacritty --print-events and try the key:

[4.361831119s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(110923590046096)), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), event: KeyEvent { physical_key: Code(AltRight), logical_key: Named(AltGraph), text: None, location: Standard, state: Pressed, repeat: false, platform_specific: KeyEventExtra { key_without_modifiers: Named(AltGraph), text_with_all_modifiers: None } }, is_synthetic: false } }
[4.361865410s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(110923590046096)), event: ModifiersChanged(Modifiers { state: ModifiersState(0x0), pressed_mods: ModifiersKeys(0x0) }) }
[4.361883639s] [INFO ] [alacritty] winit event: AboutToWait
[4.510666193s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 3258, tv_nsec: 690071099 }, requested_resume: None })
[4.510749722s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(110923590046096)), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), event: KeyEvent { physical_key: Code(BracketRight), logical_key: Unidentified(Xkb(0xFE53)), text: None, location: Standard, state: Pressed, repeat: false, platform_specific: KeyEventExtra { key_without_modifiers: Unidentified(Xkb(0xFE57)), text_with_all_modifiers: None } }, is_synthetic: false } }
[4.510805735s] [INFO ] [alacritty] winit event: AboutToWait
[4.637303390s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 3258, tv_nsec: 838900935 }, requested_resume: None })
[4.637385453s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(110923590046096)), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), event: KeyEvent { physical_key: Code(BracketRight), logical_key: Unidentified(Xkb(0xFE53)), text: None, location: Standard, state: Released, repeat: false, platform_specific: KeyEventExtra { key_without_modifiers: Unidentified(Xkb(0xFE57)), text_with_all_modifiers: None } }, is_synthetic: false } }
[4.637422609s] [INFO ] [alacritty] winit event: AboutToWait
[4.828368502s] [INFO ] [alacritty] winit event: NewEvents(WaitCancelled { start: Instant { tv_sec: 3259, tv_nsec: 88852092 }, requested_resume: None })
[4.828445955s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(110923590046096)), event: KeyboardInput { device_id: DeviceId(Wayland(DeviceId)), event: KeyEvent { physical_key: Code(AltRight), logical_key: Named(AltGraph), text: None, location: Standard, state: Released, repeat: false, platform_specific: KeyEventExtra { key_without_modifiers: Named(AltGraph), text_with_all_modifiers: None } }, is_synthetic: false } }
[4.828477454s] [INFO ] [alacritty] winit event: WindowEvent { window_id: WindowId(WindowId(110923590046096)), event: ModifiersChanged(Modifiers { state: ModifiersState(0x0), pressed_mods: ModifiersKeys(0x0) }) }

Crash reports, logs, images, videos

No response

MillionsToOne commented 1 month ago

Have you set kb_layout = fi in your Hyprland config?

aapo-kossi commented 1 month ago

Have you set kb_layout = fi in your Hyprland config?

My config is attached in the system information field, and yes I have.

MightyPlaza commented 1 month ago

set the kb_variant to the one you want

  winkeys         fi: Finnish (Windows)
  classic         fi: Finnish (classic)
  nodeadkeys      fi: Finnish (classic, no dead keys)
  mac             fi: Finnish (Macintosh)
  smi             fi: Northern Saami (Finland)
aapo-kossi commented 1 month ago

set the kb_variant to the one you want

  winkeys         fi: Finnish (Windows)
  classic         fi: Finnish (classic)
  nodeadkeys      fi: Finnish (classic, no dead keys)
  mac             fi: Finnish (Macintosh)
  smi             fi: Northern Saami (Finland)

nodeadkeys is ok as a workaround as I don't really need the dead key functionality, thank you. The other variants exhibit the described bug with terminal emulators so there is still something going on. This works for me though.