|
|
| version 1.1, 2003/10/21 14:57:41 | version 1.2, 2003/11/21 06:51:15 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #include "np2.h" | #include "np2.h" |
| #include "dosio.h" | |
| #include "winkbd.h" | #include "winkbd.h" |
| #include "memory.h" | |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| Line 41 static const BYTE key106[256] = { | Line 39 static const BYTE key106[256] = { |
| // f.1, f.2, f.3, f.4, f.5, f.6, f.7, f.8 ; 0x70 | // f.1, f.2, f.3, f.4, f.5, f.6, f.7, f.8 ; 0x70 |
| 0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69, | 0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69, |
| // f.9, f10, f11, f12, f13, f14, f15, f16 ; 0x78 | // f.9, f10, f11, f12, f13, f14, f15, f16 ; 0x78 |
| 0x6a,0x6b, NC,0x7f, NC, NC, NC, NC, | 0x6a,0x6b, NC, NC, NC, NC, NC, NC, |
| // , , , , , , , ; 0x80 | // , , , , , , , ; 0x80 |
| NC, NC, NC, NC, NC, NC, NC, NC, | NC, NC, NC, NC, NC, NC, NC, NC, |
| // , , , , , , , ; 0x88 | // , , , , , , , ; 0x88 |
| Line 141 static const BYTE key106ext[256] = { | Line 139 static const BYTE key106ext[256] = { |
| // , , , , , , , ; 0xf8 | // , , , , , , , ; 0xf8 |
| NC, NC, NC, NC, NC, NC, NC, NC}; | NC, NC, NC, NC, NC, NC, NC, NC}; |
| static const BYTE f12keys[] = { | |
| 0x61, 0x60, 0x4d, 0x4f}; | |
| void winkeydown106(WPARAM wParam, LPARAM lParam) { // ver0.28 | |
| static BYTE getf12key(void) { | |
| UINT key; | |
| key = np2oscfg.F12KEY - 1; | |
| if (key < (sizeof(f12keys)/sizeof(BYTE))) { | |
| return(f12keys[key]); | |
| } | |
| else { | |
| return(NC); | |
| } | |
| } | |
| void winkbd_keydown(WPARAM wParam, LPARAM lParam) { | |
| BYTE data; | BYTE data; |
| data = key106[wParam & 0xff]; | if (wParam != VK_F12) { |
| data = key106[wParam & 0xff]; | |
| } | |
| else { | |
| data = getf12key(); | |
| } | |
| if (data != NC) { | if (data != NC) { |
| if (data == 0x7f) { | if ((!(lParam & 0x01000000)) && |
| #if 0 | |
| if (np2oscfg.F12COPY == 1) { | |
| data = 0x61; | |
| } | |
| else { | |
| data = 0x60; | |
| } | |
| #endif | |
| } | |
| else if ((!(lParam & 0x01000000)) && | |
| (key106ext[wParam & 0xff] != NC)) { // ver0.28 | (key106ext[wParam & 0xff] != NC)) { // ver0.28 |
| keystat_senddata(0x70); // PC/AT only! | keystat_senddata(0x70); // PC/AT only! |
| data = key106ext[wParam & 0xff]; | data = key106ext[wParam & 0xff]; |
| Line 173 void winkeydown106(WPARAM wParam, LPARAM | Line 182 void winkeydown106(WPARAM wParam, LPARAM |
| } | } |
| } | } |
| void winkeyup106(WPARAM wParam, LPARAM lParam) { | void winkbd_keyup(WPARAM wParam, LPARAM lParam) { |
| BYTE data; | BYTE data; |
| data = key106[wParam & 0xff]; | if (wParam != VK_F12) { |
| data = key106[wParam & 0xff]; | |
| } | |
| else { | |
| data = getf12key(); | |
| } | |
| if (data != NC) { | if (data != NC) { |
| if (data == 0x7f) { | if ((!(lParam & 0x01000000)) && |
| #if 0 | |
| if (np2oscfg.F12COPY == 1) { | |
| data = 0x61; | |
| } | |
| else { | |
| data = 0x60; | |
| } | |
| #endif | |
| } | |
| else if ((!(lParam & 0x01000000)) && | |
| (key106ext[wParam & 0xff] != NC)) { // ver0.28 | (key106ext[wParam & 0xff] != NC)) { // ver0.28 |
| keystat_senddata(0x70 | 0x80); // PC/AT only | keystat_senddata(0x70 | 0x80); // PC/AT only |
| data = key106ext[wParam & 0xff]; | data = key106ext[wParam & 0xff]; |
| Line 204 void winkeyup106(WPARAM wParam, LPARAM l | Line 208 void winkeyup106(WPARAM wParam, LPARAM l |
| } | } |
| } | } |
| void winkbd_resetf12(void) { | |
| UINT i; | |
| for (i=0; i<(sizeof(f12keys)/sizeof(BYTE)); i++) { | |
| keystat_forcerelease(f12keys[i]); | |
| } | |
| } | |