Removes an attached function which is called after key input processing.
(static) removeAfterKeydownHandler(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 afterHandler = function(context, controller) {
calledOnce = true;
console.log('after moving');
};
controllerProvider.addAfterKeydownHandler(afterHandler);
controllerProvider.addBeforeKeydownHandler(function(context, controller) {
console.log('before moving');
if (!calledOnce) {
controllerProvider.removeAfterKeydownHandler(afterHandler);
console.log('remove handler');
}
});
});