rem: case 0x68: case 0x69: case 0x6a: return 0;  #ifdef __amigaos4__ case 0x6b: return 0x5d | 0x80;  case 0x6d: return 0x37 | 0x80;  case 0x79: return 0x45;  #else  case 0x6b: return 0x46;
add: case 0x68: case 0x69: case 0x6a: break;  case 0x6b: if (amiga_is_os4) { return 0x5d | 0x80; } else { return 0x46; }
context: amiga_translate_key( int code, ULONG qualifier ){  // Good URL:  // http://panda.cs.ndsu.nodak.edu/~achapwes/PICmicro/keyboard/scancodes1.html#ifdef __amigaos4__  // OS4 handles NumLock internally, so we have to undo it.  if (qualifier & IEQUALIFIER_NUMERICPAD) {    case 0x5c: code = 0x5c; break;     //  /        case 0x5d: code = 0x5d; break;     //  *        case 0x4a: cdoe = 0x4a; break;     //  -        case 0x70: code = 0x3d; break;     //  7        case 0x4c: code = 0x3e; break;     //  8        case 0x48: code = 0x3f; break;     //  9        case 0x5e: code = 0x5e; break;     //  +        case 0x4f: code = 0x2d; break;     //  4    //  case nada: code = 0x2e; break;     //  5 (no keycode sent)    case 0x4e: code = 0x2f; break;     //  6        case 0x71: code = 0x1d; break;     //  1        case 0x4d: code = 0x1e; break;     //  2        case 0x49: code = 0x1f; break;     //  3        case 0x43: code = 0x43; break;     //  Enter    case 0x47: code = 0x0f; break;     //  0    case 0x46: code = 0x3c; break;     //  ,  }#endif    switch( code )  {    case 0x00:    // tilde      return 0x29;    case 0x01:    // 1    case 0x02:    // 2    case 0x03:    // 3    case 0x04:    // 4    case 0x05:    // 5    case 0x06:    // 6    case 0x07:    // 7    case 0x08:    // 8    case 0x09:    // 9    case 0x0a:    // 0    case 0x0b:    // -    case 0x0c:    // =      return code + 1;    case 0x0d:    // backslash      return 0x2b;             // Map to backslash (doesn't exist                               // on PC keyboards!)    case 0x0e:    // unused      return 0;          case 0x0f:    // kp 0      return 0x52;          case 0x10:    // q    case 0x11:    // w    case 0x12:    // e    case 0x13:    // r    case 0x14:    // t    case 0x15:    // y    case 0x16:    // u    case 0x17:    // i    case 0x18:    // o    case 0x19:    // p    case 0x1a:    // [    case 0x1b:    // ]      return code;    case 0x1c:    // unused      return 0;          case 0x1d:    // kp 1    case 0x1e:    // kp 2    case 0x1f:    // kp 3      return code + 50;    case 0x20:    // a    case 0x21:    // s    case 0x22:    // d    case 0x23:    // f    case 0x24:    // g    case 0x25:    // h    case 0x26:    // j    case 0x27:    // k    case 0x28:    // l    case 0x29:    // ;    case 0x2a:    // '      return code - 2;    case 0x2b:    // (national ')      return 0x2b;    case 0x2c:    // unused      return 0;          case 0x2d:    // kp 4    case 0x2e:    // kp 5    case 0x2f:    // kp 6      return code + 30;          case 0x30:    // (national <)      return 0x56;    case 0x31:    // z    case 0x32:    // x    case 0x33:    // c    case 0x34:    // v    case 0x35:    // b    case 0x36:    // n    case 0x37:    // m    case 0x38:    // ,    case 0x39:    // .    case 0x3a:    // /      return code - 5;    case 0x3b:    // unused      return 0;          case 0x3c:    // kp .      return 0x53;    case 0x3d:    // kp 7    case 0x3e:    // kp 8    case 0x3f:    // kp 9      return code + 10;    case 0x40:    // space      return 0x39;          case 0x41:    // backspace      return 0x0e;    case 0x42:    // tab      return 0x0f;    case 0x43:    // kp enter      return 0x1c | 0x80;          case 0x44:    // return      return 0x1c;    case 0x45:    // esc      return 0x01;    case 0x46:    // del      return 0x53 | 0x80;    case 0x47:    // MOS/OS4 insert      return 0x52 | 0x80;    case 0x48:    // MOS/OS4 page up      return 0x49 | 0x80;    case 0x49:    // MOS/OS4 page down      return 0x51 | 0x80;          case 0x4a:    // kp -      return 0x4a;    case 0x4b:    // MOS/OS4 f11      return 0x57;          case 0x4c:    // up arrow      return 0x48 | 0x80;    case 0x4d:    // down arrow      return 0x50 | 0x80;    case 0x4e:    // right arrow      return 0x4d | 0x80;    case 0x4f:    // left arrow      return 0x4b | 0x80;    case 0x50:    // f1    case 0x51:    // f2    case 0x52:    // f3    case 0x53:    // f4    case 0x54:    // f5    case 0x55:    // f6    case 0x56:    // f7    case 0x57:    // f8    case 0x58:    // f9    case 0x59:    // f10      return code - 21;    case 0x5a:    // kp [ (NumL)      return 0x45;                    // Map to Num Lock key    case 0x5b:    // kp ] (ScrL)      return 0x46;                    // Map to Scroll Lock key    case 0x5c:    // kp /	return 0x35 | 0x80;    case 0x5d:    // kp *      if (qualifier & IEQUALIFIER_CONTROL) {	return 0x37 | 0x80;	      // Map to Print Screen      }      else {	return 0x37;      }          case 0x5e:    // kp +      return 0x4e;    case 0x5f:    // help#ifndef __amigaos4__      return 0x5d | 0x80;             // Map to Windows App/Menu key#else      return 0x46;		      // Map to Scroll Lock key#endif                case 0x60:    // lshift      return 0x2a;    case 0x61:    // rshift      return 0x36;    case 0x62:    // caps      return 0x3a;          case 0x63:    // ctrl      return 0x1d;                    // (0x1d | 0x80 is right ctrl)    case 0x64:    // lalt      return 0x38;    case 0x65:    // ralt      return 0x38 | 0x80;    case 0x66:    // lamiga      return 0x5b | 0x80;             // Map to Windows left GUI key    case 0x67:    // ramiga      return 0x5c | 0x80;             // Map to Windows right GUI key    case 0x68:    // unused    case 0x69:    // unused    case 0x6a:    // unused      return 0;#ifdef __amigaos4__    case 0x6b:	  // OS4 Menu key      return 0x5d | 0x80;    case 0x6d:    // OS4 print screen      return 0x37 | 0x80;    case 0x79:    // OS4 num lock      return 0x45;#else    case 0x6b:	  // MOS scroll lock      return 0x46;    case 0x6c:    // MOS print screen      return 0x37 | 0x80;    case 0x6d:	  // MOS numlock      return 0x45;#endif    case 0x6e:    // MOS/OS4 pause      if (qualifier & IEQUALIFIER_CONTROL) {	return 0x46 | 0x80;	      // Map to Break      }      else {	break;      }          case 0x6f:    // MOS/AOS4 f12      return 0x58;          case 0x70:    // MOS/OS4 home      return 0x47 | 0x80;    case 0x71:    // MOS/OS4 end      return 0x4f | 0x80;    case 0x72:    // MOS/CDTV stop      return  0x24 | 0x80;          case 0x73:    // MOS/CDTV play      return 0x22 | 0x80;          case 0x74:    // MOS/CDTV prev      return 0x10 | 0x80;          case 0x75:    // MOS/CDTV next      return 0x19 | 0x80;          case 0x76:    // MOS/CDTV rew      return 0x2e | 0x80;             // Map to volume down          case 0x77:    // MOS/CDTV ff      return 0x30 | 0x80;             // Map to volume up  }  return 0;}