473,513 Members | 2,658 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pause in keyboard echo of characters.

Hello all,

I am looking for a little guidence. I have written a page in which I
am trying to identify when a function key (f1-f12) is pressed. When the
key is pressed a pre-defined event will occur.
I have done this with re-defining document.onKeydown. This works
wonderfully, with one exception.
When the end user is typing in a standard input field, with simple
text, the input will "pause". For example, as I am writting this the
echo of the letters is instant.
With the javascript function checking keystrokes, the page seems to
"pause" the input of standard text.

So my question is this, is there a way to remap, redefine, or simply
assign actions to be performed by the function keys, with out haveing
to check each keystoke?

Any help would be apreciated. Also, if it can't be done with
javascript, perhaps VBscript or ActiveX.

Thanks

Jul 23 '05 #1
1 1734
ericm wrote:
Hello all,

I am looking for a little guidence. I have written a page in which I
am trying to identify when a function key (f1-f12) is pressed. When the
key is pressed a pre-defined event will occur.
I have done this with re-defining document.onKeydown. This works
wonderfully, with one exception.
When the end user is typing in a standard input field, with simple
text, the input will "pause". For example, as I am writting this the
echo of the letters is instant.
With the javascript function checking keystrokes, the page seems to
"pause" the input of standard text.

So my question is this, is there a way to remap, redefine, or simply
assign actions to be performed by the function keys, with out haveing
to check each keystoke?

Any help would be apreciated. Also, if it can't be done with
javascript, perhaps VBscript or ActiveX.

Thanks


Why not disable the checking when the input field is focused and then
renable it when focus is taken away from the input.

And TBH it's should dwell that much if all you are doing it checking
keyCode in a switch like this

------------ SAMPLE CODE -------------
<textarea onkeydown="KeyPressed()"></textarea>

<script>
function KeyPressed()
{
switch( event.keyCode )
{
case 112: alert("F1"); break;
case 113: alert("F2"); break;
case 114: alert("F3"); break;
case 115: alert("F4"); break;
case 116: alert("F5"); break;
case 117: alert("F6"); break;
case 118: alert("F7"); break;
case 119: alert("F8"); break;
case 120: alert("F9"); break;
case 121: alert("F10"); break;
case 122: alert("F11"); break;
case 123: alert("F12"); break;

}
}

</script>
---------------------------------------

And in fact doing this i see no delay what so ever when typing in the
textarea.

HT
Andy
Jul 23 '05 #2

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

Similar topics

23
7675
by: herrcho | last post by:
What's the difference between STDIN and Keyboard buffer ? when i get char through scanf, i type in some characters and press enter, then, where do the characters go ? to STDIN or Keyboard...
38
3965
by: Jackie | last post by:
I just want the programme to stop for a while. Thanks.
3
3212
by: nma | last post by:
Hi This code goes well with play, stop and fullscreen button, the only thing is the pause button is not there. How to make pause button? I try to make pause button but when it streams video, when...
3
2985
by: NaN | last post by:
I've been trying to use _kbhit() but it didn't do what I thought it would from books, "Detects whether a keypress is available for reading." Herbert Schildt says, "If the user has pressed a key,...
0
7157
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
7379
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,...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7521
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5084
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.