InputEvent.js 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. function InputEvent() {
  2. Object.defineProperties(this, {
  3. 'mouseButton': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_mouseButton, set: InputEvent.prototype.__set_mouseButton},
  4. 'mousePosition': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_mousePosition, set: InputEvent.prototype.__set_mousePosition},
  5. 'key': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_key, set: InputEvent.prototype.__set_key},
  6. 'charCode': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_charCode, set: InputEvent.prototype.__set_charCode},
  7. 'timestamp': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_timestamp, set: InputEvent.prototype.__set_timestamp},
  8. 'touch': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_touch, set: InputEvent.prototype.__set_touch},
  9. 'touchType': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_touchType, set: InputEvent.prototype.__set_touchType},
  10. 'joystickDeviceID': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_joystickDeviceID, set: InputEvent.prototype.__set_joystickDeviceID},
  11. 'joystickAxisValue': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_joystickAxisValue, set: InputEvent.prototype.__set_joystickAxisValue},
  12. 'joystickButton': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_joystickButton, set: InputEvent.prototype.__set_joystickButton},
  13. 'joystickAxis': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_joystickAxis, set: InputEvent.prototype.__set_joystickAxis},
  14. 'joystickIndex': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_joystickIndex, set: InputEvent.prototype.__set_joystickIndex},
  15. 'hitDistance': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_hitDistance, set: InputEvent.prototype.__set_hitDistance}
  16. })
  17. }
  18. InputEvent.prototype.__get_mouseButton = function() {
  19. return Polycode.InputEvent__get_mouseButton(this.__ptr)
  20. }
  21. InputEvent.prototype.__set_mouseButton = function(val) {
  22. Polycode.InputEvent__set_mouseButton(this.__ptr, val)
  23. }
  24. InputEvent.prototype.__get_mousePosition = function() {
  25. var retVal = new Vector2()
  26. retVal.__ptr = Polycode.InputEvent__get_mousePosition(this.__ptr)
  27. return retVal
  28. }
  29. InputEvent.prototype.__set_mousePosition = function(val) {
  30. Polycode.InputEvent__set_mousePosition(this.__ptr, val.__ptr)
  31. }
  32. InputEvent.prototype.__get_key = function() {
  33. return Polycode.InputEvent__get_key(this.__ptr)
  34. }
  35. InputEvent.prototype.__set_key = function(val) {
  36. Polycode.InputEvent__set_key(this.__ptr, val)
  37. }
  38. InputEvent.prototype.__get_charCode = function() {
  39. var retVal = new wchar_t()
  40. retVal.__ptr = Polycode.InputEvent__get_charCode(this.__ptr)
  41. return retVal
  42. }
  43. InputEvent.prototype.__set_charCode = function(val) {
  44. Polycode.InputEvent__set_charCode(this.__ptr, val.__ptr)
  45. }
  46. InputEvent.prototype.__get_timestamp = function() {
  47. return Polycode.InputEvent__get_timestamp(this.__ptr)
  48. }
  49. InputEvent.prototype.__set_timestamp = function(val) {
  50. Polycode.InputEvent__set_timestamp(this.__ptr, val)
  51. }
  52. InputEvent.prototype.__get_touch = function() {
  53. var retVal = new TouchInfo()
  54. retVal.__ptr = Polycode.InputEvent__get_touch(this.__ptr)
  55. return retVal
  56. }
  57. InputEvent.prototype.__set_touch = function(val) {
  58. Polycode.InputEvent__set_touch(this.__ptr, val.__ptr)
  59. }
  60. InputEvent.prototype.__get_touchType = function() {
  61. return Polycode.InputEvent__get_touchType(this.__ptr)
  62. }
  63. InputEvent.prototype.__set_touchType = function(val) {
  64. Polycode.InputEvent__set_touchType(this.__ptr, val)
  65. }
  66. InputEvent.prototype.__get_joystickDeviceID = function() {
  67. return Polycode.InputEvent__get_joystickDeviceID(this.__ptr)
  68. }
  69. InputEvent.prototype.__set_joystickDeviceID = function(val) {
  70. Polycode.InputEvent__set_joystickDeviceID(this.__ptr, val)
  71. }
  72. InputEvent.prototype.__get_joystickAxisValue = function() {
  73. return Polycode.InputEvent__get_joystickAxisValue(this.__ptr)
  74. }
  75. InputEvent.prototype.__set_joystickAxisValue = function(val) {
  76. Polycode.InputEvent__set_joystickAxisValue(this.__ptr, val)
  77. }
  78. InputEvent.prototype.__get_joystickButton = function() {
  79. return Polycode.InputEvent__get_joystickButton(this.__ptr)
  80. }
  81. InputEvent.prototype.__set_joystickButton = function(val) {
  82. Polycode.InputEvent__set_joystickButton(this.__ptr, val)
  83. }
  84. InputEvent.prototype.__get_joystickAxis = function() {
  85. return Polycode.InputEvent__get_joystickAxis(this.__ptr)
  86. }
  87. InputEvent.prototype.__set_joystickAxis = function(val) {
  88. Polycode.InputEvent__set_joystickAxis(this.__ptr, val)
  89. }
  90. InputEvent.prototype.__get_joystickIndex = function() {
  91. return Polycode.InputEvent__get_joystickIndex(this.__ptr)
  92. }
  93. InputEvent.prototype.__set_joystickIndex = function(val) {
  94. Polycode.InputEvent__set_joystickIndex(this.__ptr, val)
  95. }
  96. InputEvent.prototype.__get_hitDistance = function() {
  97. return Polycode.InputEvent__get_hitDistance(this.__ptr)
  98. }
  99. InputEvent.prototype.__set_hitDistance = function(val) {
  100. Polycode.InputEvent__set_hitDistance(this.__ptr, val)
  101. }
  102. InputEvent.prototype.getMousePosition = function() {
  103. var retVal = new Vector2()
  104. retVal.__ptr = Polycode.InputEvent_getMousePosition(this.__ptr)
  105. return retVal
  106. }
  107. InputEvent.prototype.getKey = function() {
  108. return Polycode.InputEvent_getKey(this.__ptr)
  109. }
  110. InputEvent.prototype.getMouseButton = function() {
  111. return Polycode.InputEvent_getMouseButton(this.__ptr)
  112. }
  113. InputEvent.prototype.getCharCode = function() {
  114. var retVal = new wchar_t()
  115. retVal.__ptr = Polycode.InputEvent_getCharCode(this.__ptr)
  116. return retVal
  117. }
  118. InputEvent.prototype.keyCode = function() {
  119. return Polycode.InputEvent_keyCode(this.__ptr)
  120. }