No Description
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.

PIE.html 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>Programmable Input Emulator 0.41</title>
  5. <meta http-equiv="content-type"
  6. content="text/html; charset=ISO-8859-1">
  7. <meta name="author" content="Carl Kenner">
  8. </head>
  9. <body>
  10. <h1>Programmable Input Emulator 0.41 Introduction</h1>
  11. <br>
  12. (Don't forget to also read the Documentation.rtf file)<p>
  13. The GlovePIE Programmable Input Emulator (previously known as PIE) emulates input devices
  14. by using other input devices.<br>
  15. This means you can use the joystick in a keyboard only game (eg. DOOM3)
  16. or the keyboard in a joystick only game (eg. Return Of The King Co-op mode).
  17. Or you can control any game with a virtual reality glove. Or you can create
  18. macros to do complex moves at the touch of a button (eg. Mortal Kombat).
  19. Or you can play musical instruments from your PC.<br>
  20. <br>
  21. This is still a beta version, so it will be buggy and incomplete.<br>
  22. <h2>You can emulate:</h2>
  23. <ul>
  24. <li>the mouse</li>
  25. <li>the keyboard (on windows 2000 and XP)</li>
  26. <li>Multiple joysticks or gamepads (if you download and install PPJoy)</li>
  27. <li>Multiple MIDI devices (if you download and install Midi Yoke or
  28. Hubi's loopback driver)</li>
  29. <li>Microphone input (in theory)</li>
  30. </ul>
  31. <br>
  32. <h2>You can get input from:</h2>
  33. <ul>
  34. <li>multiple mice</li>
  35. <li>multiple keyboards</li>
  36. <li>multiple joysticks or gamepads</li>
  37. <li>Multiple Essential Reality P5 virtual reality gloves</li>
  38. <li>multiple MIDI devices</li>
  39. <li>a microphone</li>
  40. </ul>
  41. <br>
  42. <h2>Requirements:</h2>
  43. <ul>
  44. <li>DirectX 8 or higher</li>
  45. <li>PPJoy if you want to use virtual joysticks</li>
  46. <li>Midi Yoke if you want to emulate MIDI
  47. input</li>
  48. <li>Windows 2000 or above if you want to emulate the keyboard</li>
  49. <li>SAPI 5.0 (Comes with Windows XP and Office XP) or SAPI 5.1 if you
  50. want speech synthesis and recognition</li>
  51. </ul>
  52. I highly recommend buying an Essential Reality P5 virtual reality glove.
  53. They are very cheap. You can do wonderous
  54. things with a virtual reality glove and PIE! Actually you should buy two since
  55. they are cheap and you save on shipping if you buy both at once.<br>
  56. <br>
  57. <h2>Installing:</h2>
  58. <br>
  59. Just extract the ZIP file into whatever folder you want. &nbsp;There is
  60. no installation program.<br>
  61. You will also need to download and install PPJoy and Midi Yoke if you
  62. want to use them. After you install PPJoy you need to create at least one
  63. virtual joystick.<br>
  64. You should associate .PIE files with GlovePIE in windows, so you can just click
  65. on PIE scripts and open them in GlovePIE.<br>
  66. <br>
  67. <h2>Uninstalling:</h2>
  68. Just delete the folder you installed GlovePIE into.<br>
  69. You may also want to remove or change the association for .PIE files.<br>
  70. <br>
  71. <h2>Running:</h2>
  72. You can start GlovePIE by double clicking on its icon in windows explorer,
  73. or by double clicking on a .PIE file if you have set up the associations.
  74. You can also start it from a command prompt (aka DOS window), or create
  75. a shortcut to it on your desktop, quick-launch bar, or start menu. <br>
  76. <br>
  77. By default, when PIE starts it displays an empty script window. You can
  78. write a new PIE script there, or you can load an existing file from the
  79. file menu. But it will not actually do anything until you choose "Run" from
  80. the "Run!" menu. Then it will check your script for errors and run it. If
  81. there are any errors it will just ignore those lines. When you have finished
  82. playing you can choose "Stop" from the "Run!" menu. PIE will not emulate
  83. anything unless it is running. Exiting PIE by closing its window will stop
  84. all emulation. You can also just check your program for errors without running
  85. it by choosing "Check for errors" from the "Run" menu. If there are any
  86. errors a box will pop up at the bottom of the window with a list of errors
  87. and line numbers. If nothing appears then there are no errors. You can tell
  88. when your script is running because the title bar at the top of the window
  89. will change.<br>
  90. <br>
  91. If you run PIE from the command prompt or a shortcut then you can specify
  92. command line parameters. You must use quotation marks around any parameter
  93. which includes a space.<br>
  94. <table cellpadding="2" cellspacing="2" border="1" width="60%">
  95. <tbody>
  96. <tr>
  97. <td valign="top"><i>filename.PIE</i><br>
  98. </td>
  99. <td valign="top">The name of a PIE script to open. You may or may
  100. not include the .PIE extension. The script will not do anything until you
  101. choose "Run" from the "Run!" menu.<br>
  102. </td>
  103. </tr>
  104. <tr>
  105. <td valign="top">
  106. <pre>-<i>filename.PIE</i></pre>
  107. </td>
  108. <td valign="top">The name of a PIE script to open and run. You may
  109. or may not include the .PIE extension. It will start running automatically<br>
  110. </td>
  111. </tr>
  112. <tr>
  113. <td valign="top">
  114. <pre>/r:<i>filename.EXE</i></pre>
  115. </td>
  116. <td valign="top">The name of a .EXE file or other program to start
  117. running automatically when PIE starts. This allows you to start the game
  118. and PIE at the same time.<br>
  119. </td>
  120. </tr>
  121. </tbody>
  122. </table>
  123. <br>
  124. <br>
  125. <h2>Menus:</h2>
  126. PIE has the following menus:<br>
  127. <br>
  128. <table cellpadding="2" cellspacing="2" border="1" width="100%">
  129. <tbody>
  130. <tr>
  131. <td valign="top">File<br>
  132. </td>
  133. <td valign="top"><br>
  134. </td>
  135. <td valign="top">Standard file menu. Except the only way to save
  136. files is by choosing "Save As..."<br>
  137. </td>
  138. </tr>
  139. <tr>
  140. <td valign="top">File<br>
  141. </td>
  142. <td valign="top">New<br>
  143. </td>
  144. <td valign="top">Clears the script window. You will lose your work
  145. if you haven't saved it.<br>
  146. </td>
  147. </tr>
  148. <tr>
  149. <td valign="top">File<br>
  150. </td>
  151. <td valign="top">Open...<br>
  152. </td>
  153. <td valign="top">Load a PIE script file. This will not start it
  154. running until you choose "Run" from the "Run!" menu. <br>
  155. You will lose your work if you haven't saved it.<br>
  156. </td>
  157. </tr>
  158. <tr>
  159. <td valign="top">File<br>
  160. </td>
  161. <td valign="top">Save As...<br>
  162. </td>
  163. <td valign="top">The only way to save a file. If you don't use this
  164. you will lose your work! <br>
  165. You need to choose the filename every time. Sorry.<br>
  166. </td>
  167. </tr>
  168. <tr>
  169. <td valign="top">File<br>
  170. </td>
  171. <td valign="top">Exit<br>
  172. </td>
  173. <td valign="top">Quit PIE and stop emulating anything. Please save
  174. your work before you choose this. <br>
  175. It will NOT ask you whether you want to save.<br>
  176. </td>
  177. </tr>
  178. <tr>
  179. <td valign="top">Edit<br>
  180. </td>
  181. <td valign="top"><br>
  182. </td>
  183. <td valign="top">Standard edit commands<br>
  184. </td>
  185. </tr>
  186. <tr>
  187. <td valign="top">Run!<br>
  188. </td>
  189. <td valign="top"><br>
  190. </td>
  191. <td valign="top">The Run menu is for running and checking your script.
  192. It won't emulate anything unless it is running.<br>
  193. </td>
  194. </tr>
  195. <tr>
  196. <td valign="top">Run!<br>
  197. </td>
  198. <td valign="top">Check for errors<br>
  199. </td>
  200. <td valign="top">Check the script for errors. This was called "Compile"
  201. in the previous version. <br>
  202. Only use this while your program is not running.<br>
  203. A box will pop up at the bottom of the window if there are any errors.
  204. Errors will also be highlighted in red.<br>
  205. You can single-click on an error in the box to go to that line.<br>
  206. </td>
  207. </tr>
  208. <tr>
  209. <td valign="top">Run!<br>
  210. </td>
  211. <td valign="top">Run<br>
  212. </td>
  213. <td valign="top">Start your script going. This starts the actual
  214. emulation process. <br>
  215. Basically it will just loop through your script about 40 times per second.<br>
  216. If there are any errors they will be highlighted and included in the error
  217. box, but the script will still run and just ignore those lines.<br>
  218. The script will keep running until you chose "Stop" from the "Run!" menu,
  219. or try to close the PIE window.<br>
  220. While running, your script may move the cursor around or press keys which
  221. may do bad things to the PIE window if it is in the foreground.<br>
  222. I recommend starting notepad and placing it in the foreground while you
  223. are running a script that presses keys.<br>
  224. </td>
  225. </tr>
  226. <tr>
  227. <td valign="top">Run!<br>
  228. </td>
  229. <td valign="top">Stop<br>
  230. </td>
  231. <td valign="top">Stops your script running. You should do this before
  232. you check for errors or run your program again. <br>
  233. You don't need to do this before closing the window, that will stop it
  234. automatically.<br>
  235. </td>
  236. </tr>
  237. <tr>
  238. <td valign="top">Settings<br>
  239. </td>
  240. <td valign="top"><br>
  241. </td>
  242. <td valign="top">Turns the P5 gloves' mouse mode off, or brings
  243. up Control Panel applets for the various input devices PIE uses.<br>
  244. </td>
  245. </tr>
  246. <tr>
  247. <td valign="top">Settings<br>
  248. </td>
  249. <td valign="top">Turn P5 Mouse Mode Off<br>
  250. </td>
  251. <td valign="top">If you have any P5 virtual reality gloves connected,
  252. this will switch off mouse mode for all of them. <br>
  253. Don't do this while your script is running or the P5 will no longer work
  254. with it.<br>
  255. </td>
  256. </tr>
  257. <tr>
  258. <td valign="top">Settings<br>
  259. </td>
  260. <td valign="top">Control Panel<br>
  261. </td>
  262. <td valign="top">Starts control panel<br>
  263. </td>
  264. </tr>
  265. <tr>
  266. <td valign="top">Settings<br>
  267. </td>
  268. <td valign="top">P5<br>
  269. </td>
  270. <td valign="top">This will bring up the P5 control panel (for your
  271. virtual reality glove) if it is installed.<br>
  272. You can calibrate or test your bend sensors, change the mouse mode settings,
  273. or test the buttons.<br>
  274. This is the original Essential Reality version that only supports a single
  275. glove. If you want to calibrate or change the settings for multiple gloves,
  276. you should download the Dual Mode Driver and use its VBControlPanel instead.<br>
  277. </td>
  278. </tr>
  279. <tr>
  280. <td valign="top">Settings<br>
  281. </td>
  282. <td valign="top">PPJoy<br>
  283. </td>
  284. <td valign="top">Brings up the PPJoy control panel, if PPJoy is
  285. installed. This allows you to add virtual joysticks or set the number of
  286. buttons, axes and hats the virtual joystick has. You can also chose which
  287. axes or hats correspond to analog0 to analog15, and what buttons or hats
  288. correspond to digital0 to digital31.<br>
  289. </td>
  290. </tr>
  291. <tr>
  292. <td valign="top">Settings<br>
  293. </td>
  294. <td valign="top">Joystick<br>
  295. </td>
  296. <td valign="top">Brings up the Game Controllers or Joystick control
  297. panel. It allows you to test your virtual joystick. I don't recommend calibrating
  298. virtual joysticks.<br>
  299. </td>
  300. </tr>
  301. <tr>
  302. <td valign="top">Settings<br>
  303. </td>
  304. <td valign="top">Mouse<br>
  305. </td>
  306. <td valign="top">Brings up the mouse control panel.<br>
  307. </td>
  308. </tr>
  309. <tr>
  310. <td valign="top">Settings<br>
  311. </td>
  312. <td valign="top">Keyboard<br>
  313. </td>
  314. <td valign="top">Brings up the keyboard control panel.<br>
  315. </td>
  316. </tr>
  317. <tr>
  318. <td valign="top">Settings<br>
  319. </td>
  320. <td valign="top">MIDI<br>
  321. </td>
  322. <td valign="top">Brings up the closest thing to a MIDI control panel.
  323. This should allow you to chose which MIDI device you want to use as the default
  324. output.<br>
  325. </td>
  326. </tr>
  327. <tr>
  328. <td valign="top">Settings<br>
  329. </td>
  330. <td valign="top">Speech<br>
  331. </td>
  332. <td valign="top">Tries to bring up the Speech control panel to change
  333. the default text to speech voice. This may not work if the SAPI is not installed
  334. in the default directory.<br>
  335. </td>
  336. </tr>
  337. <tr>
  338. <td valign="top">TroubleShooter<br>
  339. </td>
  340. <td valign="top"><br>
  341. </td>
  342. <td valign="top">This menu allows you to disable features that you
  343. don't think are working or are giving you errors. The settings are not saved
  344. between sessions. <br>
  345. It was designed for an error some people got with the joystick, but those
  346. error messages no longer appear so it is unnecessary.<br>
  347. </td>
  348. </tr>
  349. <tr>
  350. <td valign="top">Help<br>
  351. </td>
  352. <td valign="top"><br>
  353. </td>
  354. <td valign="top">Get help on PIE.<br>
  355. </td>
  356. </tr>
  357. </tbody>
  358. </table>
  359. <br>
  360. <br>
  361. <h2>Scripting Tutorial:</h2>
  362. <h3>Tutorial 1 - easy stuff</h3>
  363. Lets make a pie script to simulate pressing the W, A, S and D keys when
  364. you press the arrow keys.<br>
  365. This will not work on Windows 98.<br>
  366. <br>
  367. Start up PIE.<br>
  368. Choose the "File" Menu, then click "New". This will clear whatever was
  369. in the big white box so you can type your own script.<br>
  370. We want the W key to be controlled by the up key so type this on one line
  371. then press Enter:<br>
  372. <br>
  373. W = Up<br>
  374. <br>
  375. This is a working PIE Script so you can test it by choosing the "Run!"
  376. menu and clicking "Run". <br>
  377. <br>
  378. Whenever you press the up arrow key (on the cursor pad, not the numeric
  379. keypad) it will type a "w". Try it out! This will work in any program.<br>
  380. Note that it will still move the cursor up. The Up arrow key still has
  381. its original function, but it emulates a w at the same time. Try holding
  382. down shift and pressing Up. It will type a capital W, unless capslock is
  383. on. Unlike the real "W" key, holding down the Up arrow will only type a single
  384. "w".<br>
  385. <br>
  386. Now chose the "Run!" menu and click "Stop". This will return our keyboard
  387. to normal.<br>
  388. <br>
  389. Now do the other keys like this:<br>
  390. <br>
  391. A = Left<br>
  392. S = Down<br>
  393. D = Right<br>
  394. <br>
  395. (Don't worry if the S is orange, that is because S is also an abbreviation
  396. for seconds).<br>
  397. <br>
  398. Save your script as Tutorial1.PIE by chosing the "File" menu then "Save
  399. As...".<br>
  400. And run it again. Stop it when you have finished playing.<br>
  401. <br>
  402. You can change it to use any keys you want. You can even use keys that
  403. don't exist on your keyboard, like the MediaPlay key which is on some multimedia
  404. keyboards. If you don't know what a key is called, just guess. It is not
  405. fussy about the key names. You could have written this and it would still
  406. work:<br>
  407. <br>
  408. W = UpArrow<br>
  409. A = CursorLeft<br>
  410. <br>
  411. If you want to make it clear that it is a key on the keyboard, you can
  412. type this:<br>
  413. <br>
  414. key.W = key.Up<br>
  415. <br>
  416. (When you type the dot it will pop up with a list of keys. If you can't
  417. get out of this, click somewhere in the PIE window. Then press Control +
  418. Space and the list will pop up again, but this time it should work. If not,
  419. choose the "Troubleshooter" menu and click "Disable Code Completion")<br>
  420. <br>
  421. or this:<br>
  422. <br>
  423. keyboard.W = keyboard.Up<br>
  424. <br>
  425. or even this:<br>
  426. <br>
  427. keyboard's W = UpArrow of Keyboard<br>
  428. <br>
  429. <br>
  430. <h3>Tutorial 2 - emulating a joystick</h3>
  431. This time we will control a virtual joystick using the keyboard.<br>
  432. This will only work if you have downloaded and installed PPJoy.<br>
  433. <br>
  434. This is not really much harder to do in PIE than the keyboard, but we
  435. have know how to use PPJoy and the joystick control panel first. So please
  436. be patient.<br>
  437. <br>
  438. Start PIE.<br>
  439. Click File/New.<br>
  440. <br>
  441. But before we write our script, we need to make sure PPJoy is set up correctly.<br>
  442. Chose the "Settings" menu and click "PPJoy".<br>
  443. If PPJoy is installed it should pop up with a window titled &nbsp;"PPJoy
  444. Joystick and Gamepad Configuration Utility".<br>
  445. There is a big white list box in the middle of the window with the heading
  446. "Configured joysticks". One of the items in the list needs to be "Virtual
  447. Joystick 1".<br>
  448. <br>
  449. If Virtual Joystick 1 is not there, or the box is empty then you need
  450. to do the following:<br>
  451. <ul>
  452. <li>click the "Add..." button.</li>
  453. <li>Where it says "Parallel port" choose "Virtual port"</li>
  454. <li>Where it says "Controller number" choose "Controller 1"</li>
  455. <li>Click the "Add" button</li>
  456. <li>Now wait and go through the hardware setup dialog boxes that pop
  457. up</li>
  458. <li>Choose the default options in any dialog boxes</li>
  459. <li>Be patient, it needs to find and install several drivers</li>
  460. </ul>
  461. Regardless of whether it was there before, or you just added it, you should
  462. have a "Virtual Joystick 1" in the list box. Select it and choose "Mapping".
  463. It will pop up with the dialog box saying "Welcome to the Joystick/Pad mapping
  464. wizard". If it doesn't work then you probably weren't patient enough in the
  465. previous step. Choose "Set a custom mapping for this controller" (which should
  466. already be selected) and click "Next &gt;".&nbsp; Now you can choose how
  467. many axes, buttons and hats the virtual joystick should have, and which axes
  468. they are. Leave the default settings and click "Next &gt;". Now you can choose
  469. which analog inputs control which axes. You will notice that analog0 controls
  470. the x axis (horizontal), and analog1 controls the y axis (vertical). These
  471. are good defaults so click "Next &gt;". Now you can choose which digital
  472. inputs should control which buttons. Notice digital 0 controls joystick button
  473. 1, and digital 1 controls joystick button 2. These are also good defaults
  474. so choose next. Now you can choose which analog or digital inputs control
  475. the imaginary hats on the top of the joystick. One will be controlled by
  476. digitals 16-19 and the other will be controlled by analog 8. These are good
  477. defaults too, so click Next and then Finish.<br>
  478. <br>
  479. Click "Done" in the PPJoy control panel and go back to PIE.<br>
  480. <br>
  481. We can test the virtual joystick we just made by choosing the "Settings"
  482. menu and chosing "Joystick". This will open up the joystick control panel.
  483. Choose PPJoy Virtual Joystick 1 and click "Properties". Now it will pop up
  484. with another dialog box, choose the "Test" tab. This displays all the axes
  485. and buttons on the virtual joystick. They should all be in the middle.<br>
  486. <br>
  487. Now lets make a PIE script to control the virtual joystick. Assuming your
  488. screen resolution is 1024 by 768, Type the following:<br>
  489. <br>
  490. ppjoy.analog0 = (mouse.cursorposx - 512) / 512<br>
  491. <br>
  492. Remember how analog 0 was the x axis in the mapping before? Well it was.
  493. <br>
  494. <br>
  495. The above line sets the analog 0 value for virtual joystick 1 to a number
  496. between -1 and 1 depending on the location of the mouse cursor on the screen.<br>
  497. <br>
  498. Now run your script by choosing Run/Run on the menu. Go back to the Joystick
  499. control panel's test tab and see how the horizontal position of the cross
  500. in the box is controlled by the mouse.<br>
  501. <br>
  502. Now let's do the same for the y axis (384 is half the screen height):<br>
  503. <br>
  504. ppjoy.analog1 = &nbsp;(mouse.cursorposy - 384) / 384<br>
  505. <br>
  506. This works because PIE uses joystick values between -1 and 1. The cursor
  507. position is in pixels from 0 to 767. Subtracting 384 gives a value between
  508. -384 and 383. Dividing by 384 gives a value between -1 and (almost) 1.<br>
  509. <br>
  510. There is an easier way to do the exact same above calculations in PIE:<br>
  511. <br>
  512. ppjoy.analog0 = MapRange(mouse.cursorposx, 0,1023, -1,1)<br>
  513. ppjoy.analog1 = MapRange(mouse.cursorposy, 0,767, -1,1)<br>
  514. <br>
  515. Now let's do the buttons:<br>
  516. <br>
  517. ppjoy.digital0 = mouse.LeftButton<br>
  518. ppjoy.digital1 = mouse.RightButton<br>
  519. ppjoy.digital2 = mouse.MiddleButton<br>
  520. ppjoy.digital3 = mouse.XButton1<br>
  521. ppjoy.digital4 = mouse.XButton2<br>
  522. <br>
  523. Now run your script and test it in the joystick control panel or a game.
  524. You should be able to control the joystick with the mouse.<br>
  525. <br>
  526. If you wanted to control virtual joystick 2, you would just change ppjoy
  527. to ppjoy2.<br>
  528. eg. ppjoy2.digital0 = mouse.LeftButton<br>
  529. <br>
  530. <br>
  531. </body>
  532. </html>