elementary / elementary/terminal
Ctrl+K is overridden by "paste" on dvorak keyboard layout
- Dominant language
- Vala
- Stars
- 428
- Forks
- 104
- Avg merge
- 1d 54m
- Merged PRs (30d)
- 2
Description
When I use the standard ctrl+K (for cut line) in bash or nano, this is overridden by the "paste" command, but only if something is on the clipboard. This does not happen in other terminal emulators like Konsole. I suspect that this is because the K on my dvorak keyboard is on the place of the V of a QWERTY keyboard.
This part of the source code (commited in https://github.com/elementary/terminal/commit/f15ba42234651d0efcf12c912a62b9f7140c23a9) in MainWindow.vala looks suspect to me (line 488 and on):
```vala
/* Use hardware keycodes so the key used
* is unaffected by internationalized layout */
if (((e.state & Gdk.ModifierType.CONTROL_MASK) != 0) &&
settings.natural_copy_paste) {
uint keycode = e.hardware_keycode;
if (match_keycode (Gdk.Key.c, keycode)) {
if (current_terminal.get_has_selection ()) {
current_terminal.copy_clipboard ();
return true;
} else { /* Ctrl-c: Command cancelled */
current_terminal.last_key_was_return = true;
}
} else if (match_keycode (Gdk.Key.v, keycode)) {
return handle_paste_event ();
}
}
```
Commenting out this entire section solves the problem for me.
What is the reason that we are using "Hardware keycodes so the key used is unaffected by internationalized layout"?
Contributor guide
Assessment
This issue has not been assessed yet.