Skip to content

Commit

Permalink
Merge pull request #3442 from skateman/webmks-keymap
Browse files Browse the repository at this point in the history
Add keymap support for WebMKS remote consoles
(cherry picked from commit 30a591b)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1553331
  • Loading branch information
mzazrivec authored and simaishi committed Apr 10, 2018
1 parent 922fcba commit 05e5dd8
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions app/helpers/vmware_console_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
module VmwareConsoleHelper
KEYBOARD_LAYOUTS = [
['English', "en-US"],
['Japanese', "ja-JP_106/109"],
['German', "de-DE"],
['Italian', "it-IT"],
['Spanish', "es-ES"],
['Portuguese', "pt-PT"],
['French', "fr-FR"],
['Swiss‐French', "fr-CH"],
['Swiss‐German', "de-CH"]
].freeze

# Helper method for retrieving vmware remote console options for a <select> field
def vmware_remote_console_items(webmks)
items = [[_("VNC"), "VNC"], [_("VMware VMRC Plugin"), "VMRC"]]
Expand Down
2 changes: 2 additions & 0 deletions app/views/shared/_remote_console_footer.haml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
%span#console-type.label.label-info= j console_type.to_s
%span#connection-status.label.label-warning= _('Connecting')
.pull-right
- if console_type == 'WebMKS'
= select_tag(:keymap, options_for_select(VmwareConsoleHelper::KEYBOARD_LAYOUTS), :id => 'keymap')
%button#ctrlaltdel.btn.btn-default{:title => _('Send CTRL+ALT+DEL')}
%i.fa.fa-keyboard-o
%button#fullscreen.btn.btn-default{:title => _('Toggle Fullscreen')}
Expand Down
4 changes: 4 additions & 0 deletions app/views/vm_common/console_webmks.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
$('#ctrlaltdel').on('click', function() {
wmks.sendCAD();
});

$('#keymap').on('change', function() {
wmks.setOption('keyboardLayoutId', this.value);
});
});

%body
Expand Down

0 comments on commit 05e5dd8

Please sign in to comment.