High-Order ASCII Alphabet & Other Keyboard Edits

Mark Brownell gizmotron at earthlink.net
Sat Dec 20 14:04:08 CST 2003


On Saturday, December 20, 2003, at 10:11  AM, Rob Cozens wrote:

> There is an alphabet for every language.  There must be a way to 
> filter keyboard input to reject keys that are not part of the 
> alphabet, or a subset thereof.
>
> This is not an issue of key translation between two computers; rather 
> the focus is on filtering keyboard input on the user's computer to 
> reject keystrokes that are defined as illegal for the current input 
> field.
> -- 
>
> Rob Cozens

Rob,

I use a trick to find characters that are higher than ascii 127. I use 
a repeat loop to place all 255 numToChars(i) separated by a space into 
an off screen field. I then put the HTMLText of that field into a 
variable. I now have escape-sequences for these chars that I can use in 
an array created with the split function.

 From this :
Š š ¦ ­ ² ³ ¹  	
  ¼ ½
  ¾ Ð × Ý Þ ð ý þ       
 
 
    ! " # $ % & ' ( ) * + , - . / 0 
1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T 
U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x 
y z { | } ~  Ä Å Ç É Ñ Ö Ü á à â ä ã å ç é è ê ë í ì î ï ñ ó ò ô ö õ ú 
ù û ü † ° ¢ £ § • ¶ ß ® © ™ ´ ¨  Æ Ø  ±   ¥ µ      ª º  æ ø ¿ 
¡ ¬  ƒ   « » 
   À Ã Õ Œ œ – — “ ” ‘ ’ ÷ 
 ÿ Ÿ 
 ¤ ‹ › 
  ‡ · ‚ „ ‰ 
Â Ê Á Ë È Í Î Ï Ì Ó Ô € Ò Ú Û Ù  ˆ ˜ ¯  Ž  ¸   ž


I get this :
<p>Š š ¦ ­ &sup2; &sup3; &sup1;  	 </p>
<p> &frac14; &frac12; 
 &frac34; Ð × Ý Þ 
ð ý þ         
    ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 
9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y 
Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } 
~  Ä Å Ç É Ñ Ö Ü 
á à â ä ã å ç é 
è ê ë í ì î ï ñ 
ó ò ô ö õ ú ù û 
ü † ° ¢ £ § • ¶ ß ® 
© ™ ´ ¨  Æ Ø  ±  
 ¥ µ      ª º  
æ ø ¿ ¡ ¬  ƒ   
« » …   À Ã Õ Œ œ 
– — “ ” ‘ ’ ÷  ÿ Ÿ 
 ¤ ‹ ›   ‡ · ‚ „ 
‰ Â Ê Á Ë È Í Î Ï 
Ì Ó Ô € Ò Ú Û Ù 
 ˆ ˜ ¯  Ž  ¸   
ž </p>

With that I can create a char map for conversion between OS 
differences. Perhaps a char mapping process can help you set up a key 
control handler. This works for me because I'm using HTMLText to store 
data.

Mark



More information about the use-livecode mailing list