Script

  • April 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Script as PDF for free.

More details

  • Words: 1,849
  • Pages: 26
//Assign String typeOf for textF Varialbe. //textF Variable should assign to your text field. textF=""; //Determine if new character can stick to previous one function isStickable(charCode){ if(charCode==""||charCode==String.fromCharCode(0x0041)|| charCode==String.fromCharCode(0x0023)||charCode==String.fromCharCode(0x0042)|| charCode==String.fromCharCode(0x0043)||charCode==String.fromCharCode(0x0044)|| charCode==String.fromCharCode(0x0048)||charCode==String.fromCharCode(0x0049)|| charCode==String.fromCharCode(0x00AF)||charCode==String.fromCharCode(0x00B0)|| charCode==String.fromCharCode(0x00BB)||charCode==String.fromCharCode(0x00BC)|| charCode==String.fromCharCode(0x006A)||charCode==String.fromCharCode(0x006B)|| charCode==String.fromCharCode(0x006C)||charCode==String.fromCharCode(0x006D)|| charCode==String.fromCharCode(0x006E)||charCode==String.fromCharCode(0x006F)|| charCode==String.fromCharCode(0x0070)||charCode==String.fromCharCode(0x0071)|| charCode==String.fromCharCode(0x0072)||charCode==String.fromCharCode(0x0073)|| charCode==String.fromCharCode(0x002F)||charCode==String.fromCharCode(0x003F)|| charCode==String.fromCharCode(0x0021)||charCode==String.fromCharCode(0x0022)|| charCode==String.fromCharCode(0x0025)||charCode==String.fromCharCode(0x0028)|| charCode==String.fromCharCode(0x0029)||charCode==String.fromCharCode(0x002A)|| charCode==String.fromCharCode(0x002B)||charCode==String.fromCharCode(0x002C)|| charCode==String.fromCharCode(0x002D)||charCode==String.fromCharCode(0x002E)|| charCode==String.fromCharCode(0x0030)||charCode==String.fromCharCode(0x0031)|| charCode==String.fromCharCode(0x0032)||charCode==String.fromCharCode(0x0033)|| charCode==String.fromCharCode(0x0034)||charCode==String.fromCharCode(0x0035)|| charCode==String.fromCharCode(0x0036)||charCode==String.fromCharCode(0x0037)|| charCode==String.fromCharCode(0x0038)||charCode==String.fromCharCode(0x0039)|| charCode==String.fromCharCode(0x003A)||charCode==String.fromCharCode(0x003B)|| charCode==String.fromCharCode(0x003C)||charCode==String.fromCharCode(0x003D)|| charCode==String.fromCharCode(0x003E)||charCode==String.fromCharCode(0x0022)){ return false; }else { return true; } } function isSuper(charCode){ if(charCode==String.fromCharCode(0x00D1)|| charCode==String.fromCharCode(0x00D2)||charCode==String.fromCharCode(0x00D3)|| charCode==String.fromCharCode(0x00D4)||charCode==String.fromCharCode(0x00D5)|| charCode==String.fromCharCode(0x00D6)||charCode==String.fromCharCode(0x00D7)|| charCode==String.fromCharCode(0x00D8)||charCode==String.fromCharCode(0x00D9)|| charCode==String.fromCharCode(0x00DA)||charCode==String.fromCharCode(0x00DB)|| charCode==String.fromCharCode(0x00DC)||charCode==String.fromCharCode(0x00DE)|| charCode==String.fromCharCode(0x00DF)||charCode==String.fromCharCode(0x00E1)|| charCode==String.fromCharCode(0x00E2)||charCode==String.fromCharCode(0x00E3)|| charCode==String.fromCharCode(0x00E4)||charCode==String.fromCharCode(0x00E5)){ return true; }else{ return false; } }; //Convert character to Small Middle form on Persian Alphabet function toSmallMiddle(charCode){ switch (charCode){

