UNPKG

funcunit

Version:
39 lines (33 loc) 948 B
<!DOCTYPE HTML> <html lang="en"> <head> <title>key</title> <style type='text/css'> body {font-family: verdana} .error {border: solid 1px red;} .error_text { color: red; font-size: 10px;} td {padding: 3px;} </style> </head> <body> <h1>key Demo</h1> <p class="status">NOT!</p> <script type='text/javascript' src='../../../../steal/steal.js'></script> <script type='text/javascript'> steal('jquery','can/control','can/control/modifier/key', function($, Control){ var Tester = can.Control({ "keydown":function(elm,ev){ can.$('.status').text('Found normal!') }, "keydown:(p)":function(elm,ev){ can.$('.status').text('Found jwerty (p)!') }, "keydown:(shift+p)":function(elm,ev){ can.$('.status').text('Found jwerty (shift+p)!') } }); new Tester(document.body); }); </script> </body> </html>