CoreInput.js 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. function CoreInput() {
  2. }
  3. CoreInput.prototype.getMousePosition = function() {
  4. Polycode.CoreInput_getMousePosition(this.__ptr)
  5. }
  6. CoreInput.prototype.getKeyState = function(keyCode) {
  7. Polycode.CoreInput_getKeyState(this.__ptr, keyCode)
  8. }
  9. CoreInput.prototype.getJoystickButtonState = function(joystickIndex,button) {
  10. Polycode.CoreInput_getJoystickButtonState(this.__ptr, joystickIndex,button)
  11. }
  12. CoreInput.prototype.getJoystickAxisValue = function(joystickIndex,axis) {
  13. Polycode.CoreInput_getJoystickAxisValue(this.__ptr, joystickIndex,axis)
  14. }
  15. CoreInput.prototype.getMouseDelta = function() {
  16. Polycode.CoreInput_getMouseDelta(this.__ptr)
  17. }
  18. CoreInput.prototype.getMouseButtonState = function(mouseButton) {
  19. Polycode.CoreInput_getMouseButtonState(this.__ptr, mouseButton)
  20. }
  21. CoreInput.prototype.getNumJoysticks = function() {
  22. Polycode.CoreInput_getNumJoysticks(this.__ptr)
  23. }
  24. CoreInput.prototype.getJoystickInfoByIndex = function(index) {
  25. Polycode.CoreInput_getJoystickInfoByIndex(this.__ptr, index)
  26. }
  27. CoreInput.prototype.getJoystickInfoByID = function(deviceID) {
  28. Polycode.CoreInput_getJoystickInfoByID(this.__ptr, deviceID)
  29. }
  30. CoreInput.prototype.addJoystick = function(deviceID) {
  31. Polycode.CoreInput_addJoystick(this.__ptr, deviceID)
  32. }
  33. CoreInput.prototype.removeJoystick = function(deviceID) {
  34. Polycode.CoreInput_removeJoystick(this.__ptr, deviceID)
  35. }
  36. CoreInput.prototype.joystickAxisMoved = function(axisID,value,deviceID) {
  37. Polycode.CoreInput_joystickAxisMoved(this.__ptr, axisID,value,deviceID)
  38. }
  39. CoreInput.prototype.joystickButtonDown = function(buttonID,deviceID) {
  40. Polycode.CoreInput_joystickButtonDown(this.__ptr, buttonID,deviceID)
  41. }
  42. CoreInput.prototype.joystickButtonUp = function(buttonID,deviceID) {
  43. Polycode.CoreInput_joystickButtonUp(this.__ptr, buttonID,deviceID)
  44. }
  45. CoreInput.prototype.mouseWheelUp = function(ticks) {
  46. Polycode.CoreInput_mouseWheelUp(this.__ptr, ticks)
  47. }
  48. CoreInput.prototype.mouseWheelDown = function(ticks) {
  49. Polycode.CoreInput_mouseWheelDown(this.__ptr, ticks)
  50. }
  51. CoreInput.prototype.setMouseButtonState = function(mouseButton,state,ticks) {
  52. Polycode.CoreInput_setMouseButtonState(this.__ptr, mouseButton,state,ticks)
  53. }
  54. CoreInput.prototype.setMousePosition = function(x,y,ticks) {
  55. Polycode.CoreInput_setMousePosition(this.__ptr, x,y,ticks)
  56. }
  57. CoreInput.prototype.setKeyState = function(keyCode,code,newState,ticks) {
  58. Polycode.CoreInput_setKeyState(this.__ptr, keyCode,code,newState,ticks)
  59. }
  60. CoreInput.prototype.setDeltaPosition = function(x,y) {
  61. Polycode.CoreInput_setDeltaPosition(this.__ptr, x,y)
  62. }
  63. CoreInput.prototype.touchesBegan = function(touch,touches,ticks) {
  64. Polycode.CoreInput_touchesBegan(this.__ptr, touch,touches,ticks)
  65. }
  66. CoreInput.prototype.touchesMoved = function(touch,touches,ticks) {
  67. Polycode.CoreInput_touchesMoved(this.__ptr, touch,touches,ticks)
  68. }
  69. CoreInput.prototype.touchesEnded = function(touch,touches,ticks) {
  70. Polycode.CoreInput_touchesEnded(this.__ptr, touch,touches,ticks)
  71. }
  72. CoreInput.prototype.clearInput = function() {
  73. Polycode.CoreInput_clearInput(this.__ptr)
  74. }