来自 服务器&运维 2019-12-04 16:28 的文章
当前位置: 澳门威尼斯人平台 > 服务器&运维 > 正文

深入理解JSON数据源格式_javascript技巧_脚本之家

整理了一份JSON格式的键盘编码对照表。欢迎转载,但请注明出处,谢谢!

JSON格式的键盘编码对照表,json编码对照表

整理了一份JSON格式的键盘编码对照表。欢迎转载,但请注明出处,谢谢!

{

    VK_BACK: 8, //退格键

    VK_TAB: 9, //TAB键

    VK_RETURN: 13, //回车键

    VK_SHIFT: 16, //Shift键

    VK_CONTROL: 17, //Ctrl键

    VK_MENU: 18, //Alt键

    VK_PAUSE: 19, //Pause Break键

    VK_CAPITAL: 20, //Caps Lock键

    VK_SPACE: 32, //空格键    

    VK_PRIOR: 33, //Page Up

    VK_NEXT: 34, //Page Down

    VK_END: 35, //End键

    VK_HOME: 36, //Home键    

    VK_LEFT: 37, //方向键:←

    VK_UP: 38, //方向键:↑

    VK_RIGHT: 39, //方向键:→

    VK_DOWN: 40, //方向键:↓

    VK_INSERT: 45, //Insert键

    VK_DELETE: 46, //Delete键

    //字母表
    VK_A: 65,
    VK_B: 66,
    VK_C: 67,
    VK_D: 68,
    VK_E: 69,
    VK_F: 70,
    VK_G: 71,
    VK_H: 72,
    VK_I: 73,
    VK_J: 74,
    VK_K: 75,
    VK_L: 76,
    VK_M: 77,
    VK_N: 78,
    VK_O: 79,
    VK_P: 80,
    VK_Q: 81,
    VK_R: 82,
    VK_S: 83,
    VK_T: 84,
    VK_U: 85,
    VK_V: 86,
    VK_W: 87,
    VK_X: 88,
    VK_Y: 89,
    VK_Z: 90,

    VK_LWIN: 91, //左徽标键

    VK_RWIN: 92, //右徽标键

    VK_APPS: 93, //鼠标右键快捷键

    VK_NUMPAD0: 96, //小键盘0

    VK_NUMPAD0: 97, //小键盘1

    VK_NUMPAD0: 98, //小键盘2

    VK_NUMPAD0: 99, //小键盘3

    VK_NUMPAD0: 100, //小键盘4

    VK_NUMPAD0: 101, //小键盘5

    VK_NUMPAD0: 102, //小键盘6

    VK_NUMPAD0: 103, //小键盘7

    VK_NUMPAD0: 104, //小键盘8

    VK_NUMPAD0: 105, //小键盘9

    VK_DECIMAL: 110, //小键盘.

    VK_MULTIPLY: 106, //小键盘*

    VK_MULTIPLY: 107, //小键盘+

    VK_SUBTRACT: 109, //小键盘-

    VK_DIVIDE: 111, //小键盘/

    VK_F1: 112, //F1键

    VK_F2: 113, //F2键

    VK_F3: 114, //F3键

    VK_F4: 115, //F4键

    VK_F5: 116, //F5键

    VK_F6: 117, //F6键

    VK_F7: 118, //F7键

    VK_F8: 119, //F8键

    VK_F9: 120, //F9键

    VK_F10: 121, //F10键

    VK_F11: 122, //F11键

    VK_F12: 123, //F12键

    VK_NUMLOCK: 144, //Num Lock键

    VK_SCROLL: 145, //Scroll Lock键
  }

