"use strict";(function(n){typeof define=="function"&&define.amd?define(["jquery"],n):n(jQuery)})(function(n){n.fn.initKeyboard=function(t){var i={el:n(this),list:[],debug:typeof t!="undefined"&&typeof t.debug!="undefined"&&t.debug,map:{Dead:"",Meta:"Cmd",Control:"Ctrl",Arrowup:"â–²",Arrowdown:"â–¼",Arrowleft:"â—€",Arrowright:"â–¶"},combo:function(){return this.list.sort().sort(function(n,t){return t.length-n.length}).join("+")},translate:function(n){return typeof this.map[n]!="undefined"&&(n=this.map[n]),n},format:function(n){return n=n.replace(/\w\S*/g,function(n){return n.charAt(0).toUpperCase()+n.substr(1).toLowerCase()}),this.translate(n).trim()},add:function(n){i.list.indexOf(n)<0&&i.list.push(n)},remove:function(n){var t=this.list.indexOf(n);t>=0&&this.list.splice(t,1)},trigger:function(){this.el.trigger(this.combo());this.debug&&console.log(this.combo())},reset:function(){this.list=[]}};i.el.on("keydown",function(n){n=i.format(n.key);n!==""&&(i.add(n),i.trigger())}).on("keyup",function(n){n=i.format(n.key);i.remove(n)}).on("blur focusout",function(){i.reset()});return i.el}});