curses 1.4.4 → 1.4.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (258) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +6 -0
  3. data/.github/workflows/macos.yml +1 -1
  4. data/.github/workflows/push_gem.yml +48 -0
  5. data/.github/workflows/ubuntu.yml +2 -2
  6. data/.github/workflows/windows.yml +2 -2
  7. data/History.md +23 -0
  8. data/README.md +7 -0
  9. data/curses.gemspec +1 -1
  10. data/ext/curses/curses.c +7 -7
  11. data/sample/colors.rb +6 -1
  12. data/sample/form.rb +1 -1
  13. data/sample/menu.rb +2 -0
  14. metadata +9 -251
  15. data/vendor/PDCurses/.gitignore +0 -47
  16. data/vendor/PDCurses/.travis.yml +0 -49
  17. data/vendor/PDCurses/CMakeLists.txt +0 -68
  18. data/vendor/PDCurses/HISTORY.md +0 -2036
  19. data/vendor/PDCurses/IMPLEMNT.md +0 -327
  20. data/vendor/PDCurses/Makefile +0 -27
  21. data/vendor/PDCurses/README.md +0 -77
  22. data/vendor/PDCurses/acs_defs.h +0 -265
  23. data/vendor/PDCurses/appveyor.yml +0 -218
  24. data/vendor/PDCurses/cmake/README.md +0 -71
  25. data/vendor/PDCurses/cmake/build_dependencies.cmake +0 -178
  26. data/vendor/PDCurses/cmake/build_options.cmake +0 -25
  27. data/vendor/PDCurses/cmake/dll_version.cmake +0 -26
  28. data/vendor/PDCurses/cmake/gen_config_header.cmake +0 -43
  29. data/vendor/PDCurses/cmake/get_version.cmake +0 -17
  30. data/vendor/PDCurses/cmake/make_uninstall.cmake +0 -19
  31. data/vendor/PDCurses/cmake/project_common.cmake +0 -121
  32. data/vendor/PDCurses/cmake/resource.in.cmake +0 -52
  33. data/vendor/PDCurses/cmake/sdl2_ttf/CMakeLists.txt +0 -83
  34. data/vendor/PDCurses/cmake/target_arch.cmake +0 -36
  35. data/vendor/PDCurses/cmake/version.in.cmake +0 -73
  36. data/vendor/PDCurses/cmake/watcom_open_dos16_toolchain.cmake +0 -96
  37. data/vendor/PDCurses/cmake/watcom_open_dos32_toolchain.cmake +0 -106
  38. data/vendor/PDCurses/cmake/watcom_open_os2v2_toolchain.cmake +0 -105
  39. data/vendor/PDCurses/curses.h +0 -1846
  40. data/vendor/PDCurses/curspriv.h +0 -134
  41. data/vendor/PDCurses/demos/README.md +0 -25
  42. data/vendor/PDCurses/demos/firework.c +0 -144
  43. data/vendor/PDCurses/demos/newtest.c +0 -581
  44. data/vendor/PDCurses/demos/ozdemo.c +0 -447
  45. data/vendor/PDCurses/demos/ptest.c +0 -283
  46. data/vendor/PDCurses/demos/rain.c +0 -157
  47. data/vendor/PDCurses/demos/testcurs.c +0 -1607
  48. data/vendor/PDCurses/demos/tui.c +0 -1048
  49. data/vendor/PDCurses/demos/tui.h +0 -65
  50. data/vendor/PDCurses/demos/tuidemo.c +0 -233
  51. data/vendor/PDCurses/demos/version.c +0 -61
  52. data/vendor/PDCurses/demos/worm.c +0 -432
  53. data/vendor/PDCurses/demos/xmas.c +0 -955
  54. data/vendor/PDCurses/dos/CMakeLists.txt +0 -47
  55. data/vendor/PDCurses/dos/Makefile +0 -105
  56. data/vendor/PDCurses/dos/Makefile.bcc +0 -83
  57. data/vendor/PDCurses/dos/Makefile.dmc +0 -257
  58. data/vendor/PDCurses/dos/Makefile.msc +0 -113
  59. data/vendor/PDCurses/dos/Makefile.wcc +0 -107
  60. data/vendor/PDCurses/dos/README.md +0 -51
  61. data/vendor/PDCurses/dos/bccdos.lrf +0 -9
  62. data/vendor/PDCurses/dos/mscdos.lrf +0 -50
  63. data/vendor/PDCurses/dos/pdcclip.c +0 -132
  64. data/vendor/PDCurses/dos/pdcdisp.c +0 -135
  65. data/vendor/PDCurses/dos/pdcdos.h +0 -194
  66. data/vendor/PDCurses/dos/pdcgetsc.c +0 -98
  67. data/vendor/PDCurses/dos/pdckbd.c +0 -513
  68. data/vendor/PDCurses/dos/pdcscrn.c +0 -785
  69. data/vendor/PDCurses/dos/pdcsetsc.c +0 -101
  70. data/vendor/PDCurses/dos/pdcutil.c +0 -212
  71. data/vendor/PDCurses/libobjs.mif +0 -26
  72. data/vendor/PDCurses/makedist.mif +0 -20
  73. data/vendor/PDCurses/man/Makefile +0 -37
  74. data/vendor/PDCurses/man/README.md +0 -21
  75. data/vendor/PDCurses/man/intro.md +0 -361
  76. data/vendor/PDCurses/man/manext.c +0 -119
  77. data/vendor/PDCurses/man/sdl.md +0 -152
  78. data/vendor/PDCurses/man/sdl2.md +0 -58
  79. data/vendor/PDCurses/man/x11.md +0 -407
  80. data/vendor/PDCurses/ncurses/CMakeLists.txt +0 -66
  81. data/vendor/PDCurses/ncurses/README.md +0 -26
  82. data/vendor/PDCurses/ncurses/makefile +0 -29
  83. data/vendor/PDCurses/os2/CMakeLists.txt +0 -41
  84. data/vendor/PDCurses/os2/Makefile +0 -132
  85. data/vendor/PDCurses/os2/Makefile.bcc +0 -90
  86. data/vendor/PDCurses/os2/Makefile.wcc +0 -43
  87. data/vendor/PDCurses/os2/README.md +0 -43
  88. data/vendor/PDCurses/os2/iccos2.lrf +0 -50
  89. data/vendor/PDCurses/os2/iccos2.mak +0 -256
  90. data/vendor/PDCurses/os2/pdcclip.c +0 -188
  91. data/vendor/PDCurses/os2/pdcdisp.c +0 -93
  92. data/vendor/PDCurses/os2/pdcgetsc.c +0 -89
  93. data/vendor/PDCurses/os2/pdckbd.c +0 -521
  94. data/vendor/PDCurses/os2/pdcos2.h +0 -55
  95. data/vendor/PDCurses/os2/pdcscrn.c +0 -449
  96. data/vendor/PDCurses/os2/pdcsetsc.c +0 -112
  97. data/vendor/PDCurses/os2/pdcutil.c +0 -52
  98. data/vendor/PDCurses/panel.h +0 -56
  99. data/vendor/PDCurses/pdcurses/README.md +0 -25
  100. data/vendor/PDCurses/pdcurses/addch.c +0 -693
  101. data/vendor/PDCurses/pdcurses/addchstr.c +0 -245
  102. data/vendor/PDCurses/pdcurses/addstr.c +0 -240
  103. data/vendor/PDCurses/pdcurses/attr.c +0 -359
  104. data/vendor/PDCurses/pdcurses/beep.c +0 -68
  105. data/vendor/PDCurses/pdcurses/bkgd.c +0 -223
  106. data/vendor/PDCurses/pdcurses/border.c +0 -411
  107. data/vendor/PDCurses/pdcurses/clear.c +0 -159
  108. data/vendor/PDCurses/pdcurses/color.c +0 -298
  109. data/vendor/PDCurses/pdcurses/debug.c +0 -109
  110. data/vendor/PDCurses/pdcurses/delch.c +0 -96
  111. data/vendor/PDCurses/pdcurses/deleteln.c +0 -211
  112. data/vendor/PDCurses/pdcurses/deprec.c +0 -27
  113. data/vendor/PDCurses/pdcurses/getch.c +0 -417
  114. data/vendor/PDCurses/pdcurses/getstr.c +0 -474
  115. data/vendor/PDCurses/pdcurses/getyx.c +0 -139
  116. data/vendor/PDCurses/pdcurses/inch.c +0 -127
  117. data/vendor/PDCurses/pdcurses/inchstr.c +0 -214
  118. data/vendor/PDCurses/pdcurses/initscr.c +0 -367
  119. data/vendor/PDCurses/pdcurses/inopts.c +0 -324
  120. data/vendor/PDCurses/pdcurses/insch.c +0 -271
  121. data/vendor/PDCurses/pdcurses/insstr.c +0 -264
  122. data/vendor/PDCurses/pdcurses/instr.c +0 -246
  123. data/vendor/PDCurses/pdcurses/kernel.c +0 -259
  124. data/vendor/PDCurses/pdcurses/keyname.c +0 -157
  125. data/vendor/PDCurses/pdcurses/mouse.c +0 -438
  126. data/vendor/PDCurses/pdcurses/move.c +0 -57
  127. data/vendor/PDCurses/pdcurses/outopts.c +0 -159
  128. data/vendor/PDCurses/pdcurses/overlay.c +0 -214
  129. data/vendor/PDCurses/pdcurses/pad.c +0 -260
  130. data/vendor/PDCurses/pdcurses/panel.c +0 -633
  131. data/vendor/PDCurses/pdcurses/printw.c +0 -126
  132. data/vendor/PDCurses/pdcurses/refresh.c +0 -279
  133. data/vendor/PDCurses/pdcurses/scanw.c +0 -578
  134. data/vendor/PDCurses/pdcurses/scr_dump.c +0 -213
  135. data/vendor/PDCurses/pdcurses/scroll.c +0 -101
  136. data/vendor/PDCurses/pdcurses/slk.c +0 -591
  137. data/vendor/PDCurses/pdcurses/termattr.c +0 -182
  138. data/vendor/PDCurses/pdcurses/terminfo.c +0 -217
  139. data/vendor/PDCurses/pdcurses/touch.c +0 -163
  140. data/vendor/PDCurses/pdcurses/util.c +0 -312
  141. data/vendor/PDCurses/pdcurses/window.c +0 -569
  142. data/vendor/PDCurses/sdl1/Makefile +0 -129
  143. data/vendor/PDCurses/sdl1/Makefile.mng +0 -110
  144. data/vendor/PDCurses/sdl1/README.md +0 -31
  145. data/vendor/PDCurses/sdl1/deffont.h +0 -385
  146. data/vendor/PDCurses/sdl1/deficon.h +0 -23
  147. data/vendor/PDCurses/sdl1/pdcclip.c +0 -131
  148. data/vendor/PDCurses/sdl1/pdcdisp.c +0 -373
  149. data/vendor/PDCurses/sdl1/pdcgetsc.c +0 -30
  150. data/vendor/PDCurses/sdl1/pdckbd.c +0 -405
  151. data/vendor/PDCurses/sdl1/pdcscrn.c +0 -414
  152. data/vendor/PDCurses/sdl1/pdcsdl.h +0 -31
  153. data/vendor/PDCurses/sdl1/pdcsetsc.c +0 -64
  154. data/vendor/PDCurses/sdl1/pdcutil.c +0 -40
  155. data/vendor/PDCurses/sdl1/sdltest.c +0 -79
  156. data/vendor/PDCurses/sdl2/CMakeLists.txt +0 -76
  157. data/vendor/PDCurses/sdl2/Makefile +0 -135
  158. data/vendor/PDCurses/sdl2/Makefile.vc +0 -164
  159. data/vendor/PDCurses/sdl2/README.md +0 -34
  160. data/vendor/PDCurses/sdl2/deffont.h +0 -385
  161. data/vendor/PDCurses/sdl2/deficon.h +0 -23
  162. data/vendor/PDCurses/sdl2/pdcclip.c +0 -93
  163. data/vendor/PDCurses/sdl2/pdcdisp.c +0 -534
  164. data/vendor/PDCurses/sdl2/pdcgetsc.c +0 -30
  165. data/vendor/PDCurses/sdl2/pdckbd.c +0 -480
  166. data/vendor/PDCurses/sdl2/pdcscrn.c +0 -443
  167. data/vendor/PDCurses/sdl2/pdcsdl.h +0 -33
  168. data/vendor/PDCurses/sdl2/pdcsetsc.c +0 -67
  169. data/vendor/PDCurses/sdl2/pdcutil.c +0 -39
  170. data/vendor/PDCurses/sdl2/sdltest.c +0 -81
  171. data/vendor/PDCurses/term.h +0 -48
  172. data/vendor/PDCurses/version.mif +0 -7
  173. data/vendor/PDCurses/vt/CMakeLists.txt +0 -28
  174. data/vendor/PDCurses/vt/Makefile +0 -135
  175. data/vendor/PDCurses/vt/Makefile.bcc +0 -111
  176. data/vendor/PDCurses/vt/Makefile.dmc +0 -258
  177. data/vendor/PDCurses/vt/Makefile.vc +0 -144
  178. data/vendor/PDCurses/vt/Makefile.wcc +0 -107
  179. data/vendor/PDCurses/vt/README.md +0 -64
  180. data/vendor/PDCurses/vt/pdcclip.c +0 -20
  181. data/vendor/PDCurses/vt/pdcdisp.c +0 -284
  182. data/vendor/PDCurses/vt/pdcgetsc.c +0 -27
  183. data/vendor/PDCurses/vt/pdckbd.c +0 -394
  184. data/vendor/PDCurses/vt/pdcscrn.c +0 -434
  185. data/vendor/PDCurses/vt/pdcsetsc.c +0 -45
  186. data/vendor/PDCurses/vt/pdcutil.c +0 -43
  187. data/vendor/PDCurses/vt/pdcvt.h +0 -16
  188. data/vendor/PDCurses/watcom.mif +0 -68
  189. data/vendor/PDCurses/wincon/CMakeLists.txt +0 -27
  190. data/vendor/PDCurses/wincon/Makefile.bcc +0 -88
  191. data/vendor/PDCurses/wincon/Makefile.dmc +0 -256
  192. data/vendor/PDCurses/wincon/Makefile.lcc +0 -273
  193. data/vendor/PDCurses/wincon/Makefile.mng +0 -176
  194. data/vendor/PDCurses/wincon/Makefile.vc +0 -144
  195. data/vendor/PDCurses/wincon/Makefile.wcc +0 -51
  196. data/vendor/PDCurses/wincon/README.md +0 -85
  197. data/vendor/PDCurses/wincon/pdcclip.c +0 -174
  198. data/vendor/PDCurses/wincon/pdcdisp.c +0 -143
  199. data/vendor/PDCurses/wincon/pdcgetsc.c +0 -55
  200. data/vendor/PDCurses/wincon/pdckbd.c +0 -786
  201. data/vendor/PDCurses/wincon/pdcscrn.c +0 -717
  202. data/vendor/PDCurses/wincon/pdcsetsc.c +0 -91
  203. data/vendor/PDCurses/wincon/pdcurses.ico +0 -0
  204. data/vendor/PDCurses/wincon/pdcurses.rc +0 -28
  205. data/vendor/PDCurses/wincon/pdcutil.c +0 -41
  206. data/vendor/PDCurses/wincon/pdcwin.h +0 -31
  207. data/vendor/PDCurses/wingui/CMakeLists.txt +0 -27
  208. data/vendor/PDCurses/wingui/Makefile.bcc +0 -85
  209. data/vendor/PDCurses/wingui/Makefile.dmc +0 -259
  210. data/vendor/PDCurses/wingui/Makefile.lcc +0 -273
  211. data/vendor/PDCurses/wingui/Makefile.mng +0 -171
  212. data/vendor/PDCurses/wingui/Makefile.vc +0 -144
  213. data/vendor/PDCurses/wingui/Makefile.wcc +0 -51
  214. data/vendor/PDCurses/wingui/README.md +0 -93
  215. data/vendor/PDCurses/wingui/pdcclip.c +0 -174
  216. data/vendor/PDCurses/wingui/pdcdisp.c +0 -718
  217. data/vendor/PDCurses/wingui/pdcgetsc.c +0 -30
  218. data/vendor/PDCurses/wingui/pdckbd.c +0 -143
  219. data/vendor/PDCurses/wingui/pdcscrn.c +0 -2797
  220. data/vendor/PDCurses/wingui/pdcsetsc.c +0 -89
  221. data/vendor/PDCurses/wingui/pdcurses.ico +0 -0
  222. data/vendor/PDCurses/wingui/pdcurses.rc +0 -28
  223. data/vendor/PDCurses/wingui/pdcutil.c +0 -61
  224. data/vendor/PDCurses/wingui/pdcwin.h +0 -122
  225. data/vendor/PDCurses/x11/Makefile.in +0 -754
  226. data/vendor/PDCurses/x11/PDCurses.spec +0 -82
  227. data/vendor/PDCurses/x11/README.md +0 -62
  228. data/vendor/PDCurses/x11/ScrollBox.c +0 -319
  229. data/vendor/PDCurses/x11/ScrollBox.h +0 -51
  230. data/vendor/PDCurses/x11/ScrollBoxP.h +0 -70
  231. data/vendor/PDCurses/x11/aclocal.m4 +0 -994
  232. data/vendor/PDCurses/x11/big_icon.xbm +0 -46
  233. data/vendor/PDCurses/x11/compose.h +0 -201
  234. data/vendor/PDCurses/x11/config.guess +0 -1500
  235. data/vendor/PDCurses/x11/config.h.in +0 -100
  236. data/vendor/PDCurses/x11/config.sub +0 -1616
  237. data/vendor/PDCurses/x11/configure +0 -6700
  238. data/vendor/PDCurses/x11/configure.ac +0 -295
  239. data/vendor/PDCurses/x11/debian/changelog +0 -6
  240. data/vendor/PDCurses/x11/debian/compat +0 -1
  241. data/vendor/PDCurses/x11/debian/control +0 -11
  242. data/vendor/PDCurses/x11/debian/copyright +0 -27
  243. data/vendor/PDCurses/x11/debian/rules +0 -98
  244. data/vendor/PDCurses/x11/install-sh +0 -253
  245. data/vendor/PDCurses/x11/little_icon.xbm +0 -14
  246. data/vendor/PDCurses/x11/ncurses_cfg.h +0 -45
  247. data/vendor/PDCurses/x11/pdcclip.c +0 -173
  248. data/vendor/PDCurses/x11/pdcdisp.c +0 -85
  249. data/vendor/PDCurses/x11/pdcgetsc.c +0 -28
  250. data/vendor/PDCurses/x11/pdckbd.c +0 -104
  251. data/vendor/PDCurses/x11/pdcscrn.c +0 -258
  252. data/vendor/PDCurses/x11/pdcsetsc.c +0 -95
  253. data/vendor/PDCurses/x11/pdcutil.c +0 -52
  254. data/vendor/PDCurses/x11/pdcx11.c +0 -316
  255. data/vendor/PDCurses/x11/pdcx11.h +0 -191
  256. data/vendor/PDCurses/x11/sb.c +0 -155
  257. data/vendor/PDCurses/x11/x11.c +0 -3686
  258. data/vendor/PDCurses/x11/xcurses-config.in +0 -81
