/* 
 * Function taken from TextCube. Original function name is 'processShortcut'
 * 
 */
function doTCKeyShortcut(event) {
	if(event.altKey || event.ctrlKey || event.metaKey)
		return;
	
	switch(event.target.nodeName) {
		case "INPUT":
		case "SELECT":
		case "TEXTAREA":
			return;
	}
	
	switch(event.keyCode) {
		case 81: // Q
			window.location=tcksBlogURL+"/wp-admin"; // Go to Dashboard page
			break;
		case 87: // W
			window.location=tcksBlogURL+"/wp-admin/post-new.php"; // Write new post
			break;
		case 69: // E
			if(tcksPostID)
				window.location=tcksBlogURL+"/wp-admin/post.php?action=edit&post="+tcksPostID; // Edit current post
			break;
		case 65: // A
			if(tcksPrevURL)
				window.location=tcksPrevURL; // Read previous post
			break;
		case 83: // S
			if(tcksNextURL)
				window.location=tcksNextURL; // Read next post
			break;
		case 74: // J
			window.scrollBy(0,100); // Scroll down page by 100 pixel
			break;
		case 75: // K
			window.scrollBy(0,-100); // Scroll up page by 100 pixel
			break;
		default:
			// Do nothing.
			break;
	}
}