//Cable Back Codes: //space case String.fromCharCode(0x0023): return String.fromCharCode(0x0023); break; //be case String.fromCharCode(0x004B): return String.fromCharCode(0x004C); break; //pe case String.fromCharCode(0x004F): return String.fromCharCode(0x0050); break; //te case String.fromCharCode(0x0053): return String.fromCharCode(0x0054); break; //se case String.fromCharCode(0x0057): return String.fromCharCode(0x0058); break; //jim case String.fromCharCode(0x005B): return String.fromCharCode(0x005C); break; //che case String.fromCharCode(0x005F): return String.fromCharCode(0x0060); break; //he case String.fromCharCode(0x0063): return String.fromCharCode(0x0064); break; //khe case String.fromCharCode(0x0067): return String.fromCharCode(0x0068); break; //sin case String.fromCharCode(0x0075): return String.fromCharCode(0x0076); break; //shin case String.fromCharCode(0x0079): return String.fromCharCode(0x007A); break; //sad case String.fromCharCode(0x007D):

return String.fromCharCode(0x007E); break; //zad case String.fromCharCode(0x201E): return String.fromCharCode(0x2026); break; //ta case String.fromCharCode(0x02C6): return String.fromCharCode(0x2030); break; //za case String.fromCharCode(0x0152): return String.fromCharCode(0x00CA); break; //ein case String.fromCharCode(0x201D): return String.fromCharCode(0x2022); break; //ghein case String.fromCharCode(0x02DC): return String.fromCharCode(0x2122); break; //fe case String.fromCharCode(0x0153): return String.fromCharCode(0x0178); break; //ghaf case String.fromCharCode(0x0A2): return String.fromCharCode(0x0A3); break; //kaf case String.fromCharCode(0x0A6): return String.fromCharCode(0x0A7); break; //gaf case String.fromCharCode(0x0AA): return String.fromCharCode(0x0AB); break; //lam case String.fromCharCode(0x00AE): return String.fromCharCode(0x00B1); break; //mim case String.fromCharCode(0x00B4): return String.fromCharCode(0x00B5); break;

//noon case String.fromCharCode(0x00B8): return String.fromCharCode(0x00B9); break; //heh case String.fromCharCode(0x00BE): return String.fromCharCode(0x00BF); break; //ye case String.fromCharCode(0x00C2): return String.fromCharCode(0x00C3); break; //ye hamzeh case String.fromCharCode(0x0045): return String.fromCharCode(0x0046); break;

}

//Error default: trace("Return N/A Small Middle Form!"); break;

} //Convert character to Small First form on Persian Alphabet function toSmallFirst(charCode){ switch (charCode){ //be case String.fromCharCode(0x004A): return String.fromCharCode(0x004D); break; //pe case String.fromCharCode(0x004E): return String.fromCharCode(0x0051); break; //te case String.fromCharCode(0x0052): return String.fromCharCode(0x0055); break; //se case String.fromCharCode(0x0056): return String.fromCharCode(0x0059); break; //jim case String.fromCharCode(0x005A): return String.fromCharCode(0x005D); break; //che case String.fromCharCode(0x005E):

return String.fromCharCode(0x0061); break; //he case String.fromCharCode(0x0062): return String.fromCharCode(0x0065); break; //khe case String.fromCharCode(0x0066): return String.fromCharCode(0x0069); break; //sin case String.fromCharCode(0x0074): return String.fromCharCode(0x0077); break; //shin case String.fromCharCode(0x0078): return String.fromCharCode(0x007B); break; //sad case String.fromCharCode(0x007C): return String.fromCharCode(0x201A); break; //zad case String.fromCharCode(0x0192): return String.fromCharCode(0x2020); break; //ta case String.fromCharCode(0x2021): return String.fromCharCode(0x0160); break; //za case String.fromCharCode(0x2039): return String.fromCharCode(0x00CB); break; //ein case String.fromCharCode(0x201C): return String.fromCharCode(0x2013); break; //ghein case String.fromCharCode(0x2014): return String.fromCharCode(0x0161); break; //fe case String.fromCharCode(0x203A): return String.fromCharCode(0x00A0); break;

//ghaf case String.fromCharCode(0x00A1): return String.fromCharCode(0x00A4); break; //kaf case String.fromCharCode(0x00A5): return String.fromCharCode(0x00A8); break; //gaf case String.fromCharCode(0x00A9): return String.fromCharCode(0x00AC); break; //lam case String.fromCharCode(0x00AD): return String.fromCharCode(0x00B2); break; //mim case String.fromCharCode(0x00B3): return String.fromCharCode(0x00B6); break; //noon case String.fromCharCode(0x00B7): return String.fromCharCode(0x00BA); break; //heh case String.fromCharCode(0x00BD): return String.fromCharCode(0x00C0); break; //ye case String.fromCharCode(0x00C1): return String.fromCharCode(0x00C4); break; //ye hamzeh case String.fromCharCode(0x0045): return String.fromCharCode(0x0047); break; //Error default: trace("Return N/A Small First Form!"); break; }

}

