--- np2/macosx/mackbd.cpp 2003/10/24 12:35:19 1.5 +++ np2/macosx/mackbd.cpp 2003/11/08 17:54:26 1.9 @@ -93,6 +93,7 @@ void mackbd_initialize(void) { ZeroMemory(&keymap, sizeof(keymap)); } +#if 0 void mackbd_callback(void) { UINT32 tick; @@ -132,18 +133,33 @@ void mackbd_callback(void) { } } } +#endif + +static const BYTE f12keys[] = { + 0x61, 0x60, 0x4d, 0x4f}; + + +static BYTE getf12key(void) { + + UINT key; + + key = np2oscfg.F12COPY - 1; + if (key < (sizeof(f12keys)/sizeof(BYTE))) { + return(f12keys[key]); + } + else { + return(NC); + } +} -void mackbd_f12down(int keycode) { +void mackbd_keydown(int keycode) { if (keycode == 0x6f) { - if (np2oscfg.F12COPY == 1) { - keystat_senddata(0x61); - } - else if (np2oscfg.F12COPY == 2) { - keystat_senddata(0x60); + if (np2oscfg.F12COPY) { + keystat_senddata(getf12key()); } #if defined(NP2GCC) - else if(!np2oscfg.F12COPY) { + else { mouse_running(MOUSE_XOR); menu_setmouse(np2oscfg.MOUSE_SW ^ 1); sysmng_update(SYS_UPDATECFG); @@ -153,21 +169,17 @@ void mackbd_f12down(int keycode) { else { BYTE data; data = keymac[keycode]; - if (data == 0x71) SysBeep(0); if (data != NC) { keystat_senddata(data); } } } -void mackbd_f12up(int keycode) { +void mackbd_keyup(int keycode) { if (keycode == 0x6f) { - if (np2oscfg.F12COPY == 1) { - keystat_senddata(0x61 | 0x80); - } - else if (np2oscfg.F12COPY == 2) { - keystat_senddata(0x60 | 0x80); + if (np2oscfg.F12COPY) { + keystat_senddata(getf12key() | 0x80); } } else { @@ -179,3 +191,11 @@ void mackbd_f12up(int keycode) { } } +void mackbd_resetf12(void) { + + UINT i; + + for (i=0; i<(sizeof(f12keys)/sizeof(BYTE)); i++) { + keystat_forcerelease(f12keys[i]); + } +}