Repository: godot
Issue: "dead_key" button is not correctly converted to label and triggeres twice on second press (QWERTZ keyboard)
Labels: bug,platform:windows,topic:input

### Tested versions

- Reproduced in 4.3 stable and 4.2 stable

### System information

Windows 10 - Godot 4.3 - Compatibility - QWERTZ keyboard

### Issue description

I am working on an Input remapping system and ran into an issue with the conversion from a dead_key press into a displayable character. "dead_keys" I am talking about are the keys marked red on the QWERTZ layout in the top right and left:
<img width="712" alt="383262997-9e4175ce-ab36-48cb-a535-de75e55a9848" src="https://github.com/user-attachments/assets/760760f1-f66f-4538-8d4b-837623276c13">

These buttons have a unique behaviour when writing, as when they are pressed, they output nothing and when pressed again, they will output depending on the next pressed button. examples for the QWERTZ layout include:

|   first_input   |  text_output  |  second_input  |  text_output  |             note             |
|:---------------:|:-------------:|:--------------:|:-------------:|:----------------------------:|
|        ^        |     NONE      |        ^        |            ^^                 | pressing dead character again outputs it twice |
|        ^        |     NONE      |        e        |              ê              | pressing compatible character second | 
|        ^        |     NONE      |   SPACE_BAR     |           ^                 | there is no space after the ^ | 
|        ^        |     NONE      |        w        |              ^w               | non compatible characters |
|        ´        |     NONE      |        ´        |                ´´            | pressing dead character again outputs it twice | 
|        ´        |     NONE      |        e        |               é              | pressing compatible character second |
|        ´        |     NONE      |   SPACE_BAR     |               ´              | there is no space after the ´ |
|        ´        |     NONE      |        w        |              ´w               | non compatible characters |

# the issue
when trying to output the label of the button with `OS.get_keycode_string(event.get_key_label_with_modifiers())` the output changes for dead_keys on the second_input and to a diffrent symbol that is not printed on the key.


### Steps to reproduce

create a new scene with a control node and use the _input() function:
```gdscript
func _input(event: InputEvent) -> void:
	if event is InputEventKey and event.is_pressed() and not event.is_echo():
		print(OS.get_keycode_string(event.get_key_label_with_modifiers()))
```

## output for the `^` key

When pressing the ^ key repeatedly it outputs the following (first_input outputs AsciiCircum and second_input triggers input function twice with BackSlash as output):
```
AsciiCircum
BackSlash
BackSlash
AsciiCircum
BackSlash
BackSlash
AsciiCircum
```
I find this strange for two reasons:
1. why is the input function triggered twice for the second input?
2. why does it output BackSlash on the second input when there is no backslash on the ^ key

Meanwhile when holding down Ctrl and/or Shift and pressing the ^ key repeateadly produces the following results (not triggering the input function twice and always outputting `mods`+BackSlash):
```
Ctrl+BackSlash
Ctrl+BackSlash
Ctrl+BackSlash
Shift+BackSlash
Shift+BackSlash
Shift+BackSlash
Shift+Ctrl+BackSlash
Shift+Ctrl+BackSlash
```

Also holding down Alt and pressing ^ key repeateadly will not trigger the input function twice (but now alternating between Alt+AsciiCircum and Alt+BackSlash):
```
Alt+AsciiCircum
Alt+BackSlash
Alt+AsciiCircum
Alt+BackSlash
Alt+AsciiCircum
```

Holding Ctrl and Alt and pressing ^ key repeateadly always produces BackSlash:
```
Alt+Ctrl+BackSlash
Alt+Ctrl+BackSlash
Alt+Ctrl+BackSlash
Alt+Ctrl+BackSlash
```

small nitpick: why is the output Alt+Ctrl and not Ctrl+Alt (Ctrl at the beginning) for the `OS.get_keycode_string(event.get_key_label_with_modifiers())` function as thats the way we say it in speech? same for Shift+Ctrl and Shift+Alt+Ctrl ?

## output for the `´` key

for the ´ button something similar occurs when pressed repeatadly with alternations between ´ and BracketRight (second input triggers twice):
```
´
BracketRight
BracketRight
´
BracketRight
BracketRight
´
```

note: its just `´` as output, not `QuoteRight` because only `QuoteLeft` is valid on a US-keyboard layout.

When holding Ctrl and pressing ´ button it always outputs BracketRight:
```
Ctrl+BracketRight
Ctrl+BracketRight
```

for the rest `´` seems to behave similar with `^` as the output differs (in regards to BackSlash has become BracketRight and is also not found on the `´` key), but triggers are identical

### Minimal reproduction project (MRP)

MRP: [dead_key_bug.zip](https://github.com/user-attachments/files/17647818/dead_key_bug.zip)