[net.sources.mac] dvorak fkey

tim@ism780c.UUCP (Tim Smith) (10/07/86)

Here is an FKEY to switch between a qwerty keyboard layout and a
Dvorak keyboard layout.  The Dvorak layout is the one described
in the October 1986 MacWorld.

The difference between this layout and other Dvorak layouts is that
this one keeps shifted keys with the same un-shifted keys that they
are on under the Mac qwerty layout.

Option keys stay at the same place on the keyboard.  For example,
circle-c, which is option-G on the qwerty keyboard, is option-I on
the Dvorak keyboard.  On the other hand, keyboard shortcuts for
menus do move.

Install by pasting into System with a resource editor ( renumbering
if you already have an FKEY 9 ).  This FKEY has the header that the
DotP Fkey installer expects, but since I don't have that program,
I don't know if it will work.  In particular, the file type or creator
might not be what that program expects.

---------------------- Cut Here .... ---------------------------
(This file must be converted with BinHex 4.0)

:#f4fEh*KDb"QDf9j!%e%48C0680$!*!)!h$+N3#3"!%!N!-$-!!!!M!!N!0!F'*
eEQa[BfYbB3S+F'*cCA4MBA4TEJT`G'pMFh4b#Q-,C(C[FQ&V)'CVCAN#!*!$684
&4Ne03d-"!!#!!*!$'!!!684&4Ne03d-"!!#!!*!$'!#%!*!1Qk[(e!#3"J0`#JT
IBQPZB@4N#PpLD@jKFRN+#PpLD@jbC@d+Af*TEQ&bH3S+Af*TER4cG!TIBQPZBA*
j#JT[F'9Z#QGPG(*PCQjeE3TRCA4NDA*TC!TPFR*ZE`TIBQPZB@4N#P"#6h"PEJT
`BQK[F'9Z#JTTEQPd,Qm+#J!")5!!"&pTEQPd#JTIB3!!!LaJ#J!!4NY&@3!*!!"
)jrrm6VS!#%cI2rp1G8j@!!")j`%`5IS"qL"m!!!#RLC33NGJ!!%1%"2!I!$rX(`
!B@B!!(B3+`!"`(`!rl"m!(0Q!!"Q%#X!!X"m!2q`I!"NCJ!!9K!V!!2!I!$rX(`
!CQB!!%B3+`!%`(`!rl"m!'KQ!!!f%#X!"F"m!2q`I!"RCJ!!*K!V!!E!I!$rX(`
!HQB!!"B3+`!(`(`!rl"m!(KQ!!!'B!!!P"!6`(`!rl"m!'&Q!!"f%#X!!F"m!2q
`I!"[CJ!!CK!V!!,!I!$rX(`!C@B!!&B3+`!$`(`!rl"m!(9Q!!"'%#X!"-"m!2q
`I!"NCJ!!0K!V!!A!I!$rX(`!D@B!!#B3+`!'`(`!rl"m!$YQ!!!@%#X!"m"m!2q
`I!"aCJ!!"Q!!!")`"e*()!Y5L`a(#!"Y!2lZ$%F)!'d!!"!r2!!"6VS!b&52B!!
!)%(XrfBN5%*(B!!!$"!D`(`!rl%E8NF-4`#DE3$rm%cI$)"1ANje!"`"%``133N
*(3!D9PY,!Km0!*!'B!!!GJ!!B"d5G!SF!!)##Kp)!&Y9$!"B!*!'(!%6$!jJ#3N
G!"TcDhX#(`d!N!C@!!!N!!"@(4*%#K`!!J*p(fN!Df8-!'J!N!BF!4--$Q%*#4d
!'RClD`)I$3#3"Q!!!(B!!'!G%R3r(!!#!JSID!"lG3`!H%j@!!!r,J!)UFK1ANj
e!!!"!*!$!c!!!!)`!*!$3!!#Hl3#0J#3!a`!-J!!4NY&@3#3!`S!#3#3"`,LMJe
NGQpbB@X[FAGPFR4jF"S:
---------------------- ...and here...  -------------------------

/*
 * This is in Megamax C.
 *
 * Tell mmlink to produce a MDEF or CDEF.  Use ResEdit to move the code
 * produced from the MDEF or CDEF into an FKEY.
 */
unsigned char table[154];

asm {
      BRA.S       start(PC)
      DC.W        0
      DC.B        'F','K','E','Y'
      DC.W        9
      DC.W        0
start:
      MOVEM.L     D0-D7/A0-A5,-(A7)
      JSR         doit(PC)
      MOVEM.L     (A7)+,D0-D7/A0-A5
      RTS
doit:
}

remap() {
      register unsigned char * b;
      register unsigned char * n;
      register int i;

      asm {
	    LEA         myvars(PC), A4          /* set up my variables */
      }
      
      b = *(unsigned char **)0x29e;             /* key1trans */
      
      for ( i = 0; i < 0x800; i++,b++ ) {
            if ( b[0] == 'a' && b[1] == 's' && b[2] == 'd' && b[3] == 'f'
            &&   b[4] == 'h' && b[5] == 'g' && b[6] == 'z' && b[7] == 'x' )
                  break;
            if ( b[0] == 'a' && b[1] == 'o' && b[2] == 'e' && b[3] == 'u'
            &&   b[4] == 'd' && b[5] == 'i' && b[6] == ';' && b[7] == 'q' )
                  break;
      }
      if ( i >= 0x800 ) {
            SysBeep(1); return;
      }
       
      n = &table[0];
      for ( i = 0; i < 154; i++ )
            *b++ ^= *n++;
}

asm {
begin:                              /* if there is no label here, then there
                                       will be a problem with compiler
                                       generated local labels */
      dc.b  'a' ^ 'a'
      dc.b  's' ^ 'o'
      dc.b  'd' ^ 'e'
      dc.b  'f' ^ 'u'
      dc.b  'h' ^ 'd'
      dc.b  'g' ^ 'i'
      dc.b  'z' ^ ';'
      dc.b  'x' ^ 'q'
      dc.b  'c' ^ 'j'
      dc.b  'v' ^ 'k'
      
      dc.b  0
      dc.b  'b' ^ 'x'
      dc.b  'q' ^ 0x27
      dc.b  'w' ^ ','
      dc.b  'e' ^ '.'
      dc.b  'r' ^ 'p'
      dc.b  'y' ^ 'f'
      dc.b  't' ^ 'y'
      dc.b  0
      dc.b  0
      
      dc.b  0
      dc.b  0
      dc.b  0
      dc.b  0
      dc.b  '=' ^ ']'
      dc.b  0
      dc.b  0
      dc.b  '-' ^ '['
      dc.b  0
      dc.b  0
      
      dc.b  ']' ^ '='
      dc.b  'o' ^ 'r'
      dc.b  'u' ^ 'g'
      dc.b  '[' ^ '/'
      dc.b  'i' ^ 'c'
      dc.b  'p' ^ 'l'
      dc.b  0
      dc.b  'l' ^ 'n'
      dc.b  'j' ^ 'h'
      dc.b  0x27 ^ '-'
      
      dc.b  'k' ^ 't'
      dc.b  ';' ^ 's'
      dc.b  0
      dc.b  ',' ^ 'w'
      dc.b  '/' ^ 'z'
      dc.b  'n' ^ 'b'
      dc.b  'm' ^ 'm'
      dc.b  '.' ^ 'v'
      dc.b  0
      dc.b  0
      
      dc.b  0
      dc.b  0
      dc.b  0
      dc.b  'A' ^ 'A'
      dc.b  'S' ^ 'O'
      dc.b  'D' ^ 'E'
      dc.b  'F' ^ 'U'
      dc.b  'H' ^ 'D'
      dc.b  'G' ^ 'I'
      dc.b  'Z' ^ ':'
      
      dc.b  'X' ^ 'Q'
      dc.b  'C' ^ 'J'
      dc.b  'V' ^ 'K'
      dc.b  0
      dc.b  'B' ^ 'X'
      dc.b  'Q' ^ '"'
      dc.b  'W' ^ '<'
      dc.b  'E' ^ '>'
      dc.b  'R' ^ 'P'
      dc.b  'Y' ^ 'F'
      
      dc.b  'T' ^ 'Y'
      dc.b  0
      dc.b  0
      dc.b  0
      dc.b  0
      dc.b  0
      dc.b  0
      dc.b  '+' ^ '}'
      dc.b  '(' ^ '('
      dc.b  0
      
      dc.b  '_' ^ '{'
      dc.b  0
      dc.b  0
      dc.b  '}' ^ '+'
      dc.b  'O' ^ 'R'
      dc.b  'U' ^ 'G'
      dc.b  '{' ^ '?'
      dc.b  'I' ^ 'C'
      dc.b  'P' ^ 'L'
      dc.b  0
      
      dc.b  'L' ^ 'N'
      dc.b  'J' ^ 'H'
      dc.b  '"' ^ '_'
      dc.b  'K' ^ 'T'
      dc.b  ':' ^ 'S'
      dc.b  0
      dc.b  '<' ^ 'W'
      dc.b  '?' ^ 'Z'
      dc.b  'N' ^ 'B'
      dc.b  'M' ^ 'M'
      
      dc.b  '>' ^ 'V'
      dc.b  0
      dc.b  0
      dc.b  0
      dc.b  0
      dc.b  0
      dc.b  'A' ^ 'A'
      dc.b  'S' ^ 'O'
      dc.b  'D' ^ 'E'
      dc.b  'F' ^ 'U'
      
      dc.b  'H' ^ 'D'
      dc.b  'G' ^ 'I'
      dc.b  'Z' ^ ';'
      dc.b  'X' ^ 'Q'
      dc.b  'C' ^ 'J'
      dc.b  'V' ^ 'K'
      dc.b  0
      dc.b  'B' ^ 'X'
      dc.b  'Q' ^ 0x27
      dc.b  'W' ^ ','
      
      dc.b  'E' ^ '.'
      dc.b  'R' ^ 'P'
      dc.b  'Y' ^ 'F'
      dc.b  'T' ^ 'Y'
      dc.b  0
      dc.b  0
      dc.b  0
      dc.b  0
      dc.b  0
      dc.b  0
      
      dc.b  '=' ^ ']'
      dc.b  0
      dc.b  0
      dc.b  '-' ^ '['
      dc.b  0
      dc.b  0
      dc.b  ']' ^ '='
      dc.b  'O' ^ 'R'
      dc.b  'U' ^ 'G'
      dc.b  '[' ^ '/'
      
      dc.b  '|' ^ 'C'
      dc.b  'P' ^ 'L'
      dc.b  0
      dc.b  'L' ^ 'N'
      dc.b  'J' ^ 'H'
      dc.b  0x27 ^ '-'
      dc.b  'K' ^ 'T'
      dc.b  ';' ^ 'S'
      dc.b  0
      dc.b  ',' ^ 'W'
      
      dc.b  '/' ^ 'Z'
      dc.b  'N' ^ 'B'
      dc.b  'M' ^ 'M'
      dc.b  '.' ^ 'V'
myvars:
}
---------------------- ...and here --- -------------------------
-- 
member, all HASA divisions              POELOD  ECBOMB
					--------------
					       ^-- Secret Satanic Message

Tim Smith       USENET: sdcrdcf!ism780c!tim   Compuserve: 72257,3706
		Delphi or GEnie: mnementh