--- np2/win9x/winkbd.cpp 2004/01/15 18:15:30 1.4 +++ np2/win9x/winkbd.cpp 2004/04/16 06:14:57 1.9 @@ -1,13 +1,12 @@ #include "compiler.h" #include "np2.h" #include "winkbd.h" -#include "pccore.h" -#include "iocore.h" +#include "keystat.h" #define NC 0xff -static const BYTE key106[256] = { +static UINT8 key106[256] = { // , , ,STOP, , , , ; 0x00 NC, NC, NC,0x60, NC, NC, NC, NC, // BS, TAB, , , CLR, ENT, , ; 0x08 @@ -73,7 +72,7 @@ static const BYTE key106[256] = { // , , , , , , , ; 0xf8 NC, NC, NC, NC, NC, NC, NC, NC}; -static const BYTE key106ext[256] = { +static const UINT8 key106ext[256] = { // , , ,STOP, , , , ; 0x00 NC, NC, NC, NC, NC, NC, NC, NC, // BS, TAB, , , CLR, ENT, , ; 0x08 @@ -139,33 +138,15 @@ static const BYTE key106ext[256] = { // , , , , , , , ; 0xf8 NC, NC, NC, NC, NC, NC, NC, NC}; -static const BYTE f12keys[] = { - 0x61, 0x60, 0x4d, 0x4f}; +static const UINT8 f12keys[] = { + 0x61, 0x60, 0x4d, 0x4f, 0x76, 0x77}; -static BYTE getf12key(void) { - - UINT key; - - key = np2oscfg.F12COPY - 1; - if (key < (sizeof(f12keys)/sizeof(BYTE))) { - return(f12keys[key]); - } - else { - return(NC); - } -} - void winkbd_keydown(WPARAM wParam, LPARAM lParam) { BYTE data; - if (wParam != VK_F12) { - data = key106[wParam & 0xff]; - } - else { - data = getf12key(); - } + data = key106[wParam & 0xff]; if (data != NC) { if ((data == 0x73) && (np2oscfg.KEYBOARD == KEY_KEY101) && @@ -192,12 +173,7 @@ void winkbd_keyup(WPARAM wParam, LPARAM BYTE data; - if (wParam != VK_F12) { - data = key106[wParam & 0xff]; - } - else { - data = getf12key(); - } + data = key106[wParam & 0xff]; if (data != NC) { if ((data == 0x73) && (np2oscfg.KEYBOARD == KEY_KEY101) && @@ -220,11 +196,37 @@ void winkbd_keyup(WPARAM wParam, LPARAM } } +void winkbd_roll(BOOL pcat) { + + if (pcat) { + key106[0x21] = 0x36; + key106[0x22] = 0x37; + } + else { + key106[0x21] = 0x37; + key106[0x22] = 0x36; + } +} + +void winkbd_setf12(UINT f12key) { + + UINT8 key; + + f12key--; + if (f12key < (sizeof(f12keys)/sizeof(UINT8))) { + key = f12keys[f12key]; + } + else { + key = NC; + } + key106[0x7b] = key; +} + void winkbd_resetf12(void) { UINT i; - for (i=0; i<(sizeof(f12keys)/sizeof(BYTE)); i++) { + for (i=0; i<(sizeof(f12keys)/sizeof(UINT8)); i++) { keystat_forcerelease(f12keys[i]); } }