//Convert character to Capital Stickable form on Persian Alphabet function toCapitalSticked(charCode){ switch (charCode){ //be case String.fromCharCode(0x004C):

return String.fromCharCode(0x004B); break; //pe case String.fromCharCode(0x0050): return String.fromCharCode(0x004F); break; //te case String.fromCharCode(0x0054): return String.fromCharCode(0x0053); break; //se case String.fromCharCode(0x0058): return String.fromCharCode(0x0057); break; //jim case String.fromCharCode(0x005C): return String.fromCharCode(0x005B); break; //che case String.fromCharCode(0x0060): return String.fromCharCode(0x005F); break; //he case String.fromCharCode(0x0064): return String.fromCharCode(0x0063); break; //khe case String.fromCharCode(0x0068): return String.fromCharCode(0x0067); break; //sin case String.fromCharCode(0x0076): return String.fromCharCode(0x0075); break; //shin case String.fromCharCode(0x007A): return String.fromCharCode(0x0079); break; //sad case String.fromCharCode(0x007E): return String.fromCharCode(0x007D); break; //zad case String.fromCharCode(0x2026): return String.fromCharCode(0x201E); break;

//ta case String.fromCharCode(0x2030): return String.fromCharCode(0x02C6); break; //za case String.fromCharCode(0x00CA): return String.fromCharCode(0x0152); break; //ein case String.fromCharCode(0x2022): return String.fromCharCode(0x201D); break; //ghein case String.fromCharCode(0x2122): return String.fromCharCode(0x02DC); break; //fe case String.fromCharCode(0x0178): return String.fromCharCode(0x0153); break; //ghaf case String.fromCharCode(0x00A3): return String.fromCharCode(0x00A2); break; //kaf case String.fromCharCode(0x00A7): return String.fromCharCode(0x00A6); break; //gaf case String.fromCharCode(0x00AB): return String.fromCharCode(0x00AA); break; //lam case String.fromCharCode(0x00B1): return String.fromCharCode(0x00AE); break; //mim case String.fromCharCode(0x00B5): return String.fromCharCode(0x00B4); break; //noon case String.fromCharCode(0x00B9): return String.fromCharCode(0x00B8); break; //heh case String.fromCharCode(0x00BF): return String.fromCharCode(0x00BE);

break; //ye case String.fromCharCode(0x00C3): return String.fromCharCode(0x00C2); break; //ye hamzeh case String.fromCharCode(0x0046): return String.fromCharCode(0x0045); break;

}

//Error default: trace("Return N/A Capital Stickable Form!"); break;

} //Convert character to Capital Lonely form on Persian Alphabet function toCapitalLonely(charCode){ switch (charCode){ //be case String.fromCharCode(0x004D): return String.fromCharCode(0x004A); break; //pe case String.fromCharCode(0x0051): return String.fromCharCode(0x004E); break; //te case String.fromCharCode(0x0055): return String.fromCharCode(0x0052); break; //se case String.fromCharCode(0x0059): return String.fromCharCode(0x0056); break; //jim case String.fromCharCode(0x005D): return String.fromCharCode(0x005A); break; //che case String.fromCharCode(0x0061): return String.fromCharCode(0x005E); break; //he case String.fromCharCode(0x0065): return String.fromCharCode(0x0062); break;

//khe case String.fromCharCode(0x0069): return String.fromCharCode(0x0066); break; //sin case String.fromCharCode(0x0077): return String.fromCharCode(0x0074); break; //shin case String.fromCharCode(0x007B): return String.fromCharCode(0x0078); break; //sad case String.fromCharCode(0x201A): return String.fromCharCode(0x007C); break; //zad case String.fromCharCode(0x2020): return String.fromCharCode(0x0192); break; //ta case String.fromCharCode(0x0160): return String.fromCharCode(0x2021); break; //za case String.fromCharCode(0x00CB): return String.fromCharCode(0x2039); break; //ein case String.fromCharCode(0x2013): return String.fromCharCode(0x201C); break; //ghein case String.fromCharCode(0x0161): return String.fromCharCode(0x2014); break; //fe case String.fromCharCode(0x00A0): return String.fromCharCode(0x203A); break; //ghaf case String.fromCharCode(0x00A4): return String.fromCharCode(0x00A1); break; //kaf case String.fromCharCode(0x00A8): return String.fromCharCode(0x00A5);

break; //gaf case String.fromCharCode(0x0AC): return String.fromCharCode(0x0A9); break; //lam case String.fromCharCode(0x00B2): return String.fromCharCode(0x00AD); break; //mim case String.fromCharCode(0x00B6): return String.fromCharCode(0x00B3); break; //noon case String.fromCharCode(0x00BA): return String.fromCharCode(0x00B7); break; //heh case String.fromCharCode(0x00C0): return String.fromCharCode(0x00BD); break; //ye case String.fromCharCode(0x00C4): return String.fromCharCode(0x00C1); break; //ye hamzeh case String.fromCharCode(0x0047): return String.fromCharCode(0x0045); break; //Error default: trace("Return N/A Capital Lonely Form!"); break; }

}

//Base Object Defining PTypist = new Object(); shiftDetect = new Object(); //Main Typist Function that Trap User Keys and find specified Persian Character PTypist.onKeyDown = function () { //CodeViewer trace(Key.getCode()); c=0; if(isSuper(textF.charAt(0))){ for(i=1;i
}; //trace("Super is: "+c); switch(Key.getCode()){ //Controls case 8: if(textF.charAt(0)==String.fromCharCode(0x00AF)){ //Testing "LA" first form textF=String.fromCharCode(0x00AD)+textF.substr(1); }else if(textF.charAt(0)==String.fromCharCode(0x00B0)){ //Testing "LA" second form textF=String.fromCharCode(0x00AE)+textF.substr(1); }else{ //Testing other Stickable form textF=textF.substr(1); if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle if(toCapitalSticked(textF.charAt(0))==undefined){ textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); } textF=toCapitalSticked(textF.charAt(0))+textF.substr(1); }else{ //small first if(toCapitalLonely(textF.charAt(0))==undefined){ textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } textF=toCapitalLonely(textF.charAt(0))+textF.substr(1); } } } break; //Symbols case 191: if(isShift){ textF=String.fromCharCode(0x003F)+textF; }else{ textF=String.fromCharCode(0x002F)+textF; } break; case 49: if(isShift){ textF=String.fromCharCode(0x0021)+textF; }else{ textF=String.fromCharCode(0x0031)+textF; } break; case 50: textF=String.fromCharCode(0x0032)+textF; break; case 51: textF=String.fromCharCode(0x0033)+textF; break;

case 52: textF=String.fromCharCode(0x0034)+textF; break; case 53: if(isShift){ textF=String.fromCharCode(0x0025)+textF; }else{ textF=String.fromCharCode(0x0035)+textF; } break; case 54: textF=String.fromCharCode(0x0036)+textF; break; case 55: textF=String.fromCharCode(0x0037)+textF; break; case 56: if(isShift){ textF=String.fromCharCode(0x002A)+textF; }else{ textF=String.fromCharCode(0x0038)+textF; } break; case 57: if(isShift){ textF=String.fromCharCode(0x0028)+textF; }else{ textF=String.fromCharCode(0x0039)+textF; } break; case 48: if(isShift){ textF=String.fromCharCode(0x0029)+textF; }else{ textF=String.fromCharCode(0x0030)+textF; } break; case 187: if(isShift){ textF=String.fromCharCode(0x002B)+textF; }else{ textF=String.fromCharCode(0x003D)+textF; } break; case 189: if(isShift){ if(isStickable(textF.charAt(0))&&textF.charAt(0)!=String.fromCharCode(0x0040)){ if(isStickable(textF.charAt(1))){

//small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } } textF=String.fromCharCode(0x0040)+textF; }else{ textF=String.fromCharCode(0x002D)+textF; } break; //Dot case 190: textF=String.fromCharCode(0x002E)+textF; break; //shift case 16: trace("Shift Status:"); break; //space case 32: textF=String.fromCharCode(0x0023)+textF; break; //Alphabets //alef: case 72: if(isShift){ if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x0042)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x0041)+textF; } }else{ if(textF.charAt(0)==String.fromCharCode(0x00AD)|| textF.charAt(0)==String.fromCharCode(0x00B2)){ textF=String.fromCharCode(0x00AF)+textF.substr(1); } else if(textF.charAt(0)==String.fromCharCode(0x00AE)|| textF.charAt(0)==String.fromCharCode(0x00B1)){ textF=String.fromCharCode(0x00B0)+textF.substr(1); }else{ if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle

textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x0049)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x0048)+textF; } } } break; //be: case 70: if(isShift){ textF=String.fromCharCode(0x00D8)+textF; }else{ if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x004B)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x004A)+textF; } } break; //pe: case 192: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x004F)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x004E)+textF; } break; //te: case 74: if(isStickable(textF.charAt(0))){

