1: <?php
2: /**
3: * Description of Keyshortcut
4: *
5: * @author SARTAJ
6: */
7:
8:
9: class Keyshortcut extends Control{
10:
11: public function oncreate($element){
12: $this->unsetrenderTag();
13: }
14:
15:
16: public function onjsrender(){
17: if($this->parameterA['keys']!=''){
18: $this->parameterA['keys'] = strtoupper($this->parameterA['keys']);
19: $ky = split(',',$this->parameterA['keys']);
20: $kyf = split(',',$this->parameterA['keyfun']);
21: foreach($ky as $key=>$val){
22: $str .= "if(String.fromCharCode(e.which) == '$val') { $kyf[$key] return false; } ";
23: }
24:
25: addHeaderJSCode($this->name,"
26: var isCtrl = false; $(document).keyup(function (e) { if(e.which == 17) isCtrl=false; }).keydown(function (e) {if(e.which == 17) isCtrl=true;
27: if(isCtrl == true){$str}
28: });
29: ");
30: }
31: }
32:
33:
34:
35: }
36: ?>