@@ -1,405 +0,0 @@
1
- /* Public Domain Curses */
2
-
3
- #include "pdcsdl.h"
4
-
5
- /*man-start**************************************************************
6
-
7
- pdckbd
8
- ------
9
-
10
- ### Synopsis
11
-
12
- unsigned long PDC_get_input_fd(void);
13
-
14
- ### Description
15
-
16
- PDC_get_input_fd() returns the file descriptor that PDCurses
17
- reads its input from. It can be used for select().
18
-
19
- ### Portability
20
- X/Open BSD SYS V
21
- PDC_get_input_fd - - -
22
-
23
- **man-end****************************************************************/
24
-
25
- #include <string.h>
26
-
27
- unsigned long pdc_key_modifiers = 0L;
28
-
29
- static SDL_Event event;
30
- static SDLKey oldkey;
31
- static MOUSE_STATUS old_mouse_status;
32
-
33
- static struct
34
- {
35
- SDLKey keycode;
36
- bool numkeypad;
37
- unsigned short normal;
38
- unsigned short shifted;
39
- unsigned short control;
40
- unsigned short alt;
41
- } key_table[] =
42
- {
43
- /* keycode keypad normal shifted control alt*/
44
- {SDLK_LEFT, FALSE, KEY_LEFT, KEY_SLEFT, CTL_LEFT, ALT_LEFT},
45
- {SDLK_RIGHT, FALSE, KEY_RIGHT, KEY_SRIGHT, CTL_RIGHT, ALT_RIGHT},
46
- {SDLK_UP, FALSE, KEY_UP, KEY_SUP, CTL_UP, ALT_UP},
47
- {SDLK_DOWN, FALSE, KEY_DOWN, KEY_SDOWN, CTL_DOWN, ALT_DOWN},
48
- {SDLK_HOME, FALSE, KEY_HOME, KEY_SHOME, CTL_HOME, ALT_HOME},
49
- {SDLK_END, FALSE, KEY_END, KEY_SEND, CTL_END, ALT_END},
50
- {SDLK_PAGEUP, FALSE, KEY_PPAGE, KEY_SPREVIOUS,CTL_PGUP, ALT_PGUP},
51
- {SDLK_PAGEDOWN,FALSE, KEY_NPAGE, KEY_SNEXT, CTL_PGDN, ALT_PGDN},
52
- {SDLK_INSERT, FALSE, KEY_IC, KEY_SIC, CTL_INS, ALT_INS},
53
- {SDLK_DELETE, FALSE, KEY_DC, KEY_SDC, CTL_DEL, ALT_DEL},
54
- {SDLK_F1, FALSE, KEY_F(1), KEY_F(13), KEY_F(25), KEY_F(37)},
55
- {SDLK_F2, FALSE, KEY_F(2), KEY_F(14), KEY_F(26), KEY_F(38)},
56
- {SDLK_F3, FALSE, KEY_F(3), KEY_F(15), KEY_F(27), KEY_F(39)},
57
- {SDLK_F4, FALSE, KEY_F(4), KEY_F(16), KEY_F(28), KEY_F(40)},
58
- {SDLK_F5, FALSE, KEY_F(5), KEY_F(17), KEY_F(29), KEY_F(41)},
59
- {SDLK_F6, FALSE, KEY_F(6), KEY_F(18), KEY_F(30), KEY_F(42)},
60
- {SDLK_F7, FALSE, KEY_F(7), KEY_F(19), KEY_F(31), KEY_F(43)},
61
- {SDLK_F8, FALSE, KEY_F(8), KEY_F(20), KEY_F(32), KEY_F(44)},
62
- {SDLK_F9, FALSE, KEY_F(9), KEY_F(21), KEY_F(33), KEY_F(45)},
63
- {SDLK_F10, FALSE, KEY_F(10), KEY_F(22), KEY_F(34), KEY_F(46)},
64
- {SDLK_F11, FALSE, KEY_F(11), KEY_F(23), KEY_F(35), KEY_F(47)},
65
- {SDLK_F12, FALSE, KEY_F(12), KEY_F(24), KEY_F(36), KEY_F(48)},
66
- {SDLK_F13, FALSE, KEY_F(13), KEY_F(25), KEY_F(37), KEY_F(49)},
67
- {SDLK_F14, FALSE, KEY_F(14), KEY_F(26), KEY_F(38), KEY_F(50)},
68
- {SDLK_F15, FALSE, KEY_F(15), KEY_F(27), KEY_F(39), KEY_F(51)},
69
- {SDLK_BACKSPACE,FALSE, 0x08, 0x08, CTL_BKSP, ALT_BKSP},
70
- {SDLK_TAB, FALSE, 0x09, KEY_BTAB, CTL_TAB, ALT_TAB},
71
- {SDLK_PRINT, FALSE, KEY_PRINT, KEY_SPRINT, KEY_PRINT, KEY_PRINT},
72
- {SDLK_PAUSE, FALSE, KEY_SUSPEND, KEY_SSUSPEND, KEY_SUSPEND, KEY_SUSPEND},
73
- {SDLK_CLEAR, FALSE, KEY_CLEAR, KEY_CLEAR, KEY_CLEAR, KEY_CLEAR},
74
- {SDLK_BREAK, FALSE, KEY_BREAK, KEY_BREAK, KEY_BREAK, KEY_BREAK},
75
- {SDLK_HELP, FALSE, KEY_HELP, KEY_SHELP, KEY_LHELP, KEY_HELP},
76
- {SDLK_MENU, FALSE, KEY_OPTIONS, KEY_SOPTIONS, KEY_OPTIONS, KEY_OPTIONS},
77
- {SDLK_ESCAPE, FALSE, 0x1B, 0x1B, 0x1B, ALT_ESC},
78
- {SDLK_KP_ENTER,TRUE, PADENTER, PADENTER, CTL_PADENTER,ALT_PADENTER},
79
- {SDLK_KP_PLUS, TRUE, PADPLUS, '+', CTL_PADPLUS, ALT_PADPLUS},
80
- {SDLK_KP_MINUS,TRUE, PADMINUS, '-', CTL_PADMINUS,ALT_PADMINUS},
81
- {SDLK_KP_MULTIPLY,TRUE,PADSTAR, '*', CTL_PADSTAR, ALT_PADSTAR},
82
- {SDLK_KP_DIVIDE,TRUE, PADSLASH, '/', CTL_PADSLASH,ALT_PADSLASH},
83
- {SDLK_KP_PERIOD,TRUE, PADSTOP, '.', CTL_PADSTOP, ALT_PADSTOP},
84
- {SDLK_KP0, TRUE, PAD0, '0', CTL_PAD0, ALT_PAD0},
85
- {SDLK_KP1, TRUE, KEY_C1, '1', CTL_PAD1, ALT_PAD1},
86
- {SDLK_KP2, TRUE, KEY_C2, '2', CTL_PAD2, ALT_PAD2},
87
- {SDLK_KP3, TRUE, KEY_C3, '3', CTL_PAD3, ALT_PAD3},
88
- {SDLK_KP4, TRUE, KEY_B1, '4', CTL_PAD4, ALT_PAD4},
89
- {SDLK_KP5, TRUE, KEY_B2, '5', CTL_PAD5, ALT_PAD5},
90
- {SDLK_KP6, TRUE, KEY_B3, '6', CTL_PAD6, ALT_PAD6},
91
- {SDLK_KP7, TRUE, KEY_A1, '7', CTL_PAD7, ALT_PAD7},
92
- {SDLK_KP8, TRUE, KEY_A2, '8', CTL_PAD8, ALT_PAD8},
93
- {SDLK_KP9, TRUE, KEY_A3, '9', CTL_PAD9, ALT_PAD9},
94
- {0, 0, 0, 0, 0, 0}
95
- };
96
-
97
- unsigned long PDC_get_input_fd(void)
98
- {
99
- PDC_LOG(("PDC_get_input_fd() - called\n"));
100
-
101
- return 0L; /* test this */
102
- }
103
-
104
- void PDC_set_keyboard_binary(bool on)
105
- {
106
- PDC_LOG(("PDC_set_keyboard_binary() - called\n"));
107
- }
108
-
109
- /* check if a key or mouse event is waiting */
110
-
111
- bool PDC_check_key(void)
112
- {
113
- Uint32 current = SDL_GetTicks();
114
- int haveevent = SDL_PollEvent(&event);
115
-
116
- /* if we have an event, or 30 ms have passed without a screen
117
- update, or the timer has wrapped, update now */
118
-
119
- if (haveevent ||
120
- current < pdc_lastupdate || ((current - pdc_lastupdate) > 30))
121
- PDC_update_rects();
122
-
123
- return haveevent;
124
- }
125
-
126
- static int _process_key_event(void)
127
- {
128
- int i, key = 0;
129
-
130
- pdc_key_modifiers = 0L;
131
- SP->key_code = FALSE;
132
-
133
- if (event.type == SDL_KEYUP)
134
- {
135
- if (SP->return_key_modifiers && event.key.keysym.sym == oldkey)
136
- {
137
- switch (oldkey)
138
- {
139
- case SDLK_RSHIFT:
140
- return KEY_SHIFT_R;
141
- case SDLK_LSHIFT:
142
- return KEY_SHIFT_L;
143
- case SDLK_RCTRL:
144
- return KEY_CONTROL_R;
145
- case SDLK_LCTRL:
146
- return KEY_CONTROL_L;
147
- case SDLK_RALT:
148
- return KEY_ALT_R;
149
- case SDLK_LALT:
150
- return KEY_ALT_L;
151
- default:
152
- break;
153
- }
154
- }
155
-
156
- return -1;
157
- }
158
-
159
- oldkey = event.key.keysym.sym;
160
-
161
- if (SP->save_key_modifiers)
162
- {
163
- if (event.key.keysym.mod & KMOD_NUM)
164
- pdc_key_modifiers |= PDC_KEY_MODIFIER_NUMLOCK;
165
-
166
- if (event.key.keysym.mod & KMOD_SHIFT)
167
- pdc_key_modifiers |= PDC_KEY_MODIFIER_SHIFT;
168
-
169
- if (event.key.keysym.mod & KMOD_CTRL)
170
- pdc_key_modifiers |= PDC_KEY_MODIFIER_CONTROL;
171
-
172
- if (event.key.keysym.mod & KMOD_ALT)
173
- pdc_key_modifiers |= PDC_KEY_MODIFIER_ALT;
174
- }
175
-
176
- for (i = 0; key_table[i].keycode; i++)
177
- {
178
- if (key_table[i].keycode == event.key.keysym.sym)
179
- {
180
- if ((event.key.keysym.mod & KMOD_SHIFT) ||
181
- (key_table[i].numkeypad && (event.key.keysym.mod & KMOD_NUM)))
182
- {
183
- key = key_table[i].shifted;
184
- }
185
- else if (event.key.keysym.mod & KMOD_CTRL)
186
- {
187
- key = key_table[i].control;
188
- }
189
- else if (event.key.keysym.mod & KMOD_ALT)
190
- {
191
- key = key_table[i].alt;
192
- }
193
-
194
- /* To get here, we ignore all other modifiers */
195
-
196
- else
197
- key = key_table[i].normal;
198
-
199
- SP->key_code = (key > 0x100);
200
- break;
201
- }
202
- }
203
-
204
- if (!key)
205
- {
206
- key = event.key.keysym.unicode;
207
-
208
- if (key > 0x7f)
209
- key = 0;
210
- }
211
-
212
- /* Handle ALT letters and numbers */
213
-
214
- if (event.key.keysym.mod & KMOD_ALT)
215
- {
216
- if (key >= 'A' && key <= 'Z')
217
- {
218
- key += ALT_A - 'A';
219
- SP->key_code = TRUE;
220
- }
221
-
222
- if (key >= 'a' && key <= 'z')
223
- {
224
- key += ALT_A - 'a';
225
- SP->key_code = TRUE;
226
- }
227
-
228
- if (key >= '0' && key <= '9')
229
- {
230
- key += ALT_0 - '0';
231
- SP->key_code = TRUE;
232
- }
233
- }
234
-
235
- return key ? key : -1;
236
- }
237
-
238
- static int _process_mouse_event(void)
239
- {
240
- SDLMod keymods;
241
- short shift_flags = 0;
242
-
243
- memset(&pdc_mouse_status, 0, sizeof(MOUSE_STATUS));
244
-
245
- keymods = SDL_GetModState();
246
-
247
- if (keymods & KMOD_SHIFT)
248
- shift_flags |= BUTTON_SHIFT;
249
-
250
- if (keymods & KMOD_CTRL)
251
- shift_flags |= BUTTON_CONTROL;
252
-
253
- if (keymods & KMOD_ALT)
254
- shift_flags |= BUTTON_ALT;
255
-
256
- if (event.type == SDL_MOUSEMOTION)
257
- {
258
- int i;
259
-
260
- pdc_mouse_status.x = event.motion.x / pdc_fwidth;
261
- pdc_mouse_status.y = event.motion.y / pdc_fheight;
262
-
263
- if (!event.motion.state ||
264
- (pdc_mouse_status.x == old_mouse_status.x &&
265
- pdc_mouse_status.y == old_mouse_status.y))
266
- return -1;
267
-
268
- pdc_mouse_status.changes = PDC_MOUSE_MOVED;
269
-
270
- for (i = 0; i < 3; i++)
271
- {
272
- if (event.motion.state & SDL_BUTTON(i + 1))
273
- {
274
- pdc_mouse_status.button[i] = BUTTON_MOVED | shift_flags;
275
- pdc_mouse_status.changes |= (1 << i);
276
- }
277
- }
278
- }
279
- else
280
- {
281
- short action = (event.button.state == SDL_PRESSED) ?
282
- BUTTON_PRESSED : BUTTON_RELEASED;
283
- Uint8 btn = event.button.button;
284
-
285
- /* handle scroll wheel */
286
-
287
- if ((btn >= 4 && btn <= 7) && action == BUTTON_RELEASED)
288
- {
289
- pdc_mouse_status.x = pdc_mouse_status.y = -1;
290
-
291
- switch (btn)
292
- {
293
- case 4:
294
- pdc_mouse_status.changes = PDC_MOUSE_WHEEL_UP;
295
- break;
296
- case 5:
297
- pdc_mouse_status.changes = PDC_MOUSE_WHEEL_DOWN;
298
- break;
299
- case 6:
300
- pdc_mouse_status.changes = PDC_MOUSE_WHEEL_LEFT;
301
- break;
302
- case 7:
303
- pdc_mouse_status.changes = PDC_MOUSE_WHEEL_RIGHT;
304
- }
305
-
306
- SP->key_code = TRUE;
307
- return KEY_MOUSE;
308
- }
309
-
310
- if (btn < 1 || btn > 3)
311
- return -1;
312
-
313
- /* check for a click -- a press followed immediately by a release */
314
-
315
- if (action == BUTTON_PRESSED && SP->mouse_wait)
316
- {
317
- SDL_Event rel;
318
-
319
- napms(SP->mouse_wait);
320
-
321
- if (SDL_PollEvent(&rel))
322
- {
323
- if (rel.type == SDL_MOUSEBUTTONUP && rel.button.button == btn)
324
- action = BUTTON_CLICKED;
325
- else
326
- SDL_PushEvent(&rel);
327
- }
328
- }
329
-
330
- pdc_mouse_status.x = event.button.x / pdc_fwidth;
331
- pdc_mouse_status.y = event.button.y / pdc_fheight;
332
-
333
- btn--;
334
-
335
- pdc_mouse_status.button[btn] = action | shift_flags;
336
- pdc_mouse_status.changes = (1 << btn);
337
- }
338
-
339
- old_mouse_status = pdc_mouse_status;
340
-
341
- SP->key_code = TRUE;
342
- return KEY_MOUSE;
343
- }
344
-
345
- /* return the next available key or mouse event */
346
-
347
- int PDC_get_key(void)
348
- {
349
- switch (event.type)
350
- {
351
- case SDL_QUIT:
352
- exit(1);
353
- case SDL_VIDEORESIZE:
354
- if (pdc_own_screen &&
355
- (event.resize.h / pdc_fheight != LINES ||
356
- event.resize.w / pdc_fwidth != COLS))
357
- {
358
- pdc_sheight = event.resize.h;
359
- pdc_swidth = event.resize.w;
360
-
361
- if (!SP->resized)
362
- {
363
- SP->resized = TRUE;
364
- return KEY_RESIZE;
365
- }
366
- }
367
- break;
368
- case SDL_MOUSEMOTION:
369
- SDL_ShowCursor(SDL_ENABLE);
370
- case SDL_MOUSEBUTTONUP:
371
- case SDL_MOUSEBUTTONDOWN:
372
- oldkey = SDLK_SPACE;
373
- if (SP->_trap_mbe)
374
- return _process_mouse_event();
375
- break;
376
- case SDL_KEYUP:
377
- case SDL_KEYDOWN:
378
- PDC_mouse_set();
379
- return _process_key_event();
380
- }
381
-
382
- return -1;
383
- }
384
-
385
- /* discard any pending keyboard or mouse input -- this is the core
386
- routine for flushinp() */
387
-
388
- void PDC_flushinp(void)
389
- {
390
- PDC_LOG(("PDC_flushinp() - called\n"));
391
-
392
- while (PDC_check_key());
393
- }
394
-
395
- int PDC_mouse_set(void)
396
- {
397
- SDL_ShowCursor(SP->_trap_mbe ? SDL_ENABLE : SDL_DISABLE);
398
-
399
- return OK;
400
- }
401
-
402
- int PDC_modifiers_set(void)
403
- {
404
- return OK;
405
- }