if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x0053)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x0052)+textF; } break; //se: case 69: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x0057)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x0056)+textF; } break; //jim: case 219: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x005B)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x005A)+textF; } break; //che: case 221: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{

//small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x005F)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x005E)+textF; } break; //he: case 80: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x0063)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x0062)+textF; } break; //khe: case 79: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x0067)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x0066)+textF; } break; //dal: case 78: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked

textF=String.fromCharCode(0x006B)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x006A)+textF; } break; //zal: case 66: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x006D)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x006C)+textF; } break; //re: case 86: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x006F)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x006E)+textF; } break; //ze: case 67: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x0071)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x0070)+textF;

} break; //zhe: case 220: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x0073)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x0072)+textF; } break; //sin: case 83: if(isShift){ textF=String.fromCharCode(0x00D4)+textF; }else{ if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x0075)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x0074)+textF; } } break; //shin: case 65: if(isShift){ textF=String.fromCharCode(0x00D2)+textF; }else{ if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x0079)+textF;

}else{ //Lonely Capital textF=String.fromCharCode(0x0078)+textF; } } break; //sad: case 87: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x007D)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x007C)+textF; } break; //zad: case 81: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x201E)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x0192)+textF; } break; //ta: case 88: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x02C6)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x2021)+textF;

} break; //za: case 90: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x0152)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x2039)+textF; } break; //ein: case 85: if(isShift){ textF=String.fromCharCode(0x002C)+textF; }else{ if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x201D)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x201C)+textF; } } break; //ghein: case 89: if(isShift){ textF=String.fromCharCode(0x003B)+textF; }else{ if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x02DC)+textF;

}else{ //Lonely Capital textF=String.fromCharCode(0x2014)+textF; } } break; //fe: case 84: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x0153)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x203A)+textF; } break; //ghaf: case 82: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x00A2)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x00A1)+textF; } break; //kaf: case 186: if(isShift){ textF=String.fromCharCode(0x003A)+textF; }else{ if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x00A6)+textF;

}else{ //Lonely Capital textF=String.fromCharCode(0x00A5)+textF; } } break; //gaf: case 222: if(isShift){ textF=String.fromCharCode(0x0022)+textF; }else{ if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x00AA)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x00A9)+textF; } } break; //lam: case 71: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x00AE)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x00AD)+textF; } break; //mim: case 76: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked

textF=String.fromCharCode(0x00B4)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x00B3)+textF; } break; //noon: case 75: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x00B8)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x00B7)+textF; } break; //vav: case 188: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x00BC)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x00BB)+textF; } break; //heh: case 73: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x00BE)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x00BD)+textF;

} break; //ye: case 68: if(isShift){ textF=String.fromCharCode(0x00DF)+textF; }else{ if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x00C2)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x00C1)+textF; } } break; //ye hamzeh: case 77: if(isStickable(textF.charAt(0))){ if(isStickable(textF.charAt(1))){ //small middle textF=toSmallMiddle(textF.charAt(0))+textF.substr(1); }else{ //small first textF=toSmallFirst(textF.charAt(0))+textF.substr(1); } //Capital Sticked textF=String.fromCharCode(0x0045)+textF; }else{ //Lonely Capital textF=String.fromCharCode(0x0045)+textF; } break;

} };

default: trace("Error: Unknown Key Code Recieved!"); break;

//Shift Detectors shiftDetect.onKeyDown = function () { if(Key.getCode()==16){ isShift=true; trace("shifted"); } }; shiftDetect.onKeyUp = function () {

};

if(Key.getCode()==16){ isShift=false; trace("unshifted"); }

//Assign listener to specified Objects: Key.addListener(PTypist); Key.addListener(shiftDetect); //This .as file should attack to specified .fla file to work with an Text field and variable,

Related Documents

Script
October 2019 23
Script
April 2020 14
Script
November 2019 18
Script
November 2019 15
Script
October 2019 42
Script
October 2019 52