すくすくゴートうちゃん Android 版(黒歴史)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

keyboard.mod.hsp 1.0 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #include "./modules/char.mod.hsp"
  2. #ifndef __KEYBOARD__
  3. #define __KEYBOARD__
  4. #module \
  5. Keyboard
  6. #deffunc local \
  7. Show
  8. showing = True
  9. text = ""
  10. Return
  11. #deffunc local \
  12. Hide
  13. showing = False
  14. Return
  15. #deffunc local \
  16. GetChar
  17. if showing = False {
  18. Return
  19. }
  20. MTList getChar_id
  21. If stat = 0 {
  22. touching = False
  23. Return
  24. }
  25. If touching {
  26. Return
  27. }
  28. MTInfo getChar_touchInfo, getChar_id.0
  29. touching = True
  30. If Length (getChar_touchInfo) < 4 {
  31. Return
  32. }
  33. If getChar_touchInfo.2 < 1920 - 480 {
  34. Return
  35. }
  36. getChar_charId = (1080 - getChar_touchInfo.1) / 96 * 5 + (getChar_touchInfo.2 - (1920 - 480)) / 96
  37. getChar_textLength = StrLen (text)
  38. Repeat 3
  39. Poke text, getChar_textLength + cnt, Peek (charDict@Char, getChar_charId * 3 + cnt)
  40. Loop
  41. Return
  42. #deffunc local \
  43. Draw
  44. If showing = False {
  45. Return
  46. }
  47. Color COLOUR_BLACK
  48. BoxF 0, 1920 - 480, 1080, 1920
  49. Repeat 50
  50. Pos 1080 - 96 * (cnt / 5 + 1), 1920 - 480 + 96 * (cnt \ 5)
  51. CelPut BUFFER_CHAR, cnt, 3, 3
  52. Loop
  53. Return
  54. #global
  55. #endif ; not __KEYBOARD__