| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- require('Polycode/Event')
- function InputEvent() {
- if(arguments[0] != "__skip_ptr__") {
- this.__ptr = Polycode.InputEvent()
- }
- Object.defineProperties(this, {
- 'mouseButton': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_mouseButton, set: InputEvent.prototype.__set_mouseButton},
- 'mousePosition': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_mousePosition, set: InputEvent.prototype.__set_mousePosition},
- 'key': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_key, set: InputEvent.prototype.__set_key},
- 'charCode': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_charCode, set: InputEvent.prototype.__set_charCode},
- 'timestamp': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_timestamp, set: InputEvent.prototype.__set_timestamp},
- 'touch': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_touch, set: InputEvent.prototype.__set_touch},
- 'touchType': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_touchType, set: InputEvent.prototype.__set_touchType},
- 'joystickDeviceID': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_joystickDeviceID, set: InputEvent.prototype.__set_joystickDeviceID},
- 'joystickAxisValue': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_joystickAxisValue, set: InputEvent.prototype.__set_joystickAxisValue},
- 'joystickButton': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_joystickButton, set: InputEvent.prototype.__set_joystickButton},
- 'joystickAxis': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_joystickAxis, set: InputEvent.prototype.__set_joystickAxis},
- 'joystickIndex': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_joystickIndex, set: InputEvent.prototype.__set_joystickIndex},
- 'hitDistance': { enumerable: true, configurable: true, get: InputEvent.prototype.__get_hitDistance, set: InputEvent.prototype.__set_hitDistance}
- })
- }
- InputEvent.prototype = Object.create(Event.prototype);
- InputEvent.prototype.__get_mouseButton = function() {
- return Polycode.InputEvent__get_mouseButton(this.__ptr)
- }
- InputEvent.prototype.__set_mouseButton = function(val) {
- Polycode.InputEvent__set_mouseButton(this.__ptr, val)
- }
- InputEvent.prototype.__get_mousePosition = function() {
- var retVal = new Vector2()
- retVal.__ptr = Polycode.InputEvent__get_mousePosition(this.__ptr)
- return retVal
- }
- InputEvent.prototype.__set_mousePosition = function(val) {
- Polycode.InputEvent__set_mousePosition(this.__ptr, val.__ptr)
- }
- InputEvent.prototype.__get_key = function() {
- return Polycode.InputEvent__get_key(this.__ptr)
- }
- InputEvent.prototype.__set_key = function(val) {
- Polycode.InputEvent__set_key(this.__ptr, val)
- }
- InputEvent.prototype.__get_charCode = function() {
- var retVal = new wchar_t()
- retVal.__ptr = Polycode.InputEvent__get_charCode(this.__ptr)
- return retVal
- }
- InputEvent.prototype.__set_charCode = function(val) {
- Polycode.InputEvent__set_charCode(this.__ptr, val.__ptr)
- }
- InputEvent.prototype.__get_timestamp = function() {
- return Polycode.InputEvent__get_timestamp(this.__ptr)
- }
- InputEvent.prototype.__set_timestamp = function(val) {
- Polycode.InputEvent__set_timestamp(this.__ptr, val)
- }
- InputEvent.prototype.__get_touch = function() {
- var retVal = new TouchInfo()
- retVal.__ptr = Polycode.InputEvent__get_touch(this.__ptr)
- return retVal
- }
- InputEvent.prototype.__set_touch = function(val) {
- Polycode.InputEvent__set_touch(this.__ptr, val.__ptr)
- }
- InputEvent.prototype.__get_touchType = function() {
- return Polycode.InputEvent__get_touchType(this.__ptr)
- }
- InputEvent.prototype.__set_touchType = function(val) {
- Polycode.InputEvent__set_touchType(this.__ptr, val)
- }
- InputEvent.prototype.__get_joystickDeviceID = function() {
- return Polycode.InputEvent__get_joystickDeviceID(this.__ptr)
- }
- InputEvent.prototype.__set_joystickDeviceID = function(val) {
- Polycode.InputEvent__set_joystickDeviceID(this.__ptr, val)
- }
- InputEvent.prototype.__get_joystickAxisValue = function() {
- return Polycode.InputEvent__get_joystickAxisValue(this.__ptr)
- }
- InputEvent.prototype.__set_joystickAxisValue = function(val) {
- Polycode.InputEvent__set_joystickAxisValue(this.__ptr, val)
- }
- InputEvent.prototype.__get_joystickButton = function() {
- return Polycode.InputEvent__get_joystickButton(this.__ptr)
- }
- InputEvent.prototype.__set_joystickButton = function(val) {
- Polycode.InputEvent__set_joystickButton(this.__ptr, val)
- }
- InputEvent.prototype.__get_joystickAxis = function() {
- return Polycode.InputEvent__get_joystickAxis(this.__ptr)
- }
- InputEvent.prototype.__set_joystickAxis = function(val) {
- Polycode.InputEvent__set_joystickAxis(this.__ptr, val)
- }
- InputEvent.prototype.__get_joystickIndex = function() {
- return Polycode.InputEvent__get_joystickIndex(this.__ptr)
- }
- InputEvent.prototype.__set_joystickIndex = function(val) {
- Polycode.InputEvent__set_joystickIndex(this.__ptr, val)
- }
- InputEvent.prototype.__get_hitDistance = function() {
- return Polycode.InputEvent__get_hitDistance(this.__ptr)
- }
- InputEvent.prototype.__set_hitDistance = function(val) {
- Polycode.InputEvent__set_hitDistance(this.__ptr, val)
- }
- Duktape.fin(InputEvent.prototype, function (x) {
- if (x === InputEvent.prototype) {
- return;
- }
- Polycode.InputEvent__delete(x.__ptr)
- })
- InputEvent.prototype.getMousePosition = function() {
- var retVal = new Vector2()
- retVal.__ptr = Polycode.InputEvent_getMousePosition(this.__ptr)
- return retVal
- }
- InputEvent.prototype.getKey = function() {
- return Polycode.InputEvent_getKey(this.__ptr)
- }
- InputEvent.prototype.getMouseButton = function() {
- return Polycode.InputEvent_getMouseButton(this.__ptr)
- }
- InputEvent.prototype.getCharCode = function() {
- var retVal = new wchar_t()
- retVal.__ptr = Polycode.InputEvent_getCharCode(this.__ptr)
- return retVal
- }
- InputEvent.prototype.keyCode = function() {
- return Polycode.InputEvent_keyCode(this.__ptr)
- }
|