| 1 | /*************************************************************************** |
| 2 | key.c - description |
| 3 | ------------------- |
| 4 | begin : Sun Oct 28 2001 |
| 5 | copyright : (C) 2001 by Pete Bernert |
| 6 | email : BlackDove@addcom.de |
| 7 | ***************************************************************************/ |
| 8 | /*************************************************************************** |
| 9 | * * |
| 10 | * This program is free software; you can redistribute it and/or modify * |
| 11 | * it under the terms of the GNU General Public License as published by * |
| 12 | * the Free Software Foundation; either version 2 of the License, or * |
| 13 | * (at your option) any later version. See also the license.txt file for * |
| 14 | * additional informations. * |
| 15 | * * |
| 16 | ***************************************************************************/ |
| 17 | |
| 18 | #define _IN_KEY |
| 19 | |
| 20 | #include "externals.h" |
| 21 | #include "menu.h" |
| 22 | #include "gpu.h" |
| 23 | #include "draw.h" |
| 24 | #include "key.h" |
| 25 | |
| 26 | #define VK_INSERT 65379 |
| 27 | #define VK_HOME 65360 |
| 28 | #define VK_PRIOR 65365 |
| 29 | #define VK_NEXT 65366 |
| 30 | #define VK_END 65367 |
| 31 | #define VK_DEL 65535 |
| 32 | #define VK_F5 65474 |
| 33 | |
| 34 | void GPUmakeSnapshot(void); |
| 35 | |
| 36 | unsigned long ulKeybits=0; |
| 37 | |
| 38 | void GPUkeypressed(int keycode) |
| 39 | { |
| 40 | switch(keycode) |
| 41 | { |
| 42 | case 0xFFC9: //X11 key: F12 |
| 43 | case ((1<<29) | 0xFF0D): //special keycode from pcsx-df: alt-enter |
| 44 | bChangeWinMode=TRUE; |
| 45 | break; |
| 46 | case VK_F5: |
| 47 | GPUmakeSnapshot(); |
| 48 | break; |
| 49 | |
| 50 | case VK_INSERT: |
| 51 | if(iUseFixes) {iUseFixes=0;dwActFixes=0;} |
| 52 | else {iUseFixes=1;dwActFixes=dwCfgFixes;} |
| 53 | SetFixes(); |
| 54 | if(iFrameLimit==2) SetAutoFrameCap(); |
| 55 | break; |
| 56 | |
| 57 | case VK_DEL: |
| 58 | if(ulKeybits&KEY_SHOWFPS) |
| 59 | { |
| 60 | ulKeybits&=~KEY_SHOWFPS; |
| 61 | DoClearScreenBuffer(); |
| 62 | } |
| 63 | else |
| 64 | { |
| 65 | ulKeybits|=KEY_SHOWFPS; |
| 66 | szDispBuf[0]=0; |
| 67 | BuildDispMenu(0); |
| 68 | } |
| 69 | break; |
| 70 | |
| 71 | case VK_PRIOR: BuildDispMenu(-1); break; |
| 72 | case VK_NEXT: BuildDispMenu( 1); break; |
| 73 | case VK_END: SwitchDispMenu(1); break; |
| 74 | case VK_HOME: SwitchDispMenu(-1); break; |
| 75 | case 0x60: |
| 76 | { |
| 77 | iFastFwd = 1 - iFastFwd; |
| 78 | bSkipNextFrame = FALSE; |
| 79 | UseFrameSkip = iFastFwd; |
| 80 | BuildDispMenu(0); |
| 81 | break; |
| 82 | } |
| 83 | #ifdef _MACGL |
| 84 | default: { void HandleKey(int keycode); HandleKey(keycode); } |
| 85 | #endif |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | void SetKeyHandler(void) |
| 90 | { |
| 91 | } |
| 92 | |
| 93 | void ReleaseKeyHandler(void) |
| 94 | { |
| 95 | } |