function onKeydown( event ) {
	const target = event.target;
	const modifier = event.ctrlKey
		|| event.altKey
		|| event.metaKey
		|| event.shiftKey && event.keyCode !== key.spacebar;

	if (
		// do nothing if using a modifier key (except shift)
		// or user is editing text
		// or in a dropdown
		   modifier
		|| event.defaultPrevented
		|| target.isContentEditable
		|| /INPUT|TEXTAREA|SELECT/.test( target.tagName )
		// spacebar should trigger button press
		|| target.tagName === "BUTTON" && event.keyCode === key.spacebar
	) {
		return true;
	}

	let damt;
	let x = 0;
	let y = 0;
	let elem = document.querySelector( "main.content" );
	let clientHeight = !elem || elem === document.body
		? window.innerHeight
		: elem.clientHeight;

	switch ( event.keyCode ) {
		case key.up:
			y = -options.arrowScroll;
			break;
		case key.down:
			y = options.arrowScroll;
			break;
		case key.spacebar:
			y = ( event.shiftKey ? -1 : 1 ) * clientHeight * 0.9;
			break;
		case key.pageup:
			y = -clientHeight * 0.9;
			break;
		case key.pagedown:
			y = clientHeight * 0.9;
			break;
		case key.home:
			y = -elem.scrollTop;
			break;
		case key.end:
			damt = elem.scrollHeight - elem.scrollTop - clientHeight;
			y = damt > 0 ? damt + 10 : 0;
			break;
		case key.left:
			x = -options.arrowScroll;
			break;
		case key.right:
			x = options.arrowScroll;
			break;
		default:
			return true;
	}

	scrollArray( elem, x, y );
	event.preventDefault();
}
Keydown event handler.
@param {KeyboardEvent} event