diff --git a/js/reveal.js b/js/reveal.js
index 962a7cdda74064038ff1299f099018c98e994c57..fe499ea661f34648b1dca154fffbc6e77e3e6356 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -44,6 +44,9 @@ var Reveal = (function(){
 			// Enable keyboard shortcuts for navigation
 			keyboard: true,
 
+			// Optional function that blocks keyboard events when retuning false
+			keyboardCondition: null,
+
 			// Enable the slide overview mode
 			overview: true,
 
@@ -2836,6 +2839,12 @@ var Reveal = (function(){
 	 */
 	function onDocumentKeyDown( event ) {
 
+		// If there's a condition specified and it returns false,
+		// ignore this event
+		if( typeof config.keyboardCondition === 'function' && config.keyboardCondition() === false ) {
+			return true;
+		}
+
 		// Remember if auto-sliding was paused so we can toggle it
 		var autoSlideWasPaused = autoSlidePaused;