Вторник, 11.12.2018, 16:48
Приветствую Вас, Гость
Главная » Файлы » Скрипты uCoz

Экранная клавиатура
17.01.2010, 00:12


Скрипт экранной клавиатуры с основными клавишами.

Это ставим в head:

Code
<script language="JavaScript"><!-- Start  
   
var lineHTML = "";  
var lock = 1;  
var uca = 0;  
var initial = 0;  
var filter = /[a-z]/  

function rkey()  
{  
lineHTML = "";  
this.disp.value = lineHTML;  
}  

function skey(i) // GroЯschreibung  
{  
if (i == "uc")  
{  
uca = 1;  
this.capsdisp.value = "Abc";  
}  

if (i == "caps")  
{  
lock = (lock * -1);  
if (lock < 0)  
{  
this.lockdisp.value = "ABC";  
}  
if (lock > 0)  
{  
this.lockdisp.value = "";  
}  
}  
}  

function zkey(i) // Zeichen  
{  
if ((i == ",") && (uca == 1))  
{  
i = ";"  
}  
if ((i == ".") && (uca == 1))  
{  
i = ":"  
}  
if ((i == "-") && (uca == 1))  
{  
i = "_"  
}  
if ((i == "+") && (uca == 1))  
{  
i = "*"  
}  
lineHTML += i;  
this.disp.value = lineHTML;  
uca = 0;  
this.capsdisp.value = "";  
}  

function ukey(i)  
{  
if ((i == "д") && ((uca == 1) || (lock < 0)))  
{  
i = "Д";  
}  
if ((i == "ц") && ((uca == 1) || (lock < 0)))  
{  
i = "Ц";  
}  
if ((i == "ь") && ((uca == 1) || (lock < 0)))  
{  
i = "Ь";  
}  

lineHTML += i;  
this.disp.value = lineHTML;  
uca = 0;  
this.capsdisp.value = "";  
}  

function nkey(i) // normale Zeichen  
{  

if ((uca == 1) && (filter.test(i)))  
{  
i = i.toUpperCase();  
}  
if ((lock < 0) && (filter.test(i)))  
{  
i = i.toUpperCase();  
}  
lineHTML += i;  
this.disp.value = lineHTML;  
uca = 0;  
this.capsdisp.value = "";  
}  

function fkey(i) {  
//alert("Funktionstaste!");  
if (i == "bs")  
{  
lineHTML = lineHTML.slice(0, (lineHTML.length-1));  
}  
this.disp.value = lineHTML;  
}  

function ekey()  
{  
// alert("der Ausdruck " + lineHTML + " wird abgeschickt");  
opener.vollsuche.test.value = lineHTML;  

window.close();  
}  

</SCRIPT>  
   
<style>  
.cabutt  
{background-color: grey; color: black; width: 100%; height: 26;  
  position: relative; border-style: outset; border-color: whitesmoke}  
</style>

Это в body:

Code
<table border="0" cellspacing="0" cellpadding="1">  
  <tbody><tr>  
  <td colspan="12">  
  <center>  
  <input type="text" name="disp" size="60" maxlength="90" value=" ">  
  </center>  
  </td>  
  </tr>  
  <tr>  
  <td colspan="12">  
   
  </td>  
  </tr>  
   
  <tr>  
  <td>  
  <input class="cabutt" type="button" value=" 1 " onclick="nkey(1)">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" 2 " onclick="nkey(2)">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" 3 " onclick="nkey(3)">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" 4 " onclick="nkey(4)">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" 5 " onclick="nkey(5)">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" 6 " onclick="nkey(6)">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" 7 " onclick="nkey(7)">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" 8 " onclick="nkey(8)">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" 9 " onclick="nkey(9)">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" 0 " onclick="nkey(0)">  
  </td>  
  <td colspan="2">  
  <input class="cabutt" type="button" value=" ← " onclick="fkey('bs')">  
  </td>  
  </tr>  
  <tr>  
  <td>  
  <input class="cabutt" type="button" value=" Q " onclick="nkey('q')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" W " onclick="nkey('w')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" E " onclick="nkey('e')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" R " onclick="nkey('r')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" T " onclick="nkey('t')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" Z " onclick="nkey('z')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" U " onclick="nkey('u')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" I " onclick="nkey('i')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" O " onclick="nkey('o')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" P " onclick="nkey('p')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" Ь " onclick="ukey('ь')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" + " onclick="zkey('+')">  
  </td>  
  </tr>  
  <tr>  
  <td>  
  <input class="cabutt" type="button" value="Caps" onclick="skey('caps')">  
   
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" A " onclick="nkey('a')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" S " onclick="nkey('s')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" D " onclick="nkey('d')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" F " onclick="nkey('f')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" G " onclick="nkey('g')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" H " onclick="nkey('h')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" J " onclick="nkey('j')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" K " onclick="nkey('k')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" L " onclick="nkey('l')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" Ц " onclick="ukey('ц')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" Д " onclick="ukey('д')">  
  </td>  
  </tr>  
  <tr>  
  <td colspan="2">  
  <input class="cabutt" type="button" value=" ↑ " onclick="skey('uc')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" Y " onclick="nkey('y')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" X " onclick="nkey('x')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" C " onclick="nkey('c')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" V " onclick="nkey('v')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" B " onclick="nkey('b')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" N " onclick="nkey('n')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" M " onclick="nkey('m')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" , " onclick="zkey(',')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" . " onclick="zkey('.')">  
  </td>  
  <td>  
  <input class="cabutt" type="button" value=" - " onclick="zkey('-')">  
  </td>  
  </tr>  
  <tr>  
  <td>  
  <center>  
  <input type="text" name="capsdisp" size="3" maxlength="4" value="">  
  </center>  
  </td>  
  <td>  
  <center>  
  <input type="text" name="lockdisp" size="3" maxlength="4" value=" ">  
  </center>  
  </td>  
  <td colspan="8">  
  <input class="cabutt" type="button" value=" " onclick="nkey(' ')">  
  </td>  
  <td colspan="2">  
  <input class="cabutt" type="button" value="Enter" onclick="ekey()">  
  </td>  
  </tr>  
  </tbody></table>
 


Источник/Автор: неизвестен
Категория: Скрипты uCoz | Добавил: chebur
Просмотров: 683 | Загрузок: 0 | Рейтинг: 0.0/0
Всего комментариев: 0
Добавлять комментарии могут только зарегистрированные пользователи.
[ Регистрация | Вход ]