2
0

input.inc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. (*
  2. $Id: input.inc 25 2007-12-10 21:06:46Z p4p3r0 $
  3. ------------------------------------------------------------------------------
  4. Copyright (C) 2005
  5. Jason Rogers (dovoto)
  6. Dave Murphy (WinterMute)
  7. This software is provided 'as-is', without any express or implied
  8. warranty. In no event will the authors be held liable for any
  9. damages arising from the use of this software.
  10. Permission is granted to anyone to use this software for any
  11. purpose, including commercial applications, and to alter it and
  12. redistribute it freely, subject to the following restrictions:
  13. 1. The origin of this software must not be misrepresented; you
  14. must not claim that you wrote the original software. If you use
  15. this software in a product, an acknowledgment in the product
  16. documentation would be appreciated but is not required.
  17. 2. Altered source versions must be plainly marked as such, and
  18. must not be misrepresented as being the original software.
  19. 3. This notice may not be removed or altered from any source
  20. distribution.
  21. ------------------------------------------------------------------------------
  22. Conversion by Legolas (http://itaprogaming.free.fr) for freepascal compiler
  23. (http://www.freepascal.org)
  24. Copyright (C) 2006 Francesco Lombardi
  25. Check http://sourceforge.net/projects/libndsfpc for updates
  26. ------------------------------------------------------------------------------
  27. $Log$
  28. *)
  29. {$ifdef NDS_INTERFACE}
  30. // Keyboard
  31. type
  32. KEYPAD_BITS = cint;
  33. const
  34. //! Bit values for the keypad buttons.
  35. KEY_A : KEYPAD_BITS = (1 shl 0); // Keypad A button.
  36. KEY_B : KEYPAD_BITS = (1 shl 1); // Keypad B button.
  37. KEY_SELECT : KEYPAD_BITS = (1 shl 2); // Keypad SELECT button.
  38. KEY_START : KEYPAD_BITS = (1 shl 3); // Keypad START button.
  39. KEY_RIGHT : KEYPAD_BITS = (1 shl 4); // Keypad RIGHT button.
  40. KEY_LEFT : KEYPAD_BITS = (1 shl 5); // Keypad LEFT button.
  41. KEY_UP : KEYPAD_BITS = (1 shl 6); // Keypad UP button.
  42. KEY_DOWN : KEYPAD_BITS = (1 shl 7); // Keypad DOWN button.
  43. KEY_R : KEYPAD_BITS = (1 shl 8); // Right shoulder button.
  44. KEY_L : KEYPAD_BITS = (1 shl 9); // Left shoulder button.
  45. KEY_X : KEYPAD_BITS = (1 shl 10); // Keypad X button.
  46. KEY_Y : KEYPAD_BITS = (1 shl 11); // Keypad Y button.
  47. KEY_TOUCH : KEYPAD_BITS = (1 shl 12); // Touchscreen pendown.
  48. KEY_LID : KEYPAD_BITS = (1 shl 13); // Lid state.
  49. procedure scanKeys(); cdecl; external;
  50. function keysHeld(): cuint32; cdecl; external;
  51. function keysDown(): cuint32; cdecl; external;
  52. function keysDownRepeat(): cuint32; cdecl; external;
  53. procedure keysSetRepeat(setDelay: cuint8; setRepeat: cuint8); cdecl; external;
  54. function keysUp(): cuint32; cdecl; external;
  55. function touchReadXY(): touchPosition; cdecl; external;
  56. {$endif NDS_INTERFACE}