diff --git a/guacamole-common-js/src/main/webapp/modules/OnScreenKeyboard.js b/guacamole-common-js/src/main/webapp/modules/OnScreenKeyboard.js index e9b5e18d5..96cd5f15f 100644 --- a/guacamole-common-js/src/main/webapp/modules/OnScreenKeyboard.js +++ b/guacamole-common-js/src/main/webapp/modules/OnScreenKeyboard.js @@ -307,7 +307,7 @@ Guacamole.OnScreenKeyboard = function(layout) { * * @type Guacamole.OnScreenKeyboard.Layout */ - this.layout = layout; + this.layout = new Guacamole.OnScreenKeyboard.Layout(layout); /** * Returns the element containing the entire on-screen keyboard. @@ -569,7 +569,7 @@ Guacamole.OnScreenKeyboard = function(layout) { // Add key to DOM, maintain scale div.appendChild(keyElement); - scaledElements.push(new ScaledElement(div, 1 /* TODO: Pull from layout */, 1, true)); + scaledElements.push(new ScaledElement(div, osk.layout.keyWidth[object] || 1, 1, true)); } // end if object is key name @@ -642,6 +642,16 @@ Guacamole.OnScreenKeyboard.Layout = function(template) { */ this.width = template.width; + /** + * The width of each key, in arbitrary units, relative to other keys in + * this layout. The true pixel size of each key will be determined by the + * overall size of the keyboard. If not defined here, the width of each + * key will default to 1. + * + * @type Object. + */ + this.keyWidth = template.keyWidth || {}; + }; /** @@ -727,13 +737,4 @@ Guacamole.OnScreenKeyboard.Key = function(template, name) { */ this.requires = template.requires || []; - /** - * The width of this key, in arbitrary units, relative to other keys in the - * same layout. The true pixel size of this key will be determined by the - * overall size of the keyboard. By default, this will be 1. - * - * @type Number - */ - this.width = template.width || 1; - };