File: test-static-06.html

package info (click to toggle)
libjs-jquery-hotkeys 0~20130707+git2d51e3a9+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 176 kB
  • ctags: 26
  • sloc: makefile: 21
file content (41 lines) | stat: -rw-r--r-- 1,518 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<html>
    <head>
        <script src="jquery-1.3.2.min.js"></script>
    </head>

    <body>
        <h1>KeyDown.</h1>
        currentTarget: <input id="kd_currentTarget"><br/>
        which: <input id="kd_which"></br>
        shiftKey: <input id="kd_shiftKey"><br/>
        ctrlKey: <input id="kd_ctrlKey"><br/>
        altKey: <input id="kd_altKey"><br/>
        <h1>KeyPress.</h1>
        currentTarget: <input id="kp_currentTarget"><br/>
        which: <input id="kp_which"></br>
        shiftKey: <input id="kp_shiftKey"><br/>
        ctrlKey: <input id="kp_ctrlKey"><br/>
        altKey: <input id="kp_altKey"><br/>
        <script>
        
            $(document).bind('keydown', KdDescribeEvent);
            $(document).bind('keypress', KpDescribeEvent);
            
            function KdDescribeEvent(event){
                $('#kd_currentTarget').val(event.currentTarget);
                $('#kd_which').val(event.which);
                $('#kd_shiftKey').val(event.shiftKey);
                $('#kd_ctrlKey').val(event.ctrlKey);
                $('#kd_altKey').val(event.altKey);            
            }
            function KpDescribeEvent(event){
                $('#kp_currentTarget').val(event.currentTarget);
                $('#kp_which').val(event.which);
                $('#kp_shiftKey').val(event.shiftKey);
                $('#kp_ctrlKey').val(event.ctrlKey);
                $('#kp_altKey').val(event.altKey);            
            }
            
        </script>
    </body>
</html>