if (!empty($_REQUEST["w"])) $w=stripslashes($_REQUEST["w"]); else $w=implode("",file("../Enti-key15.klc")); ?>
#echo(dechex(ord("'")));die; include("keys2.php"); foreach($u2g as $c){ $key[strtolower($c[1])]=$c; } include("keys.php"); foreach($cmap as $c){ $key[strtolower($c[1])]=$c; } foreach(explode("\n",$w) as $l){ /* 0 //Column 4 1 //Column 5 : Shft 2 //Column 6 : Ctrl 6 //Column 7 : Ctrl Alt 7 //Column 8 : Shft Ctrl Alt LAYOUT ;an extra @ at the end is a dead key //SC VK_ Cap 0 1 2 6 7 */ $p=preg_match_all("/^([\dabcdef]+?)\s+(.*?)\t+(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*?)$/",$l,$out); #var_dump($out); // keycode 0x29 = o F f $new=dechex(hexdec($out[1][0])+8); if (strlen($new)==1) $new="0".$new; $norm=$out[4][0]; $shift=$out[5][0]; $ctrl=$out[6][0]; $altgr=$out[7][0]; $altshift=$out[8][0]; if (strstr($altgr,"@")){ $altgr=str_replace("@","",$altgr); $altgr_dedkey=TRUE; }else $altgr_dedkey=FALSE; if (strlen($altgr)>=4 ) { $altgrtranslated=chr(hexdec($altgr)); $altgr=$key[$altgr][2]; } else { $altgrtranslated=$altgr; } if (strstr($norm,"@")){ $norm=str_replace("@","",$norm); $norm_dedkey=TRUE; }else $norm_dedkey=FALSE; if (strlen($norm)>=4 ) { $normtranslated =chr(hexdec($norm)); $norm=$key[$norm][2]; } else { $normtranslated=$norm; } if (strstr($shift,"@")){ $shift=str_replace("@","",$shift); $shift_dedkey=TRUE; }else $shift_dedkey=FALSE; if (strlen($shift)>=4 ) { $shifttranslated=chr(hexdec($shift)); if ($key[$shift][2]) $shift=$key[$shift][2]; } else { $shifttranslated=$shift; } if (strstr($altshift,"@")){ $altshift=str_replace("@","",$altshift); $altshift_dedkey=TRUE; }else $altshift_dedkey=FALSE; if (strlen($altshift)>=4 ) { $altshifttranslated=chr(hexdec(trim($altshift))); if ($key[$altshift][2]) $altshift=$key[$altshift][2]; } else { $altshifttranslated=$altshift; } if($altgr=="-1") $altgr=""; if($altshift=="-1") $altshift=""; if (!empty($p)) { echo "! ".trim($out[0][0])." (norm='".$normtranslated."', shift='".$shifttranslated."', AltGr='".$altgrtranslated."', AltGr+shift='".$altshifttranslated."')\nkeycode 0x".($new)." = ".$norm." ".$shift." ".$altgr." ".$altshift." ".$altgr." ".$altshift."\n"; if ($norm_dedkey) echo "! $normtranslated is a deadkey\n"; if ($shift_dedkey) echo "! $shifttranslated is a deadkey\n"; if ($altgr_dedkey) echo "! $altgrtranslated is a deadkey\n"; if ($altshift_dedkey) echo "! $altshifttranslated is a deadkey\n"; } else { echo "! $l "; } } ?> ?>
source of this script