Skip to content

Commit

Permalink
consoles: Mention VNC keyboard layout in errors
Browse files Browse the repository at this point in the history
Unify the error which is being used in 3 different places.

See: https://progress.opensuse.org/issues/133451
  • Loading branch information
kalikiana committed Aug 1, 2023
1 parent 29e2c11 commit 5f3132b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions consoles/VNC.pm
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,10 @@ sub shift_keys () {

## use critic

sub die_on_invalid_mapping ($key) {
die decode_utf8 "No map for '$key' - layouts other than en-us are not supported\n";
}

sub init_x11_keymap ($self) {
return if $self->keymap;
# create a deep copy - we want to reuse it in other instances
Expand All @@ -606,7 +610,7 @@ sub init_x11_keymap ($self) {
}
# VNC doesn't use the unshifted values, only prepends a shift key
for my $key (keys %{shift_keys()}) {
die "no map for $key" unless $keymap{$key};
die_on_invalid_mapping($key) unless $keymap{$key};
$keymap{$key} = [$keymap{shift}, $keymap{$key}];
}
$self->keymap(\%keymap);
Expand All @@ -628,7 +632,7 @@ sub init_ikvm_keymap ($self) {
}
my %map = %{shift_keys()};
while (my ($key, $shift) = each %map) {
die "no map for $key" unless $keymap{$shift};
die_on_invalid_mapping($key) unless $keymap{$shift};
$keymap{$key} = [$keymap{shift}, $keymap{$shift}];
}
$self->keymap(\%keymap);
Expand Down Expand Up @@ -658,7 +662,7 @@ sub map_and_send_key ($self, $keys, $down_flag, $press_release_delay) {
next;
}
else {
die decode_utf8 "No map for '$key'";
die_on_invalid_mapping($key);
}
}

Expand Down

0 comments on commit 5f3132b

Please sign in to comment.