Home Reference Source

vgui/obj/20-key-code-typed-event.js

  1. "use strict";
  2.  
  3. Object.defineProperty(exports, "__esModule", {
  4. value: true
  5. });
  6.  
  7. var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
  8.  
  9. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  10.  
  11. function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
  12.  
  13. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
  14.  
  15. /**
  16. * Emitted when a key is pressed
  17. */
  18. var KeyCodeTypedEvent = exports.KeyCodeTypedEvent = function (_SourceEvent) {
  19. _inherits(KeyCodeTypedEvent, _SourceEvent);
  20.  
  21. function KeyCodeTypedEvent(code) {
  22. _classCallCheck(this, KeyCodeTypedEvent);
  23.  
  24. return _possibleConstructorReturn(this, (KeyCodeTypedEvent.__proto__ || Object.getPrototypeOf(KeyCodeTypedEvent)).call(this, "KeyCodeTyped", { code: code }));
  25. }
  26.  
  27. /**
  28. * Creates this type based on a source engine KeyValues entry
  29. */
  30.  
  31.  
  32. _createClass(KeyCodeTypedEvent, null, [{
  33. key: "__fromSource",
  34. value: function __fromSource(type, data) {
  35. var result = new KeyCodeTypedEvent();
  36. result.data = data;
  37. return result;
  38. }
  39. }]);
  40.  
  41. return KeyCodeTypedEvent;
  42. }(SourceEvent);
  43.  
  44. SourceEvent.__eventTypes["KeyCodeTyped"] = KeyCodeTypedEvent;