日期:2014-05-16 浏览次数:20667 次
/* ********************************************************************
**********************************************************************
* HTML Virtual Keyboard Interface Script - v1.40
* Copyright (c) 2010 - GreyWyvern
*
* - Licenced for free distribution under the BSDL
* http://www.opensource.org/licenses/bsd-license.php
*
* Add a script-driven keyboard interface to text fields, password
* fields and textareas.
*
* See http://www.greywyvern.com/code/javascript/keyboard for examples
* and usage instructions.
*
* Version 1.40 - September 30, 2010
* - Fix issue with spaced-out comma keys
* - Added a bit more cascade-prevention CSS
* - Clear Shift/Alt keys when Caps/AltLk key is pressed
* - Fix double-click bugginess in Firefox
*
* See full changelog at:
* http://www.greywyvern.com/code/javascript/keyboard.changelog.txt
*
* Keyboard Credits
* - Dari keyboard layout by Saif Fazel
* - Kurdish keyboard layout by Ara Qadir
* - Assamese keyboard layout by Kanchan Gogoi
* - Bulgarian BDS keyboard layout by Milen Georgiev
* - Basic Japanese Hiragana/Katakana keyboard layout by Damjan
* - Ukrainian keyboard layout by Dmitry Nikitin
* - Macedonian keyboard layout by Damjan Dimitrioski
* - Pashto keyboard layout by Ahmad Wali Achakzai (qamosona.com)
* - Armenian Eastern and Western keyboard layouts by Hayastan Project (www.hayastan.co.uk)
* - Pinyin keyboard layout from a collaboration with Lou Winklemann
* - Kazakh keyboard layout by Alex Madyankin
* - Danish keyboard layout by Verner Kj忙rsgaard
* - Slovak keyboard layout by Daniel Lara (www.learningslovak.com)
* - Belarusian, Serbian Cyrillic and Serbian Latin keyboard layouts by Evgeniy Titov
* - Bulgarian Phonetic keyboard layout by Samuil Gospodinov
* - Swedish keyboard layout by H氓kan Sandberg
* - Romanian keyboard layout by Aurel
* - Farsi (Persian) keyboard layout by Kaveh Bakhtiyari (www.bakhtiyari.com)
* - Burmese keyboard layout by Cetanapa
* - Slovenian keyboard layout by Miran Zeljko
* - Hungarian keyboard layout by Antal Sall 'Hiromacu'
* - Arabic keyboard layout by Srinivas Reddy
* - Italian and Spanish (Spain) keyboard layouts by dictionarist.com
* - Lithuanian and Russian keyboard layouts by Ramunas
* - German keyboard layout by QuHno
* - French keyboard layout by Hidden Evil
* - Polish Programmers layout by moose
* - Turkish keyboard layouts by offcu
* - Dutch and US Int'l keyboard layouts by jerone
*
*/
var VKI_attach, VKI_close;
function VKI_buildKeyboardInputs() {
var self = this;
this.VKI_version = "1.40";
this.VKI_showVersion = true;
this.VKI_target = false;
this.VKI_shift = this.VKI_shiftlock = false;
this.VKI_altgr = this.VKI_altgrlock = false;
this.VKI_dead = false;
this.VKI_deadkeysOn = false;
this.VKI_kts = this.VKI_kt = "US Int'l"; // Default keyboard layout
this.VKI_langAdapt = true; // Use lang attribute of input to select keyboard
this.VKI_size = 2; // Default keyboard size (1-5)
this.VKI_sizeAdj = true; // Allow user to adjust keyboard size
this.VKI_clearPasswords = false; // Clear password fields on focus
this.VKI_imageURI = "keyboard.png"; // If empty string, use imageless mode
this.VKI_clickless = 0; // 0 = disabled, > 0 = delay in ms
this.VKI_keyCenter = 3;
this.VKI_isIE = /*@cc_on!@*/false;
this.VKI_isIE6 = /*@if(@_jscript_version == 5.6)!@end@*/false;
this.VKI_isIElt8 = /*@if(@_jscr