--- np2/x11/kbdmng.c 2004/07/02 15:03:02 1.2 +++ np2/x11/kbdmng.c 2011/12/17 20:34:32 1.5 @@ -10,8 +10,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES @@ -33,16 +31,23 @@ #include "kbdmng.h" -static const BYTE kbdmng_f12keys[] = { 0x61, 0x60, 0x4f, 0x4d, 0x76, 0x77 }; - +static const BYTE kbdmng_f12keys[] = { + 0x61, /* Copy */ + 0x60, /* Stop */ + 0x4f, /* tenkey [,] */ + 0x4d, /* tenkey [=] */ + 0x76, /* User1 */ + 0x77, /* User2 */ + 0x3f, /* Help */ +}; BYTE kbdmng_getf12key(void) { int key; - key = np2oscfg.F12KEY - 1; - if (key < NELEMENTS(kbdmng_f12keys)) + key = np2oscfg.F12KEY - 1; /* 0 is Mouse mode */ + if (key >= 0 && key < NELEMENTS(kbdmng_f12keys)) return kbdmng_f12keys[key]; return KEYBOARD_KC_NC; }