addAfterKeydownHandler

caph.focus.focusControllerProvider. 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 receive two parameters. The first parameter is an object which contains current focus controller's state including event object.

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

A boolean indicates whether success or not.

Type
boolean
Example
angular.module('myApp', ['caph.focus']).config(['focusControllerProvider', function(focusControllerProvider) {
 	focusControllerProvider.addAfterKeydownHandler(function(context, controller) {
 		console.log('after moving');
 	});
 }]);