Runtime error calling Developer Console

I included the suggested code to be able to call the Developer Console when pressing control+D but I get the following error:

Uncaught JavaScript exception [_1 has no properties] in http://localhost:8080/HolaMundo/sc/modules/ISC_Core.js, line 750

Is there a specific place where I should put the code?

public class HolaMundo implements EntryPoint {

	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad() {
		
		 if (!GWT.isScript()) {
			    KeyIdentifier debugKey = new KeyIdentifier();
			    debugKey.setCtrlKey(true);
			    debugKey.setKeyName("D");

			    Page.registerKey(debugKey, new KeyCallback() {
			        public void execute(String keyName) {
			            SC.showConsole();
			        }
			    });
			}        		
		
		IButton button = new IButton("Hola Mundo");
		button.addClickHandler(new ClickHandler() {
							   public void onClick(ClickEvent event) {
							   SC.say("Hola Muno de parte de SmartGWT");
						        SC.logWarn("hola!!");
							   }
							   });
		
		button.draw();
		

	}

}

The error was before I did not have the Developer Console opened at the time

A related issue is that I was never able to open the console by pressing ctrl+d on Ubuntu…in Windows works fine.

public class HolaMundo implements EntryPoint {

	/**
	 * This is the entry point method.
	 */
	public void onModuleLoad() {
		
		 if (!GWT.isScript()) {
			    KeyIdentifier debugKey = new KeyIdentifier();
			    debugKey.setCtrlKey(true);
			    debugKey.setKeyName("D");

			    Page.registerKey(debugKey, new KeyCallback() {
			        public void execute(String keyName) {
			            SC.showConsole();
			        }
			    });
			}        		
		
		IButton button = new IButton("Hola Mundo");
		button.addClickHandler(new ClickHandler() {
							   public void onClick(ClickEvent event) {
							SC.showConsole();  
						        SC.logWarn("hola!!");
							   }
							   });
		
		button.draw();
		

	}

}