473,387 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Key interrupts

I would like to interrupt particular key strokes on a webpage, e.g. CTRL S
and have a javascript function called much like I can do this:

<body onclick="alert('Hello World')">

Only it would be triggered by CTRL S and calls a function of mine.
What would be the syntax? for this? Thanks.
Jul 23 '05 #1
2 1650

"Simon Wigzell" <si**********@shaw.ca> wrote in message
news:uUlXd.609711$Xk.154555@pd7tw3no...
I would like to interrupt particular key strokes on a webpage, e.g. CTRL S
and have a javascript function called much like I can do this:

<body onclick="alert('Hello World')">

Only it would be triggered by CTRL S and calls a function of mine.
What would be the syntax? for this? Thanks.


<
http://groups-beta.google.com/group/...0ec21127b52c26 >

CTRL wont work, afaik, but shift will:
http://www.js-examples.com/syntax/key_codes.php

--
juglesh
Jul 23 '05 #2
To start with you will have to write an event handler for the
onKeyDown/onKeyUp/onKeyPress event. Choosing which depends on what all
controls you have in the page.
You could do this for the entire body of the page by having an
onKeyPress="javascript:myEventHandler()"
attribute in the <body> tag.
Inside the myEventHandler() function, you could check for the
event.keyCode variable to check for the key pressed. You could also use
event.ctrlKey and event.shiftKey to check the state of the ctrl, shift
keys. They are booleans.
juglesh, wont event.ctrlKey work?
I had a requirement of disabling ctrl+n in one of my apps, and i was
able to do it.

Thanks

Anand

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: engsol | last post by:
Has anyone done a script that will rspond to the serial com port(s) receive buffer interrupt, as opposed to polling and timeouts? Win2000 is the main interest right now. Thanks Norm B
6
by: engsol | last post by:
I didn't fully think through my application before posting my question. Async com port routines to handle com port interrups only work well if one has access to the low level operating system. In...
6
by: Larry Woods | last post by:
I have multiple Calendar controls on my page and I want the user to select various dates, then press a Submit button. Is there a way to disable the interrupts from the Calendar controls? TIA, ...
2
by: D.Sn | last post by:
Hi all I need to implement interrupt functioality like Int86() in C, In VB I have an idea. What about precompiled assembly language use using "CallWindowProc" . I am not clear what...
8
by: Cyber | last post by:
Hello ! I want to catch any event on a PC by the interrupts (C++ under Linux). My first step is to catch everything from the keyboard. I have: ...
9
by: Sweety | last post by:
hello, Is there any code using interrupts . bye
1
by: Srinivas Reddy Thamma | last post by:
Hi, I would like to know few links that would be helpful for me to learn Interrupt programming in C language..... Thanks in advance. Srinivas
0
by: AlanL | last post by:
I am using MSCOMM for serial control and have an issue with some computers. When the handshake lines (CD, DSR, etc )are not connected on the computer I they generate OnComm events. I can ignore the...
4
by: jmarcrum | last post by:
I have to modify this assembly code in order to make it use interrupts. Right now, when I push button 1 on the microprocessor the count increments once (the LED's count in binary, using only 3 LED's...
1
by: JKaur | last post by:
hello frnds, please tell me the difference between DOS interrupts and interrupts invoked using int86() function in C (are those 8086 intrupts?). In some text i have read these are different, but...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.