---
diff --git a/org.tizen.tutorials/html/web/tizen/ui/inputdevice_tutorial_w.htm b/org.tizen.tutorials/html/web/tizen/ui/inputdevice_tutorial_w.htm
index 15b25a4..f88004a 100644
--- a/org.tizen.tutorials/html/web/tizen/ui/inputdevice_tutorial_w.htm
+++ b/org.tizen.tutorials/html/web/tizen/ui/inputdevice_tutorial_w.htm
@@ -128,6 +128,21 @@ for (var i = 0; i < supportedKeys.length; ++i) {
}
}
+
+If we know exactly list of keys, we want to register, registering could be done with async method registerKeyBatch()
+
+var keys = ["VolumeUp", "VolumeDown"];
+function errorCB(err) {
+ console.log( 'The following error occurred: ' + err.name);
+}
+
+function successCB() {
+ console.log('All keys registsered successfully');
+}
+
+tizen.inputdevice.registerKeyBatch(keys, successCB, errorCB);
+
+
@@ -165,6 +180,20 @@ for (var i = 0; i < supportedKeys.length; ++i) {
console.log("key: " + supportedKeys[i].name + " was unregistered for event handling");
}
+
+Unregistering keys, also could be done with unregisterKeyBatch():
+
+var keys = ["VolumeUp", "VolumeDown"];
+function errorCB(err) {
+ console.log( 'The following error occurred: ' + err.name);
+}
+function successCB() {
+ console.log('Unregistsered successfully');
+}
+var keys = ["VolumeUp", "VolumeDown"];
+tizen.inputdevice.unregisterKeyBatch(keys, successCB, errorCB);
+
+
After unregistration keydown and keyup events would not be triggered for those keys.
diff --git a/org.tizen.web.apireference/html/device_api/mobile/tizen/inputdevice.html b/org.tizen.web.apireference/html/device_api/mobile/tizen/inputdevice.html
index e407e17..41c29bf 100644
--- a/org.tizen.web.apireference/html/device_api/mobile/tizen/inputdevice.html
+++ b/org.tizen.web.apireference/html/device_api/mobile/tizen/inputdevice.html
@@ -60,7 +60,9 @@ An application can handle device dependent key events after registration.
InputDeviceKey[] getSupportedKeys ()
InputDeviceKey? getKey (InputDeviceKeyName keyName)
void registerKey (InputDeviceKeyName keyName)
- void unregisterKey (InputDeviceKeyName keyName)
+ void unregisterKey (InputDeviceKeyName keyName)
+ void registerKeyBatch (InputDeviceKeyName[] keyNames, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback)
+ void unregisterKeyBatch (InputDeviceKeyName[] keyNames, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback)
@@ -175,6 +177,10 @@ This is the keyCode attribute value of the Key Event generated by the k
void registerKey(InputDeviceKeyName keyName) raises(WebAPIException);
void unregisterKey(InputDeviceKeyName keyName) raises(WebAPIException);
+
+ void registerKeyBatch(InputDeviceKeyName[] keyNames, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
+
+ void unregisterKeyBatch(InputDeviceKeyName[] keyNames, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
};
Since:
@@ -359,6 +365,151 @@ An application can not register the mandatory keys (ArrowLeft, ArrowRight, Arrow
+
+registerKeyBatch
+
+
+
+ Registers a batch of input device keys to receive DOM keyboard event when any of them is pressed or released
+
+
+
+ Since:
+ 2.4
+
+
+
+The errorCallback is launched with this error type:
+
+
+ -
+InvalidValuesError: If any of the given keyNames is invalid or not supported
+ -
+UnknownError: In case of any other error
+
+
+When an application wants to react to the input device keys being pressed, it should register those keys.
+
+
+An application can not register the mandatory keys (ArrowLeft, ArrowRight, ArrowUp, ArrowDown, Enter, Back).
+
+
+
+
Parameters:
+
+ -
+keyNames:
+ The array with key names of keys which should generate DOM key events when pressed
+
+ -
+successCallback [optional] [nullable]:
+ Callback method to be invoked when keys are registered.
+
+ -
+errorCallback [optional] [nullable]:
+ Callback method to be invoked when an error has occurred.
+
+
+
+
+
Exceptions:
+
- WebAPIException
+
+ with error type InvalidValuesError, if any of the given keyNames is invalid or not supported (e.g. name is empty string).
+
+
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+
+
+ with error type UnknownError in any other error case.
+
+
+
+
+
+
Code example:
function errorCB(err) {
+ console.log( 'The following error occurred: ' + err.name);
+ }
+
+ function successCB() {
+ console.log('Registsered successfully');
+ }
+
+ var keys = ["VolumeUp", "VolumeDown"];
+ tizen.inputdevice.registerKeyBatch(keys, successCB, errorCB);
+
+
+
+
+unregisterKeyBatch
+
+
+
+ Unregisters a batch of input device keys
+
+
+
+ Since:
+ 2.4
+
+
+
+The errorCallback is launched with this error type:
+
+
+ -
+InvalidValuesError: If any of the given keyNames is invalid or not supported
+ -
+UnknownError: In case of any other error
+
+
+
+
Parameters:
+
+ -
+keyNames:
+ The array containing names of keys which should not be monitored any longer
+
+ -
+successCallback [optional] [nullable]:
+ Callback method to be invoked when keys are unregistered.
+
+ -
+errorCallback [optional] [nullable]:
+ Callback method to be invoked when an error has occurred.
+
+
+
+
+
Exceptions:
+
- WebAPIException
+
+ with error type InvalidValuesError, if any of the given keyNames is invalid or not supported (e.g. name is empty string).
+
+
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+
+
+ with error type UnknownError in any error case.
+
+
+
+
+
+
Code example:
function errorCB(err) {
+ console.log( 'The following error occurred: ' + err.name);
+ }
+
+ function successCB() {
+ console.log('Unregistsered successfully');
+ }
+ var keys = ["VolumeUp", "VolumeDown"];
+ tizen.inputdevice.unregisterKeyBatch(keys, successCB, errorCB);
+
+
+
@@ -386,6 +537,10 @@ An application can not register the mandatory keys (ArrowLeft, ArrowRight, Arrow
void registerKey(InputDeviceKeyName keyName) raises(WebAPIException);
void unregisterKey(InputDeviceKeyName keyName) raises(WebAPIException);
+
+ void registerKeyBatch(InputDeviceKeyName[] keyNames, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
+
+ void unregisterKeyBatch(InputDeviceKeyName[] keyNames, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
};
};
diff --git a/org.tizen.web.apireference/html/device_api/wearable/tizen/inputdevice.html b/org.tizen.web.apireference/html/device_api/wearable/tizen/inputdevice.html
index e407e17..41c29bf 100644
--- a/org.tizen.web.apireference/html/device_api/wearable/tizen/inputdevice.html
+++ b/org.tizen.web.apireference/html/device_api/wearable/tizen/inputdevice.html
@@ -60,7 +60,9 @@ An application can handle device dependent key events after registration.
InputDeviceKey[] getSupportedKeys ()
InputDeviceKey? getKey (InputDeviceKeyName keyName)
void registerKey (InputDeviceKeyName keyName)
- void unregisterKey (InputDeviceKeyName keyName)
+ void unregisterKey (InputDeviceKeyName keyName)
+ void registerKeyBatch (InputDeviceKeyName[] keyNames, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback)
+ void unregisterKeyBatch (InputDeviceKeyName[] keyNames, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback)
@@ -175,6 +177,10 @@ This is the keyCode attribute value of the Key Event generated by the k
void registerKey(InputDeviceKeyName keyName) raises(WebAPIException);
void unregisterKey(InputDeviceKeyName keyName) raises(WebAPIException);
+
+ void registerKeyBatch(InputDeviceKeyName[] keyNames, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
+
+ void unregisterKeyBatch(InputDeviceKeyName[] keyNames, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
};
Since:
@@ -359,6 +365,151 @@ An application can not register the mandatory keys (ArrowLeft, ArrowRight, Arrow
+
+registerKeyBatch
+
+
+
+ Registers a batch of input device keys to receive DOM keyboard event when any of them is pressed or released
+
+
+
+ Since:
+ 2.4
+
+
+
+The errorCallback is launched with this error type:
+
+
+ -
+InvalidValuesError: If any of the given keyNames is invalid or not supported
+ -
+UnknownError: In case of any other error
+
+
+When an application wants to react to the input device keys being pressed, it should register those keys.
+
+
+An application can not register the mandatory keys (ArrowLeft, ArrowRight, ArrowUp, ArrowDown, Enter, Back).
+
+
+
+
Parameters:
+
+ -
+keyNames:
+ The array with key names of keys which should generate DOM key events when pressed
+
+ -
+successCallback [optional] [nullable]:
+ Callback method to be invoked when keys are registered.
+
+ -
+errorCallback [optional] [nullable]:
+ Callback method to be invoked when an error has occurred.
+
+
+
+
+
Exceptions:
+
- WebAPIException
+
+ with error type InvalidValuesError, if any of the given keyNames is invalid or not supported (e.g. name is empty string).
+
+
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+
+
+ with error type UnknownError in any other error case.
+
+
+
+
+
+
Code example:
function errorCB(err) {
+ console.log( 'The following error occurred: ' + err.name);
+ }
+
+ function successCB() {
+ console.log('Registsered successfully');
+ }
+
+ var keys = ["VolumeUp", "VolumeDown"];
+ tizen.inputdevice.registerKeyBatch(keys, successCB, errorCB);
+
+
+
+
+unregisterKeyBatch
+
+
+
+ Unregisters a batch of input device keys
+
+
+
+ Since:
+ 2.4
+
+
+
+The errorCallback is launched with this error type:
+
+
+ -
+InvalidValuesError: If any of the given keyNames is invalid or not supported
+ -
+UnknownError: In case of any other error
+
+
+
+
Parameters:
+
+ -
+keyNames:
+ The array containing names of keys which should not be monitored any longer
+
+ -
+successCallback [optional] [nullable]:
+ Callback method to be invoked when keys are unregistered.
+
+ -
+errorCallback [optional] [nullable]:
+ Callback method to be invoked when an error has occurred.
+
+
+
+
+
Exceptions:
+
- WebAPIException
+
+ with error type InvalidValuesError, if any of the given keyNames is invalid or not supported (e.g. name is empty string).
+
+
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+
+
+ with error type UnknownError in any error case.
+
+
+
+
+
+
Code example:
function errorCB(err) {
+ console.log( 'The following error occurred: ' + err.name);
+ }
+
+ function successCB() {
+ console.log('Unregistsered successfully');
+ }
+ var keys = ["VolumeUp", "VolumeDown"];
+ tizen.inputdevice.unregisterKeyBatch(keys, successCB, errorCB);
+
+
+
@@ -386,6 +537,10 @@ An application can not register the mandatory keys (ArrowLeft, ArrowRight, Arrow
void registerKey(InputDeviceKeyName keyName) raises(WebAPIException);
void unregisterKey(InputDeviceKeyName keyName) raises(WebAPIException);
+
+ void registerKeyBatch(InputDeviceKeyName[] keyNames, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
+
+ void unregisterKeyBatch(InputDeviceKeyName[] keyNames, optional SuccessCallback? successCallback, optional ErrorCallback? errorCallback) raises(WebAPIException);
};
};