Make a Web Hotkey

Source: Internet
Author: User
How to let the program detect your key, implement the Web hotkey function?
Please see the following code:
<script language= ' JavaScript ' >
<!--
function Issuecommand (x) {
if (document.layers)
{
if (x.which==99| | X.WHICH==67)
Window.close ();
else if (event.keycode==112| | EVENT.KEYCODE==80)
Self.print ();
else if (event.keycode==110| | event.keycode==78)
Alert ("Sorry, this are the only song in the List");
}
else if (document.all) {

if (event.keycode==99| | EVENT.KEYCODE==67)
Window.close ();
else if (event.keycode==112| | EVENT.KEYCODE==80)
Self.print ();
else if (event.keycode==110| | event.keycode==78)
Alert ("Sorry, this are the only song in the List");
}
}
-->
</script>
<body>
<script language= ' JavaScript ' >
<!--
if (document.layers)
Document.captureevents (event.keypress);
Document.onkeypress=issuecommand
-->
</script>
<font size=6><u>p</u>ress p</font><p>
<font Size=6><u>n</u>ext one</font><p>
<font Size=6><u>c</u>lose window</font><p>
</body>
is not very simple.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.