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 9eca513 commit df24a63
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 @@ -587,6 +587,10 @@ sub shift_keys () {

## use critic

sub die_on_invalid_mapping ($key) {
die "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 @@ -605,7 +609,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 @@ -627,7 +631,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 @@ -657,7 +661,7 @@ sub map_and_send_key ($self, $keys, $down_flag, $press_release_delay) {
next;
}
else {
die "No map for '$key'";
die_on_invalid_mapping($key);
}
}

Expand Down

0 comments on commit df24a63

Please sign in to comment.