API Docs for: 最后更新日期:2014年8月25日
Google搜索   
Show:

File: events/LKeyboardEvent.js

/** @language english
 * <p>A LMouseEvent object is dispatched into the event flow whenever mouse events occur. A mouse event is usually generated by a user input device, such as a mouse or a trackball, that uses a pointer.</p>
 * <p>In a mobile browser, MOUSE_DOWN, MOUSE_UP, MOUSE_MOVE are automatically converted to TOUCH_DOWN, TOUCH_UP, TOUCH_MOVE.</p>
 * @class LKeyboardEvent
 * @constructor
 * @since 1.0.0
 * @example
 * 	LInit(50, "legend", 800, 80, main);
 * 	function main () {
 * 		LGlobal.setDebug(true);
 * 		var title = new LTextField();
 * 		addChild(title);
 * 		title.text = "Click the keyboard, please!";
 * 		LGlobal.stage.addEventListener(LKeyboardEvent.KEY_DOWN,keydown);
 * 		//LEvent.addEventListener(window,LKeyboardEvent.KEY_DOWN,keydown);
 * 		LGlobal.stage.addEventListener(LKeyboardEvent.KEY_UP,keyup);
 * 		//LEvent.addEventListener(window,LKeyboardEvent.KEY_DOWN,keydown);
 * 		LGlobal.stage.addEventListener(LKeyboardEvent.KEY_PRESS,keypress);
 * 		//LEvent.addEventListener(window,LKeyboardEvent.KEY_PRESS,keypress);
 * 	}
 * 	function keydown (e) {
 * 		trace("keydown e.keyCode = " + e.keyCode);
 * 	}
 * 	function keyup (e) {
 * 		trace("keyup e.keyCode = " + e.keyCode);
 * 	}
 * 	function keypress (e) {
 * 		trace("keypress e.keyCode = " + e.keyCode);
 * 	}
 * @examplelink <p><a href="../../../api/LKeyboardEvent/index.html" target="_blank">Try it »</a></p>
 * @public
 */
var LKeyboardEvent = function () {throw "LKeyboardEvent cannot be instantiated";};
/** @language english
 * <p>[static] Defines the value of the type property of a keydown event object.</p>
 * <p>This event has the following properties:</p>
 * <table>
 * <tr><th>Property</th><th>Value</th></tr>
 * <tr><td>type</td><td>Returns the name of the event</td></tr>
 * <tr><td>keyCode</td><td>Returns the Unicode value of a non-character key in the keyboard event.</td></tr>
 * <tr><td>ctrlKey</td><td>Returns whether or not the "CTRL" key was pressed when an event was triggered</td></tr>
 * <tr><td>shiftKey</td><td>Returns whether or not the "SHIFT" key was pressed when an event was triggered</td></tr>
 * <tr><td>altKey</td><td>Returns whether or not the "ALT" key was pressed when an event was triggered</td></tr>
 * <tr><td>metaKey</td><td>Returns whether or not the "meta" key was pressed when an event was triggered</td></tr>
 * </table>
 * @property KEY_DOWN
 * @type String
 * @static
 * @since 1.0.0
 * @public
 */
LKeyboardEvent.KEY_DOWN = "keydown";
/** @language english
 * <p>[static] Defines the value of the type property of a keyup event object.</p>
 * <p>This event has the following properties:</p>
 * <table>
 * <tr><th>Property</th><th>Value</th></tr>
 * <tr><td>type</td><td>Returns the name of the event</td></tr>
 * <tr><td>keyCode</td><td>Returns the Unicode value of a non-character key in the keyboard event.</td></tr>
 * <tr><td>ctrlKey</td><td>Returns whether or not the "CTRL" key was pressed when an event was triggered</td></tr>
 * <tr><td>shiftKey</td><td>Returns whether or not the "SHIFT" key was pressed when an event was triggered</td></tr>
 * <tr><td>altKey</td><td>Returns whether or not the "ALT" key was pressed when an event was triggered</td></tr>
 * <tr><td>metaKey</td><td>Returns whether or not the "meta" key was pressed when an event was triggered</td></tr>
 * </table>
 * @property KEY_UP
 * @type String
 * @static
 * @since 1.0.0
 * @public
 */
LKeyboardEvent.KEY_UP = "keyup";
/** @language english
 * <p>[static] Defines the value of the type property of a keypress event object.</p>
 * <p>This event has the following properties:</p>
 * <table>
 * <tr><th>Property</th><th>Value</th></tr>
 * <tr><td>type</td><td>Returns the name of the event</td></tr>
 * <tr><td>keyCode</td><td>Returns the Unicode value of a non-character key in the keyboard event.</td></tr>
 * <tr><td>ctrlKey</td><td>Returns whether or not the "CTRL" key was pressed when an event was triggered</td></tr>
 * <tr><td>shiftKey</td><td>Returns whether or not the "SHIFT" key was pressed when an event was triggered</td></tr>
 * <tr><td>altKey</td><td>Returns whether or not the "ALT" key was pressed when an event was triggered</td></tr>
 * <tr><td>metaKey</td><td>Returns whether or not the "meta" key was pressed when an event was triggered</td></tr>
 * </table>
 * @property KEY_PRESS
 * @type String
 * @static
 * @since 1.0.0
 * @public
 */
LKeyboardEvent.KEY_PRESS = "keypress";