Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using function keys as Key Press events

Status
Not open for further replies.

Hskrdoo

Programmer
Aug 27, 2001
13
0
0
US
Is it possible to use Function Keys (F1, F2, etc.) as key press events in a button? I have tried to use them but any time I press a function key, it does not register in the Key Press input box.
 
ya, you probly can, just type in "F2" or "F4" rather than presing the key to do it. not knowing is an excuse for those umwilling to lern -- John Rueben
 
excuse me guyz if my post wuld be off-topic, but here is a function on javascript that captures function keys:

<HTML>
<!-- CREATION DATE: 26/07/01 -->
<HEAD>
<TITLE></TITLE>
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
function fKeyCheck(e)
{
var charCode =(navigator.appName == &quot;Netscape&quot;) ? e.witch : e.keyCode
status = charCode //Ascii code
if (status == 112){alert(&quot;F1&quot;);e.keyCode = 0} // f1 will still pop help
if (status == 113){alert(&quot;F2&quot;);e.keyCode = 0}
if (status == 114){alert(&quot;F3&quot;);e.keyCode = 0}
if (status == 115){alert(&quot;F4&quot;);e.keyCode = 0}
if (status == 116){alert(&quot;F5&quot;);e.keyCode = 0}
if (status == 117){alert(&quot;F6&quot;);e.keyCode = 0}
if (status == 118){alert(&quot;F7&quot;);e.keyCode = 0}
if (status == 119){alert(&quot;F8&quot;);e.keyCode = 0}
return false
}
</SCRIPT>
</HEAD>
<BODY>
<FORM>
<INPUT TYPE=&quot;text&quot; NAME=&quot;kp1&quot; SIZE=40 MAXLENGTH=40 onKeyDown=&quot;return fKeyCheck(event)&quot;>
</FORM>
</BODY>
</HTML>


may be it'll help u somehow :) Victor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top