/* * CKMKE2.C * * Key-Config is a keyboard configurator program for use with Columbia's * MacKermit. * * Bill Schilit, April 1985 * * * Copyright (C) 1985, Trustees of Columbia University in the City of * New York. Permission is granted to any individual or institution to * use, copy, or redistribute this software so long as it is not sold * for profit, provided this copyright notice is retained. * */ #include "mac/quickdraw.h" /* order does matter */ #include "mac/osintf.h" /* on these... */ #include "mac/toolintf.h" #include "mac/packintf.h" #include "ckmkey.h" #include "ckmkkc.h" #include Rect kbbox,smallbox; int keymods = 0, /* current modifiers from keyboard */ butmods = 0, /* current modifiers from button */ keysel = KC_NUN, /* selected key */ kbselected = TRUE; /* kb or text is active */ struct KEYCODE { int kcode; /* key code */ int krow; /* row and column on keyboard */ int kcol; int ksize; /* horizontal key size */ int khpos; /* horizontal position */ char *kname; /* key name */ Rect krect; } keycodes[] = { {0x32,1,1,R1,0,"`"},{0x12,1,2,R1,R1,"1"}, /* `1 */ {0x13,1,3,R1,2*R1,"2"},{0x14,1,4,R1,3*R1,"3"}, /* 23 */ {0x15,1,5,R1,4*R1,"4"},{0x17,1,6,R1,5*R1,"5"}, /* 45 */ {0x16,1,7,R1,6*R1,"6"},{0x1A,1,8,R1,7*R1,"7"}, /* 67 */ {0x1C,1,9,R1,8*R1,"8"},{0x19,1,10,R1,9*R1,"9"}, /* 89 */ {0x1D,1,11,R1,10*R1,"0"},{0x1B,1,12,R1,11*R1,"-"}, /* 0- */ {0x18,1,13,R1,12*R1,"="},{0x33,1,14,R2,13*R1,"Backspace"}, /* = */ {0x30,2,1,R2,0,"Tab"},{0x0C,2,2,R1,R2,"Q"}, /* Q */ {0x0D,2,3,R1,R1+R2,"W"},{0x0E,2,4,R1,2*R1+R2,"E"}, /* WE */ {0x0F,2,5,R1,3*R1+R2,"R"},{0x11,2,6,R1,4*R1+R2,"T"}, /* RT */ {0x10,2,7,R1,5*R1+R2,"Y"},{0x20,2,8,R1,6*R1+R2,"U"}, /* YU */ {0x22,2,9,R1,7*R1+R2,"I"},{0x1F,2,10,R1,8*R1+R2,"O"}, /* IO */ {0x23,2,11,R1,9*R1+R2,"P"},{0x21,2,12,R1,10*R1+R2,"["}, /* P[ */ {0x1E,2,13,R1,11*R1+R2,"]"},{0x2A,2,14,R1,12*R1+R2,"\\"}, /* ]\ */ {KC_KLK,3,1,R3,0,"Caps lock"}, /* */ {0x00,3,2,R1,R3,"A"},{0x01,3,3,R1,R1+R3,"S"}, /* AS */ {0x02,3,4,R1,2*R1+R3,"D"},{0x03,3,5,R1,3*R1+R3,"F"}, /* DF */ {0x05,3,6,R1,4*R1+R3,"G"},{0x04,3,7,R1,5*R1+R3,"H"}, /* GH */ {0x26,3,8,R1,6*R1+R3,"J"},{0x28,3,9,R1,7*R1+R3,"K"}, /* JK */ {0x25,3,10,R1,8*R1+R3,"L"},{0x29,3,11,R1,9*R1+R3,";"}, /* L; */ {0x27,3,12,R1,10*R1+R3,"'"},{0x24,3,13,R3,11*R1+R3,"Return"}, /* ' */ {KC_SHF,4,1,R4,0,"Shift"}, /* */ {0x06,4,2,R1,R4,"Z"},{0x07,4,3,R1,R1+R4,"X"}, /* ZX */ {0x08,4,4,R1,2*R1+R4,"C"},{0x09,4,5,R1,3*R1+R4,"V"}, /* CV */ {0x0B,4,6,R1,4*R1+R4,"B"},{0x2D,4,7,R1,5*R1+R4,"N"}, /* BN */ {0x2E,4,8,R1,6*R1+R4,"M"},{0x2B,4,9,R1,7*R1+R4,","}, /* M, */ {0x2F,4,10,R1,8*R1+R4,"."},{0x2C,4,11,R1,9*R1+R4,"/"}, /* ./ */ {KC_SHF,4,12,R4,10*R1+R4,"Shift"}, /* */ {KC_OPT,5,1,R1,R1,"Option"}, /*