Guest User

mplayer.c

a guest
Sep 26th, 2020
187,696
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [...]
  2. /* RouteKeyPresses
  3.  *
  4.  * Reroutes cursor keys etc to track bar.
  5.  */
  6. void RouteKeyPresses(PMSG pMsg)
  7. {
  8.     /* Hack for PowerPoint
  9.      *
  10.      * Mail from PaulWa:
  11.      *
  12.      * --------
  13.      * Here's a problem you might consider fixing.
  14.      * Launching Media Player with certain keystrokes
  15.      * doesn't work right (e.g. arrow keys, page up/down,
  16.      * etc.).
  17.      *
  18.      * The problem is due to the fact that Media Player
  19.      * handles key up events.  We use the key down event
  20.      * to launch the server in slideshow, but then the key
  21.      * up event is passed to the server.  It would probably
  22.      * be best for Media Player to ignore key up events
  23.      * unless it had previously received a key down.
  24.      * If this is very difficult to fix in Media Player,
  25.      * then we can fix it in PP by launching servers on
  26.      * key up rather than key down.  However, other container
  27.      * apps will see the same problem.
  28.      * --------
  29.      *
  30.      * OK, in the spirit of cooperation, let's hack things
  31.      * so our PowerPoint friends can carry on with their
  32.      * dubious practices.
  33.      */
  34.     static WPARAM LastVKeyDown;
  35.  
  36. [...]
  37.     if (rMsg.message == WM_TIMER && rMsg.hwnd == NULL) {
  38. #ifdef CHICAGO_PRODUCT
  39.         /* The reason for requiring the following test is now lost
  40.          * in the mists of time.  Now this app is 32-bit, these
  41.          * bogus timer callbacks (if they really do still occur)
  42.          * could be 16-bit, so we need to add yet more ugliness
  43.          * in the form of assembler to an app which is already
  44.          * hardly a paragon of pulchritude.
  45.          *
  46.          * A plea:
  47.          *
  48.          * If you add some obscure code such as below, to this or
  49.          * any other app, even if it has only the teeniest chance
  50.          * of being less blindingly obvious to someone else than
  51.          * it is to you at the time of writing, please please please
  52.          * add a f***ing comment.
  53.          *
  54.          * Respectfully,
  55.          * A Developer
  56.          */
RAW Paste Data