input_event.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. /**************************************************************************/
  2. /* input_event.h */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #ifndef INPUT_EVENT_H
  31. #define INPUT_EVENT_H
  32. #include "core/math/transform_2d.h"
  33. #include "core/resource.h"
  34. #include "core/typedefs.h"
  35. #include "core/ustring.h"
  36. /**
  37. * Input Event classes. These are used in the main loop.
  38. * The events are pretty obvious.
  39. */
  40. enum ButtonList {
  41. BUTTON_LEFT = 1,
  42. BUTTON_RIGHT = 2,
  43. BUTTON_MIDDLE = 3,
  44. BUTTON_WHEEL_UP = 4,
  45. BUTTON_WHEEL_DOWN = 5,
  46. BUTTON_WHEEL_LEFT = 6,
  47. BUTTON_WHEEL_RIGHT = 7,
  48. BUTTON_XBUTTON1 = 8,
  49. BUTTON_XBUTTON2 = 9,
  50. BUTTON_MASK_LEFT = (1 << (BUTTON_LEFT - 1)),
  51. BUTTON_MASK_RIGHT = (1 << (BUTTON_RIGHT - 1)),
  52. BUTTON_MASK_MIDDLE = (1 << (BUTTON_MIDDLE - 1)),
  53. BUTTON_MASK_XBUTTON1 = (1 << (BUTTON_XBUTTON1 - 1)),
  54. BUTTON_MASK_XBUTTON2 = (1 << (BUTTON_XBUTTON2 - 1))
  55. };
  56. enum JoystickList {
  57. JOY_INVALID_OPTION = -1,
  58. JOY_BUTTON_0 = 0,
  59. JOY_BUTTON_1 = 1,
  60. JOY_BUTTON_2 = 2,
  61. JOY_BUTTON_3 = 3,
  62. JOY_BUTTON_4 = 4,
  63. JOY_BUTTON_5 = 5,
  64. JOY_BUTTON_6 = 6,
  65. JOY_BUTTON_7 = 7,
  66. JOY_BUTTON_8 = 8,
  67. JOY_BUTTON_9 = 9,
  68. JOY_BUTTON_10 = 10,
  69. JOY_BUTTON_11 = 11,
  70. JOY_BUTTON_12 = 12,
  71. JOY_BUTTON_13 = 13,
  72. JOY_BUTTON_14 = 14,
  73. JOY_BUTTON_15 = 15,
  74. JOY_BUTTON_16 = 16,
  75. JOY_BUTTON_17 = 17,
  76. JOY_BUTTON_18 = 18,
  77. JOY_BUTTON_19 = 19,
  78. JOY_BUTTON_20 = 20,
  79. JOY_BUTTON_21 = 21,
  80. JOY_BUTTON_22 = 22,
  81. JOY_BUTTON_MAX = 128, // Android supports up to 36 buttons. DirectInput supports up to 128 buttons.
  82. JOY_L = JOY_BUTTON_4,
  83. JOY_R = JOY_BUTTON_5,
  84. JOY_L2 = JOY_BUTTON_6,
  85. JOY_R2 = JOY_BUTTON_7,
  86. JOY_L3 = JOY_BUTTON_8,
  87. JOY_R3 = JOY_BUTTON_9,
  88. JOY_SELECT = JOY_BUTTON_10,
  89. JOY_START = JOY_BUTTON_11,
  90. JOY_DPAD_UP = JOY_BUTTON_12,
  91. JOY_DPAD_DOWN = JOY_BUTTON_13,
  92. JOY_DPAD_LEFT = JOY_BUTTON_14,
  93. JOY_DPAD_RIGHT = JOY_BUTTON_15,
  94. JOY_GUIDE = JOY_BUTTON_16,
  95. JOY_MISC1 = JOY_BUTTON_17,
  96. JOY_PADDLE1 = JOY_BUTTON_18,
  97. JOY_PADDLE2 = JOY_BUTTON_19,
  98. JOY_PADDLE3 = JOY_BUTTON_20,
  99. JOY_PADDLE4 = JOY_BUTTON_21,
  100. JOY_TOUCHPAD = JOY_BUTTON_22,
  101. JOY_SONY_CIRCLE = JOY_BUTTON_1,
  102. JOY_SONY_X = JOY_BUTTON_0,
  103. JOY_SONY_SQUARE = JOY_BUTTON_2,
  104. JOY_SONY_TRIANGLE = JOY_BUTTON_3,
  105. JOY_XBOX_A = JOY_BUTTON_0,
  106. JOY_XBOX_B = JOY_BUTTON_1,
  107. JOY_XBOX_X = JOY_BUTTON_2,
  108. JOY_XBOX_Y = JOY_BUTTON_3,
  109. JOY_DS_A = JOY_BUTTON_1,
  110. JOY_DS_B = JOY_BUTTON_0,
  111. JOY_DS_X = JOY_BUTTON_3,
  112. JOY_DS_Y = JOY_BUTTON_2,
  113. JOY_WII_C = JOY_BUTTON_5,
  114. JOY_WII_Z = JOY_BUTTON_6,
  115. JOY_WII_MINUS = JOY_BUTTON_10,
  116. JOY_WII_PLUS = JOY_BUTTON_11,
  117. JOY_VR_GRIP = JOY_BUTTON_2,
  118. JOY_VR_PAD = JOY_BUTTON_14,
  119. JOY_VR_TRIGGER = JOY_BUTTON_15,
  120. JOY_OCULUS_AX = JOY_BUTTON_7,
  121. JOY_OCULUS_BY = JOY_BUTTON_1,
  122. JOY_OCULUS_MENU = JOY_BUTTON_3,
  123. JOY_OPENVR_MENU = JOY_BUTTON_1,
  124. // end of history
  125. JOY_AXIS_0 = 0,
  126. JOY_AXIS_1 = 1,
  127. JOY_AXIS_2 = 2,
  128. JOY_AXIS_3 = 3,
  129. JOY_AXIS_4 = 4,
  130. JOY_AXIS_5 = 5,
  131. JOY_AXIS_6 = 6,
  132. JOY_AXIS_7 = 7,
  133. JOY_AXIS_8 = 8,
  134. JOY_AXIS_9 = 9,
  135. JOY_AXIS_MAX = 10,
  136. JOY_ANALOG_LX = JOY_AXIS_0,
  137. JOY_ANALOG_LY = JOY_AXIS_1,
  138. JOY_ANALOG_RX = JOY_AXIS_2,
  139. JOY_ANALOG_RY = JOY_AXIS_3,
  140. JOY_ANALOG_L2 = JOY_AXIS_6,
  141. JOY_ANALOG_R2 = JOY_AXIS_7,
  142. JOY_VR_ANALOG_TRIGGER = JOY_AXIS_2,
  143. JOY_VR_ANALOG_GRIP = JOY_AXIS_4,
  144. JOY_OPENVR_TOUCHPADX = JOY_AXIS_0,
  145. JOY_OPENVR_TOUCHPADY = JOY_AXIS_1,
  146. };
  147. enum MidiMessageList {
  148. MIDI_MESSAGE_NOTE_OFF = 0x8,
  149. MIDI_MESSAGE_NOTE_ON = 0x9,
  150. MIDI_MESSAGE_AFTERTOUCH = 0xA,
  151. MIDI_MESSAGE_CONTROL_CHANGE = 0xB,
  152. MIDI_MESSAGE_PROGRAM_CHANGE = 0xC,
  153. MIDI_MESSAGE_CHANNEL_PRESSURE = 0xD,
  154. MIDI_MESSAGE_PITCH_BEND = 0xE,
  155. MIDI_MESSAGE_SYSTEM_EXCLUSIVE = 0xF0,
  156. MIDI_MESSAGE_QUARTER_FRAME = 0xF1,
  157. MIDI_MESSAGE_SONG_POSITION_POINTER = 0xF2,
  158. MIDI_MESSAGE_SONG_SELECT = 0xF3,
  159. MIDI_MESSAGE_TUNE_REQUEST = 0xF6,
  160. MIDI_MESSAGE_TIMING_CLOCK = 0xF8,
  161. MIDI_MESSAGE_START = 0xFA,
  162. MIDI_MESSAGE_CONTINUE = 0xFB,
  163. MIDI_MESSAGE_STOP = 0xFC,
  164. MIDI_MESSAGE_ACTIVE_SENSING = 0xFE,
  165. MIDI_MESSAGE_SYSTEM_RESET = 0xFF,
  166. };
  167. /**
  168. * Input Modifier Status
  169. * for keyboard/mouse events.
  170. */
  171. class InputEvent : public Resource {
  172. GDCLASS(InputEvent, Resource);
  173. int device;
  174. protected:
  175. bool canceled = false;
  176. bool pressed = false;
  177. static void _bind_methods();
  178. public:
  179. static const int DEVICE_ID_TOUCH_MOUSE;
  180. static const int DEVICE_ID_INTERNAL;
  181. void set_device(int p_device);
  182. int get_device() const;
  183. bool is_action(const StringName &p_action, bool p_exact_match = false) const;
  184. bool is_action_pressed(const StringName &p_action, bool p_allow_echo = false, bool p_exact_match = false) const;
  185. bool is_action_released(const StringName &p_action, bool p_exact_match = false) const;
  186. float get_action_strength(const StringName &p_action, bool p_exact_match = false) const;
  187. float get_action_raw_strength(const StringName &p_action, bool p_exact_match = false) const;
  188. bool is_canceled() const;
  189. bool is_pressed() const;
  190. bool is_released() const;
  191. virtual bool is_echo() const;
  192. // ...-.
  193. virtual String as_text() const;
  194. virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const;
  195. virtual bool action_match(const Ref<InputEvent> &p_event, bool p_exact_match, bool *p_pressed, float *p_strength, float *p_raw_strength, float p_deadzone) const;
  196. virtual bool shortcut_match(const Ref<InputEvent> &p_event, bool p_exact_match = true) const;
  197. virtual bool is_action_type() const;
  198. virtual bool accumulate(const Ref<InputEvent> &p_event) { return false; }
  199. InputEvent();
  200. };
  201. class InputEventWithModifiers : public InputEvent {
  202. GDCLASS(InputEventWithModifiers, InputEvent);
  203. bool shift;
  204. bool alt;
  205. #ifdef APPLE_STYLE_KEYS
  206. union {
  207. bool command;
  208. bool meta; //< windows/mac key
  209. };
  210. bool control;
  211. #else
  212. union {
  213. bool command; //< windows/mac key
  214. bool control;
  215. };
  216. bool meta; //< windows/mac key
  217. #endif
  218. protected:
  219. static void _bind_methods();
  220. public:
  221. void set_shift(bool p_enabled);
  222. bool get_shift() const;
  223. void set_alt(bool p_enabled);
  224. bool get_alt() const;
  225. void set_control(bool p_enabled);
  226. bool get_control() const;
  227. void set_metakey(bool p_enabled);
  228. bool get_metakey() const;
  229. void set_command(bool p_enabled);
  230. bool get_command() const;
  231. void set_modifiers_from_event(const InputEventWithModifiers *event);
  232. uint32_t get_modifiers_mask() const;
  233. InputEventWithModifiers();
  234. };
  235. class InputEventKey : public InputEventWithModifiers {
  236. GDCLASS(InputEventKey, InputEventWithModifiers);
  237. uint32_t scancode; ///< check keyboard.h , KeyCode enum, without modifier masks
  238. uint32_t physical_scancode;
  239. uint32_t unicode; ///unicode
  240. bool echo; /// true if this is an echo key
  241. protected:
  242. static void _bind_methods();
  243. public:
  244. void set_pressed(bool p_pressed);
  245. void set_scancode(uint32_t p_scancode);
  246. uint32_t get_scancode() const;
  247. void set_physical_scancode(uint32_t p_scancode);
  248. uint32_t get_physical_scancode() const;
  249. void set_unicode(uint32_t p_unicode);
  250. uint32_t get_unicode() const;
  251. void set_echo(bool p_enable);
  252. virtual bool is_echo() const;
  253. uint32_t get_scancode_with_modifiers() const;
  254. uint32_t get_physical_scancode_with_modifiers() const;
  255. virtual bool action_match(const Ref<InputEvent> &p_event, bool p_exact_match, bool *p_pressed, float *p_strength, float *p_raw_strength, float p_deadzone) const;
  256. virtual bool shortcut_match(const Ref<InputEvent> &p_event, bool p_exact_match = true) const;
  257. virtual bool is_action_type() const { return true; }
  258. virtual String as_text() const;
  259. InputEventKey();
  260. };
  261. class InputEventMouse : public InputEventWithModifiers {
  262. GDCLASS(InputEventMouse, InputEventWithModifiers);
  263. int button_mask;
  264. Vector2 pos;
  265. Vector2 global_pos;
  266. protected:
  267. static void _bind_methods();
  268. public:
  269. void set_button_mask(int p_mask);
  270. int get_button_mask() const;
  271. void set_position(const Vector2 &p_pos);
  272. Vector2 get_position() const;
  273. void set_global_position(const Vector2 &p_global_pos);
  274. Vector2 get_global_position() const;
  275. InputEventMouse();
  276. };
  277. class InputEventMouseButton : public InputEventMouse {
  278. GDCLASS(InputEventMouseButton, InputEventMouse);
  279. float factor;
  280. int button_index;
  281. bool doubleclick; //last even less than doubleclick time
  282. protected:
  283. static void _bind_methods();
  284. public:
  285. void set_factor(float p_factor);
  286. float get_factor() const;
  287. void set_button_index(int p_index);
  288. int get_button_index() const;
  289. void set_pressed(bool p_pressed);
  290. void set_canceled(bool p_canceled);
  291. void set_doubleclick(bool p_doubleclick);
  292. bool is_doubleclick() const;
  293. virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const;
  294. virtual bool action_match(const Ref<InputEvent> &p_event, bool p_exact_match, bool *p_pressed, float *p_strength, float *p_raw_strength, float p_deadzone) const;
  295. virtual bool shortcut_match(const Ref<InputEvent> &p_event, bool p_exact_match = true) const;
  296. virtual bool is_action_type() const { return true; }
  297. virtual String as_text() const;
  298. InputEventMouseButton();
  299. };
  300. class InputEventMouseMotion : public InputEventMouse {
  301. GDCLASS(InputEventMouseMotion, InputEventMouse);
  302. Vector2 tilt;
  303. float pressure;
  304. Vector2 relative;
  305. Vector2 speed;
  306. bool pen_inverted;
  307. protected:
  308. static void _bind_methods();
  309. public:
  310. void set_tilt(const Vector2 &p_tilt);
  311. Vector2 get_tilt() const;
  312. void set_pressure(float p_pressure);
  313. float get_pressure() const;
  314. void set_pen_inverted(bool p_inverted);
  315. bool get_pen_inverted() const;
  316. void set_relative(const Vector2 &p_relative);
  317. Vector2 get_relative() const;
  318. void set_speed(const Vector2 &p_speed);
  319. Vector2 get_speed() const;
  320. virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const;
  321. virtual String as_text() const;
  322. virtual bool accumulate(const Ref<InputEvent> &p_event);
  323. InputEventMouseMotion();
  324. };
  325. class InputEventJoypadMotion : public InputEvent {
  326. GDCLASS(InputEventJoypadMotion, InputEvent);
  327. int axis; ///< Joypad axis
  328. float axis_value; ///< -1 to 1
  329. protected:
  330. static void _bind_methods();
  331. public:
  332. void set_axis(int p_axis);
  333. int get_axis() const;
  334. void set_axis_value(float p_value);
  335. float get_axis_value() const;
  336. virtual bool action_match(const Ref<InputEvent> &p_event, bool p_exact_match, bool *p_pressed, float *p_strength, float *p_raw_strength, float p_deadzone) const;
  337. virtual bool shortcut_match(const Ref<InputEvent> &p_event, bool p_exact_match = true) const;
  338. virtual bool is_action_type() const { return true; }
  339. virtual String as_text() const;
  340. InputEventJoypadMotion();
  341. };
  342. class InputEventJoypadButton : public InputEvent {
  343. GDCLASS(InputEventJoypadButton, InputEvent);
  344. int button_index;
  345. float pressure; //0 to 1
  346. protected:
  347. static void _bind_methods();
  348. public:
  349. void set_button_index(int p_index);
  350. int get_button_index() const;
  351. void set_pressed(bool p_pressed);
  352. void set_pressure(float p_pressure);
  353. float get_pressure() const;
  354. virtual bool action_match(const Ref<InputEvent> &p_event, bool p_exact_match, bool *p_pressed, float *p_strength, float *p_raw_strength, float p_deadzone) const;
  355. virtual bool shortcut_match(const Ref<InputEvent> &p_event, bool p_exact_match = true) const;
  356. virtual bool is_action_type() const { return true; }
  357. virtual String as_text() const;
  358. InputEventJoypadButton();
  359. };
  360. class InputEventScreenTouch : public InputEvent {
  361. GDCLASS(InputEventScreenTouch, InputEvent);
  362. int index;
  363. Vector2 pos;
  364. bool double_tap;
  365. protected:
  366. static void _bind_methods();
  367. public:
  368. void set_index(int p_index);
  369. int get_index() const;
  370. void set_position(const Vector2 &p_pos);
  371. Vector2 get_position() const;
  372. void set_pressed(bool p_pressed);
  373. void set_canceled(bool p_canceled);
  374. void set_double_tap(bool p_double_tap);
  375. bool is_double_tap() const;
  376. virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const;
  377. virtual String as_text() const;
  378. InputEventScreenTouch();
  379. };
  380. class InputEventScreenDrag : public InputEvent {
  381. GDCLASS(InputEventScreenDrag, InputEvent);
  382. int index;
  383. Vector2 pos;
  384. Vector2 relative;
  385. Vector2 speed;
  386. protected:
  387. static void _bind_methods();
  388. public:
  389. void set_index(int p_index);
  390. int get_index() const;
  391. void set_position(const Vector2 &p_pos);
  392. Vector2 get_position() const;
  393. void set_relative(const Vector2 &p_relative);
  394. Vector2 get_relative() const;
  395. void set_speed(const Vector2 &p_speed);
  396. Vector2 get_speed() const;
  397. virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const;
  398. virtual String as_text() const;
  399. virtual bool accumulate(const Ref<InputEvent> &p_event);
  400. InputEventScreenDrag();
  401. };
  402. class InputEventAction : public InputEvent {
  403. GDCLASS(InputEventAction, InputEvent);
  404. StringName action;
  405. float strength;
  406. protected:
  407. static void _bind_methods();
  408. public:
  409. void set_action(const StringName &p_action);
  410. StringName get_action() const;
  411. void set_pressed(bool p_pressed);
  412. void set_strength(float p_strength);
  413. float get_strength() const;
  414. virtual bool is_action(const StringName &p_action) const;
  415. virtual bool action_match(const Ref<InputEvent> &p_event, bool p_exact_match, bool *p_pressed, float *p_strength, float *p_raw_strength, float p_deadzone) const;
  416. virtual bool shortcut_match(const Ref<InputEvent> &p_event, bool p_exact_match = true) const;
  417. virtual bool is_action_type() const { return true; }
  418. virtual String as_text() const;
  419. InputEventAction();
  420. };
  421. class InputEventGesture : public InputEventWithModifiers {
  422. GDCLASS(InputEventGesture, InputEventWithModifiers);
  423. Vector2 pos;
  424. protected:
  425. static void _bind_methods();
  426. public:
  427. void set_position(const Vector2 &p_pos);
  428. Vector2 get_position() const;
  429. };
  430. class InputEventMagnifyGesture : public InputEventGesture {
  431. GDCLASS(InputEventMagnifyGesture, InputEventGesture);
  432. real_t factor;
  433. protected:
  434. static void _bind_methods();
  435. public:
  436. void set_factor(real_t p_factor);
  437. real_t get_factor() const;
  438. virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const;
  439. virtual String as_text() const;
  440. InputEventMagnifyGesture();
  441. };
  442. class InputEventPanGesture : public InputEventGesture {
  443. GDCLASS(InputEventPanGesture, InputEventGesture);
  444. Vector2 delta;
  445. protected:
  446. static void _bind_methods();
  447. public:
  448. void set_delta(const Vector2 &p_delta);
  449. Vector2 get_delta() const;
  450. virtual Ref<InputEvent> xformed_by(const Transform2D &p_xform, const Vector2 &p_local_ofs = Vector2()) const;
  451. virtual String as_text() const;
  452. InputEventPanGesture();
  453. };
  454. class InputEventMIDI : public InputEvent {
  455. GDCLASS(InputEventMIDI, InputEvent);
  456. int channel;
  457. int message;
  458. int pitch;
  459. int velocity;
  460. int instrument;
  461. int pressure;
  462. int controller_number;
  463. int controller_value;
  464. protected:
  465. static void _bind_methods();
  466. public:
  467. void set_channel(const int p_channel);
  468. int get_channel() const;
  469. void set_message(const int p_message);
  470. int get_message() const;
  471. void set_pitch(const int p_pitch);
  472. int get_pitch() const;
  473. void set_velocity(const int p_velocity);
  474. int get_velocity() const;
  475. void set_instrument(const int p_instrument);
  476. int get_instrument() const;
  477. void set_pressure(const int p_pressure);
  478. int get_pressure() const;
  479. void set_controller_number(const int p_controller_number);
  480. int get_controller_number() const;
  481. void set_controller_value(const int p_controller_value);
  482. int get_controller_value() const;
  483. virtual String as_text() const;
  484. InputEventMIDI();
  485. };
  486. #endif // INPUT_EVENT_H