From 69ab05432334f98b755bd90ea96570573fde8773 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 14 Aug 2016 18:46:29 -0700 Subject: [PATCH] GUACAMOLE-51: Support -num and +num option (require clear/set numlock) in keymaps. --- src/protocols/rdp/keymaps/generate.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/protocols/rdp/keymaps/generate.pl b/src/protocols/rdp/keymaps/generate.pl index 255e7b10..d3764d6e 100755 --- a/src/protocols/rdp/keymaps/generate.pl +++ b/src/protocols/rdp/keymaps/generate.pl @@ -97,9 +97,11 @@ for my $filename (@ARGV) { my $ext_flags = 0; my $set_shift = 0; my $set_altgr = 0; + my $set_num = 0; my $clear_shift = 0; my $clear_altgr = 0; + my $clear_num = 0; # Parse ranges and options foreach $_ (split(/\s+/, $range)) { @@ -108,6 +110,7 @@ for my $filename (@ARGV) { if ((my $opt) = m/^\+([a-z]+)$/) { if ($opt eq "shift") { $set_shift = 1; } elsif ($opt eq "altgr") { $set_altgr = 1; } + elsif ($opt eq "num") { $set_num = 1; } elsif ($opt eq "ext") { $ext_flags = 1; } else { die "$filename: $.: ERROR: " @@ -119,6 +122,7 @@ for my $filename (@ARGV) { elsif ((my $opt) = m/^-([a-z]+)$/) { if ($opt eq "shift") { $clear_shift = 1; } elsif ($opt eq "altgr") { $clear_altgr = 1; } + elsif ($opt eq "num") { $clear_num = 1; } else { die "$filename: $.: ERROR: " . "Invalid clear option\n"; @@ -198,6 +202,16 @@ for my $filename (@ARGV) { $content .= ", .clear_keysyms = GUAC_KEYSYMS_ALL_SHIFT_ALTGR"; } + # Set locks + if ($set_num) { + $content .= ", .set_locks = KBD_SYNC_NUM_LOCK"; + } + + # Clear locks + if ($clear_num) { + $content .= ", .clear_locks = KBD_SYNC_NUM_LOCK"; + } + # Flags if ($ext_flags) { $content .= ", .flags = KBD_FLAGS_EXTENDED";