Add in key shortcut for local hostname macro

Another useful macro to have - ALT-l
This commit is contained in:
Duncan Ferguson 2013-04-21 22:13:54 +01:00
parent 85a796600a
commit 6aca350f8b
6 changed files with 14 additions and 2 deletions

View file

@ -1,6 +1,7 @@
????-??-?? Duncan Ferguson <duncan_ferguson@user.sf.net> - v4.02_02
- Fixed macros (%u, %s, %h, %n) not doing multiple replacements
- Add in key shortcut for username macro (ALT-u)
- Add in key shortcut for local hostname macro (ALT-l)
- Fixed a bug with 'show history' key shortcut
2013-04-16 Duncan Ferguson <duncan_ferguson@user.sf.net> - v4.02_01

View file

@ -470,6 +470,11 @@ Default key sequence to open AddHost menu. See below notes on shortcuts.
Default key sequence to send cssh client names to client. See below notes
on shortcuts.
=item key_localname = Alt-l
Default key sequence to send hostname of local server to client. See below
notes on shortcuts.
=item key_paste = Control-v
Default key sequence to paste text into the console window. See below notes

View file

@ -1611,6 +1611,8 @@ sub key_event {
logmsg( 2, "Received hotkey: $hotkey" );
send_text_to_all_servers('%s')
if ( $hotkey eq "key_clientname" );
send_text_to_all_servers('%h')
if ( $hotkey eq "key_localname" );
send_text_to_all_servers('%u')
if ( $hotkey eq "key_username" );
$self->add_host_by_name()
@ -1786,8 +1788,8 @@ sub populate_send_menu {
);
$menus{send}->command(
-label => 'Local Hostname',
-command => [ \&send_text_to_all_servers, '%s' ],
-accelerator => $self->config->{key_clientname},
-command => [ \&send_text_to_all_servers, '%h' ],
-accelerator => $self->config->{key_localname},
);
$menus{send}->command(
-label => 'Username',

View file

@ -37,6 +37,7 @@ my %default_config = (
key_addhost => "Control-Shift-plus",
key_clientname => "Alt-n",
key_history => "Alt-h",
key_localname => "Alt-l",
key_retilehosts => "Alt-r",
key_paste => "Control-v",
key_username => "Alt-u",

View file

@ -36,6 +36,7 @@ Readonly::Hash my %default_config => {
key_addhost => "Control-Shift-plus",
key_clientname => "Alt-n",
key_history => "Alt-h",
key_localname => "Alt-l",
key_retilehosts => "Alt-r",
key_paste => "Control-v",
key_username => "Alt-u",
@ -493,6 +494,7 @@ history_width=40
key_addhost=Control-Shift-plus
key_clientname=Alt-n
key_history=Alt-h
key_localname=Alt-l
key_paste=Control-v
key_quit=Control-q
key_retilehosts=Alt-r

View file

@ -10,6 +10,7 @@ history_width=40
key_addhost=Control-Shift-plus
key_clientname=Alt-n
key_history=Alt-h
key_localname=Alt-l
key_paste=Control-v
key_quit=Control-q
key_retilehosts=Alt-r