Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

jquery - Best way to use special keys like [CTRL]+[UP] with onkeyup in all browsers -


how can use jquery onkeyup use these (multi) keys in new browsers?

  • ctrl+down
  • ctrl+up
  • alt+down
  • alt+up
  • down
  • up

have @ hotkeys plugin jquery!

edit: working hotkey plugion version (its pretty short):

(function(jquery){jquery.hotkeys={version:"0.8",specialkeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftnums:{"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":"\"",",":"<",".":">","/":"?","\\":"|"}};function keyhandler(handleobj){if(typeof handleobj.data!=="string"){return}var orighandler=handleobj.handler,keys=handleobj.data.tolowercase().split(" ");handleobj.handler=function(event){if(this!==event.target&&(/textarea|select/i.test(event.target.nodename)||event.target.type==="text")){return}var special=event.type!=="keypress"&&jquery.hotkeys.specialkeys[event.which],character=string.fromcharcode(event.which).tolowercase(),key,modif="",possible={};if(event.altkey&&special!=="alt"){modif+="alt+"}if(event.ctrlkey&&special!=="ctrl"){modif+="ctrl+"}if(event.metakey&&!event.ctrlkey&&special!=="meta"){modif+="meta+"}if(event.shiftkey&&special!=="shift"){modif+="shift+"}if(special){possible[modif+special]=true}else{possible[modif+character]=true;possible[modif+jquery.hotkeys.shiftnums[character]]=true;if(modif==="shift+"){possible[jquery.hotkeys.shiftnums[character]]=true}}for(var i=0,l=keys.length;i<l;i++){if(possible[keys[i]]){return orighandler.apply(this,arguments)}}}}jquery.each(["keydown","keyup","keypress"],function(){jquery.event.special[this]={add:keyhandler}})})(jquery); 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -