Merge pull request #152 from glyptodon/input-method-constants

GUAC-1053: Add constants for each input method type.
This commit is contained in:
James Muehlner
2015-04-20 11:25:09 -07:00
2 changed files with 42 additions and 5 deletions

View File

@@ -192,8 +192,8 @@ angular.module('client').controller('clientController', ['$scope', '$routeParams
autoFit : true,
/**
* The currently selected input method. This may be either "none",
* "osk", or "text".
* The currently selected input method. This may be any of the values
* defined within preferenceService.inputMethods.
*
* @type String
*/

View File

@@ -36,6 +36,43 @@ angular.module('settings').factory('preferenceService', ['$injector',
// The parameter name for getting the history from local storage
var GUAC_PREFERENCES_STORAGE_KEY = "GUAC_PREFERENCES";
/**
* All valid input method type names.
*
* @type Object.<String, String>
*/
service.inputMethods = {
/**
* No input method is used. Keyboard events are generated from a
* physical keyboard.
*
* @constant
* @type String
*/
NONE : 'none',
/**
* Keyboard events will be generated from the Guacamole on-screen
* keyboard.
*
* @constant
* @type String
*/
OSK : 'osk',
/**
* Keyboard events will be generated by inferring the keys necessary to
* produce typed text from an IME (Input Method Editor) such as the
* native on-screen keyboard of a mobile device.
*
* @constant
* @type String
*/
TEXT : 'text'
};
/**
* All currently-set preferences, as name/value pairs. Each property name
* corresponds to the name of a preference.
@@ -53,12 +90,12 @@ angular.module('settings').factory('preferenceService', ['$injector',
emulateAbsoluteMouse : true,
/**
* The default input method. This may be either "none", "osk", or
* "text".
* The default input method. This may be any of the values defined
* within preferenceService.inputMethods.
*
* @type String
*/
inputMethod : 'none'
inputMethod : service.inputMethods.NONE
};