addAfterKeydownHandler

jQuery.caph.focus.controllerProvider. addAfterKeydownHandler

Adds a function to be called after key input processing. These functions are always invoked unless one of the before handlers returns false.

(static) addAfterKeydownHandler(handler) → {boolean}

Parameters:
Name Type Description
handler function

A function to be called after key input processing. This function can take two parameters. The first parameter is an object which contains current controller's state including pressed key information.

  • event: The current event object.
  • previousFocusedItem: The previous focused item.
  • currentFocusItem: The current focus item. The second parameter is controller itself.
Returns:

A boolean indicates whether success or not.

Type
boolean
Example
$(document).ready(function() {
 	$.caph.focus.init(function(nearestFocusableFinderProvider, controllerProvider) {
 		controllerProvider.addAfterKeydownHandler(function(context, controller) {
 			console.log('after moving');
			});
 	});
 });