Skip to content

Commit

Permalink
Bind ? to help_scren
Browse files Browse the repository at this point in the history
  • Loading branch information
mdom committed Jan 21, 2019
1 parent 989d57a commit 0147060
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ the first chapter with real content if possible.

# KEY BINDINGS

- h
- h, ?

Display help screen.

Expand Down
14 changes: 6 additions & 8 deletions lib/App/termpub.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ sub run {

$self->set_chapter( $self->epub->start_chapter );

$self->key_bindings->{n} = 'next_chapter';
$self->key_bindings->{p} = 'prev_chapter';
$self->key_bindings->{h} = 'help_screen';
$self->key_bindings->{n} = 'next_chapter';
$self->key_bindings->{p} = 'prev_chapter';
$self->key_bindings->{h} = 'help_screen';
$self->key_bindings->{'?'} = 'help_screen';

$self->SUPER::run;
}
Expand Down Expand Up @@ -47,11 +48,8 @@ sub help_screen {

for my $key (@keys) {
$pad->addstring( ( $keycodes{$key} || $key ) );
$pad->addstring(
$row,
$length,
' = ' . $self->key_bindings->{$key} . "\n"
);
$pad->addstring( $row, $length,
' = ' . $self->key_bindings->{$key} . "\n" );
$row++;
}

Expand Down
2 changes: 1 addition & 1 deletion script/termpub
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ the first chapter with real content if possible.
=over 4
=item h
=item h, ?
Display help screen.
Expand Down

0 comments on commit 0147060

Please sign in to comment.