整理了一份JSON格式的键盘编码对照表。欢迎转载,但请注明出处,谢谢! { VK_BACK: 8, //退格键...

JSON [ JavaScript Object Notation ]:JavaScript 对象表示法。

/* *JavaScriptVirtualKeyboard(ATM-stylenumpadvariant),version2.3 * *Copyright2006-2007DmitriyKhudorozhkov * *Thissoftwareisprovided"as-is",withoutanyexpressorimpliedwarranty. *Innoeventwilltheauthorbeheldliableforanydamagesarisingfromthe *useofthissoftware. * *Permissionisgrantedtoanyonetousethissoftwareforanypurpose, *includingcommercialapplications,andtoalteritandredistributeit *freely,subjecttothefollowingrestrictions: * *1.Theoriginofthissoftwaremustnotbemisrepresented;youmustnot *claimthatyouwrotetheoriginalsoftware.Ifyouusethissoftware *inaproduct,anacknowledgmentintheproductdocumentationwouldbe *appreciatedbutisnotrequired. * *2.Alteredsourceversionsmustbeplainlymarkedassuch,andmustnotbe *misrepresentedasbeingtheoriginalsoftware. * *3.Thisnoticemaynotberemovedoralteredfromanysourcedistribution. * *-DmitriyKhudorozhkov,kh_dmitry2001@mail.ru */ functionVATMpad(container_id,callback_ref,font_name,font_size, font_color,bg_color,key_color,border_color, show_click,click_font_color,click_bg_color, click_border_color,do_embed) { returnthis._construct(container_id,callback_ref,font_name,font_size, font_color,bg_color,key_color,border_color, show_click,click_font_color,click_bg_color, click_border_color,do_embed); } VATMpad.prototype={ kbArray:[], _setup_event:function(elem,eventType,handler) { return(elem.attachEvent?elem.attachEvent("on"+eventType,handler):((elem.addEventListener)?elem.addEventListener(eventType,handler,false):null)); }, _start_flash:function { functiongetColor { if,s//trytodetectMozilla-stylergbvalue. { switch { case1:returnparseInt; case2:returnparseInt; case3:returnparseInt; default:return0; } } else//standardway returnstr.length==4?parseInt+str.substr:parseInt,16); } functiongetR {returngetColor;} functiongetG {returngetColor;} functiongetB {returngetColor;} varel=in_el.time?in_el:(in_el.company&&in_el.company.time?in_el.company:null); if { el.time=0; clearInterval; } varvkb=this; varftc=vkb.fontcolor,bgc=vkb.keycolor,brc=vkb.bordercolor; //Specialfixesforsimple/dead/modifierkeys: if ftc=vkb.deadcolor; if(((in_el.innerHTML=="Shift")&&vkb.Shift)||((in_el.innerHTML=="Caps")&&vkb.Caps)||((in_el.innerHTML=="AltGr")&&vkb.AltGr)) bgc=vkb.lic; //Extractbasecolorvalues: varfr=getR,fb=getB,kg=getG; varbr=getR,bb=getB; //Extractflashcolorvalues: varf_r=getR,f_g=getG,f_b=getB; vark_r=getR,k_g=getG,k_b=getB; varb_r=getR,b_g=getG,b_b=getB; var_shift_colors=function() { functiondec2hex { varhexChars="0123456789ABCDEF"; vara=dec%16; varb=/16; returnhexChars.charAt+""; } in_el.time=!in_el.time?10:; functioncalc_color {return*;} vart_f_r=calc_color,t_f_g=calc_color,t_f_澳门威尼斯人平台,b=calc_color; vart_k_r=calc_color,t_k_g=calc_color,t_k_b=calc_color; vart_b_r=calc_color,t_b_g=calc_color,t_b_b=calc_color; in_el.style.color="#"+dec2hex+dec2hex; in_el.style.borderColor="#"+dec2hex+dec2hex; in_el.style.backgroundColor="#"+dec2hex+dec2hex; if { clearInterval; return; } }; _shift_colors(); in_el.timer=window.setInterval; }, _setup_style:function(obj,top,left,width,height,position,border_color,bg_color,line_height,font_size,font_weight,padding_left,padding_right) { varos=obj.style; ifos.top=top; ifos.left=left; ifos.width=width; ifos.height=height; ifos.position=position; ifos.border="1pxsolid"+border_color; ifos.backgroundColor=bg_color; os.textAlign="center"; ifos.lineHeight=line_height; ifos.fontSize=font_size; os.fontWeight=font_weight||"bold"; ifos.paddingLeft=padding_left; ifos.paddingRight=padding_right; }, _setup_key:function(parent,id,top,left,width,height,border_color,bg_color,line_height,font_size,font_weight,padding_left,padding_right) { var_id=this.Cntr.id+id; varexists=document.getElementById; varkey=exists?exists.parentNode:document.createElement; this._setup_style(key,top,left,width,height,"absolute"); varkey_sub=exists||document.createElement; key.appendChild;parent.appendChild; this._setup_style(key_sub,"","","",line_height,"relative",border_color,bg_color,line_height,font_size,font_weight,padding_left,padding_right); key_sub.id=_id; ifthis._setup_event(key_sub,'mousedown',this._generic_callback_proc); returnkey_sub; }, _findX:function {return?parseFloat(obj.parentNode.offsetLeft):0;}, _findY:function {return?parseFloat(obj.parentNode.offsetTop):0;}, _findW:function {return?parseFloat(obj.parentNode.offsetWidth):0;}, _findH:function {return?parseFloat(obj.parentNode.offsetHeight):0;}, _construct:function(container_id,callback_ref,font_name,font_size,font_color,bg_color,key_color, border_color,show_click,click_font_color,click_bg_color,click_border_color,do_embed) { varexists=,ct=exists?this.Cntr:document.getElementById; varchanged=(font_size&&(font_size!=this.fontsize)); this._Callback==="function")&&((callback_ref.length==1)||(callback_ref.length==2)))?callback_ref:; varff=font_name||this.fontname||""; varfs=font_size||this.fontsize||"14px"; varfc=font_color||this.fontcolor||"#000"; varbg=bg_color||this.bgcolor||"#FFF"; varkc=key_color||this.keycolor||"#FFF"; varbc=border_color||this.bordercolor||"#777"; this.cfc=click_font_color||this.cfc||"#CC3300"; this.cbg=click_bg_color||this.cbg||"#FF9966"; this.cbr=click_border_color||this.cbr||"#CC3300"; this.sc=(show_click==undefined)??false:this.sc):show_click; this.fontname=ff,this.fontsize=fs,this.fontcolor=fc; this.bgcolor=bg,this.keycolor=kc,this.bordercolor=bc; if { this.Cntr=ct,this.LastKey=null; VATMpad.prototype.kbArray[container_id]=this; } varkb=exists?ct.childNodes[0]:document.createElement { ct.appendChild; ct.style.display="block"; ct.style.zIndex=999; if ct.style.position="relative"; else { ct.style.position="absolute"; //ManythankstoPeter-PaulKochforthefind-pos-X/find-pos-Ycode. varinitX=0,ct_=ct; if { while { initX+=ct_.offsetLeft; ct_=ct_.offsetParent; } } elseif initX+=ct_.x; varinitY=0;ct_=ct; if { while { initY+=ct_.offsetTop; ct_=ct_.offsetParent; } } elseif initY+=ct_.y; ct.style.top=initY+"px",ct.style.left=initX+"px"; } kb.style.position="relative"; kb.style.top="0px",kb.style.left="0px"; } kb.style.border="1pxsolid"+bc; varkb_main=exists?kb.childNodes[0]:document.createElement,ks=kb_main.style; if { kb.appendChild; ks.position="relative"; ks.width="1px"; ks.cursor="default"; } //Disablecontentselection: this._setup_event(kb_main,"selectstart",function; this._setup_event(kb_main,"mousedown",function{ifevent.preventDefault; ks.fontFamily=ff,ks.backgroundColor=bg; if { ks.width=this._create_numpad; ks.height=(this._findY+this._findH+"px"; } returnthis; }, _create_numpad:function { varc="center",n="normal"; varfs=this.fontsize,kc=this.keycolor,bc=this.bordercolor; varmag=parseFloat/14.0,cell=Math.floor; varcp=String+"px",lh=String+"px"; varedge="1px"; varkb_pad_7=this._setup_key(parent,"___pad_7","1px",edge,cp,cp,bc,kc,lh,fs); kb_pad_7.innerHTML="7"; varedge_1=String+this._findW+"px"; varkb_pad_8=this._setup_key(parent,"___pad_8","1px",edge_1,cp,cp,bc,kc,lh,fs); kb_pad_8.innerHTML="8"; varedge_2=String+this._findW+"px"; varkb_pad_9=this._setup_key(parent,"___pad_9","1px",edge_2,cp,cp,bc,kc,lh,fs); kb_pad_9.innerHTML="9"; varprevH=this._findH,edge_Y=+prevH+1)+"px"; edge_Y=+prevH+1)+"px"; varkb_pad_4=this._setup_key(parent,"___pad_4",edge_Y,edge,cp,cp,bc,kc,lh,fs); kb_pad_4.innerHTML="4"; varkb_pad_5=this._setup_key(parent,"___pad_5",edge_Y,edge_1,cp,cp,bc,kc,lh,fs); kb_pad_5.innerHTML="5"; varkb_pad_6=this._setup_key(parent,"___pad_6",edge_Y,edge_2,cp,cp,bc,kc,lh,fs); kb_pad_6.innerHTML="6"; edge_Y=+prevH+1)+"px"; varkb_pad_1=this._setup_key(parent,"___pad_1",edge_Y,edge,cp,cp,bc,kc,lh,fs); kb_pad_1.innerHTML="1"; varkb_pad_2=this._setup_key(parent,"___pad_2",edge_Y,edge_1,cp,cp,bc,kc,lh,fs); kb_pad_2.innerHTML="2"; varkb_pad_3=this._setup_key(parent,"___pad_3",edge_Y,edge_2,cp,cp,bc,kc,lh,fs); kb_pad_3.innerHTML="3"; edge_Y=+prevH+1)+"px"; varkb_pad_0=this._setup_key(parent,"___pad_0",edge_Y,edge,cp,cp,bc,kc,lh,fs); kb_pad_0.innerHTML="0"; varkb_pad_enter=this._setup_key(parent,"___pad_period",edge_Y,edge_1,String+"px",cp,bc,kc,lh,parseFloat; kb_pad_enter.innerHTML="Enter"; this.LastKey=kb_pad_enter; returnString+this._findW+"px"; }, _generic_callback_proc:function { vare=event||window.event; varin_el=e.srcElement||e.target; varcontainer_id=in_el.id.substring(0,in_el.id.indexOf; varvpad=VATMpad.prototype.kbArray[container_id]; ifvpad._start_flash; ifvpad._Callback(in_el.innerHTML,vpad.Cntr.id); }, SetParameters:function() { varl=arguments.length; ifreturnfalse; varp0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10; while { varvalue=arguments[l]; switch { case"callback": p0==="function")&&||?value:this._Callback; break; case"font-name":p1=value;break; case"font-size":p2=value;break; case"font-color":p3=value;break; case"base-color":p4=value;break; case"key-color":p5=value;break; case"border-color":p6=value;break; case"show-click":p7=value;break; case"click-font-color":p8=value;break; case"click-key-color":p9=value;break; case"click-border-color":p10=value;break; default:break; } l-=1; } this._construct(this.Cntr.id,p0,p1,p2,p3,p4,p5,p6,p7,p8,p9,p10); returntrue; }, Show:function { varct=this.Cntr.style; ct.display=||?"block":?"none":ct.display); } };打包文件下载

{ VK_BACK: 8, //退格键 VK_TAB: 9, //TAB键 VK_RETURN: 13, //回车键 VK_SHIFT: 16, //Shift键 VK_CONTROL: 17, //Ctrl键 VK_MENU: 18, //Alt键 VK_PAUSE: 19, //Pause Break键 VK_CAPITAL: 20, //Caps Lock键 VK_SPACE: 32, //空格键 VK_PRIOR: 33, //Page Up VK_NEXT: 34, //Page Down VK_END: 35, //End键 VK_HOME: 36, //Home键 VK_LEFT: 37, //方向键:← VK_UP: 38, //方向键:↑ VK_RIGHT: 39, //方向键:→ VK_DOWN: 40, //方向键:↓ VK_INSERT: 45, //Insert键 VK_DELETE: 46, //Delete键 //字母表 VK_A: 65, VK_B: 66, VK_C: 67, VK_D: 68, VK_E: 69, VK_F: 70, VK_G: 71, VK_H: 72, VK_I: 73, VK_J: 74, VK_K: 75, VK_L: 76, VK_M: 77, VK_N: 78, VK_O: 79, VK_P: 80, VK_Q: 81, VK_R: 82, VK_S: 83, VK_T: 84, VK_U: 85, VK_V: 86, VK_W: 87, VK_X: 88, VK_Y: 89, VK_Z: 90, VK_LWIN: 91, //左徽标键 VK_RWIN: 92, //右徽标键 VK_APPS: 93, //鼠标右键快捷键 VK_NUMPAD0: 96, //小键盘0 VK_NUMPAD0: 97, //小键盘1 VK_NUMPAD0: 98, //小键盘2 VK_NUMPAD0: 99, //小键盘3 VK_NUMPAD0: 100, //小键盘4 VK_NUMPAD0: 101, //小键盘5 VK_NUMPAD0: 102, //小键盘6 VK_NUMPAD0: 103, //小键盘7 VK_NUMPAD0: 104, //小键盘8 VK_NUMPAD0: 105, //小键盘9 VK_DECIMAL: 110, //小键盘. VK_MULTIPLY: 106, //小键盘* VK_MULTIPLY: 107, //小键盘+ VK_SUBTRACT: 109, //小键盘- VK_DIVIDE: 111, //小键盘/ VK_F1: 112, //F1键 VK_F2: 113, //F2键 VK_F3: 114, //F3键 VK_F4: 115, //F4键 VK_F5: 116, //F5键 VK_F6: 117, //F6键 VK_F7: 118, //F7键 VK_F8: 119, //F8键 VK_F9: 120, //F9键 VK_F10: 121, //F10键 VK_F11: 122, //F11键 VK_F12: 123, //F12键 VK_NUMLOCK: 144, //Num Lock键 VK_SCROLL: 145, //Scroll Lock键 }

它是一种轻量级的数据交换格式。

本文由澳门威尼斯人平台发布于服务器&运维,转载请注明出处:深入理解JSON数据源格式_javascript技巧_脚本之家

关键词: