src/js/libs/spiritual-gui.js
function(e) {
		var n = e.keyCode,
			c = this._keymap[n],
			b = gui.BROADCAST_KEYEVENT;
		var id = e.currentTarget.defaultView.gui.$contextid;

		/*
		// TODO: THIS!
		if ( e.ctrlKey && gui.Key.$key [ e.keyCode ] !== "Control" ) {
			e.preventDefault ();
		}
		*/

		switch (e.type) {
			case "keydown":
				if (c === undefined) {
					this._keycode = n;
					this._keymap[n] = null;
					this._keymap[n] = String.fromCharCode(e.which).toLowerCase();
					gui.Tick.next(function() {
						c = this._keymap[n];
						this._broadcast(true, null, c, n, id);
						this._keycode = null;
					}, this);
				}
				break;
			case "keypress":
				if (this._keycode) {
					c = this._keychar(e.keyCode, e.charCode, e.which);
					this._keymap[this._keycode] = c;
				}
				break;
			case "keyup":
				if (c !== undefined) {
					this._broadcast(false, null, c, n, id);
					delete this._keymap[n];
				}
				break;
		}
	}
function(e) {
		var n = e.keyCode,
			c = this._keymap[n],
			b = gui.BROADCAST_KEYEVENT;
		var id = e.currentTarget.defaultView.gui.$contextid;

		/*
		// TODO: THIS!
		if ( e.ctrlKey && gui.Key.$key [ e.keyCode ] !== "Control" ) {
			e.preventDefault ();
		}
		*/

		switch (e.type) {
			case "keydown":
				if (c === undefined) {
					this._keycode = n;
					this._keymap[n] = null;
					this._keymap[n] = String.fromCharCode(e.which).toLowerCase();
					gui.Tick.next(function() {
						c = this._keymap[n];
						this._broadcast(true, null, c, n, id);
						this._keycode = null;
					}, this);
				}
				break;
			case "keypress":
				if (this._keycode) {
					c = this._keychar(e.keyCode, e.charCode, e.which);
					this._keymap[this._keycode] = c;
				}
				break;
			case "keyup":
				if (c !== undefined) {
					this._broadcast(false, null, c, n, id);
					delete this._keymap[n];
				}
				break;
		}
	}
function ( e ) { var n = e . keyCode , c = this . _keymap [ n ] , b = gui . BROADCAST_KEYEVENT ; var id = e . currentTarget . defaultView . gui . $contextid ; /*
		// TODO: THIS!
		if ( e.ctrlKey && gui.Key.$key [ e.keyCode ] !== "Control" ) {
			e.preventDefault ();
		}
		*/ switch ( e . type ) { case "keydown" : if ( c === undefined ) { this . _keycode = n ; this . _keymap [ n ] = null ; this . _keymap [ n ] = String . fromCharCode ( e . which ) . toLowerCase ( ) ; gui . Tick . next ( function ( ) { c = this . _keymap [ n ] ; this . _broadcast ( true , null , c , n , id ) ; this . _keycode = null ; } , this ) ; } break ; case "keypress" : if ( this . _keycode ) { c = this . _keychar ( e . keyCode , e . charCode , e . which ) ; this . _keymap [ this . _keycode ] = c ; } break ; case "keyup" : if ( c !== undefined ) { this . _broadcast ( false , null , c , n , id ) ; delete this . _keymap [ n ] ; } break ; } }
Conan the Barbarian style events.
At least they suck in a known way.
@param {Event} e
Conan the Barbarian style events . At least they suck in a known way .