Removes an attached function which is called before key input processing.
(static) removeBeforeKeydownHandler(handler) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
handler |
function | A function to be removed. |
Returns:
A boolean indicates whether success or not.
- Type
- boolean
Example
$(document).ready(function() {
$.caph.focus.init(function(nearestFocusableFinderProvider, controllerProvider) {
var calledOnce = false;
var beforeHandler = function(context, controller) {
calledOnce = true;
console.log('before moving');
};
controllerProvider.addBeforeKeydownHandler(beforeHandler);
controllerProvider.addAfterKeydownHandler(function(context, controller) {
console.log('after moving');
if (!calledOnce) {
controllerProvider.removeBeforeKeydownHandler(beforeHandler);
console.log('remove handler');
}
});
});
});