keycode for "SHIFT F10" ???

Hi,
How Can I check keycode for "SHIFT F10", Please let me know asap. Is there any way to find out the other keyCode also like enter,space baar, ctrl,alt,etc...)
I Know the keycode of shift (16 is it okay), that I have taken from the javascript's window.event.keyCode
its giving keycode for seperate  for shift and F10 individually but it's not ging any value when I am pressing Shift + F10 together.

Thanks

PaHmn
pahmnAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

a.marshCommented:
This will capture Shift F10 in IE for you:

<html>
<head>
</head>
<body onload="if(window.event){this.focus()}">
<script language="JavaScript">
<!--
function capKey(){
var str = "You've just pressed SHIFT F10";

 if(window.event){
  if(event.shiftKey && event.keyCode == 121){
   alert(str);
  }
}
document.onkeydown=capKey;
//-->
</script>
</body>
</html>
pahmnAuthor Commented:
Great time for response,
I have tried this logic but ctrl is not reaching inside
if(event.shiftKey && event.keyCode == 121){  ...  and this is happening incase of "shift F1,4,6 & 10" , Its working fine for Shift +F2,3,5,7,8,9,11,12.
I thing "shift + F1,4,6,10" are system  defined keys , so please look into this and let me know.

here is my code :

<html>
<head>
</head>
<BODY leftmargin="2" topmargin="2" bgcolor="#CCCC99" onkeyup="checkKey()">
<script language="JavaScript">
<!--

function checkKey(){
var str = "You've just pressed SHIFT F10";

alert(window.event.keyCode);
alert(window.event.shiftKey);

 if(window.event.shiftKey && window.event.keyCode == 121){
  alert(str);

}

}
//-->
</script>
<H3>Test for shift F10</H3>
</body>
</html>

a.marshCommented:
This script should help your further (I found it on the Internet):

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JAVASCRIPT" TYPE="text/javascript">
  var aK = new Array(2)
  aKClr()

function getKeyCode(state) {
  aK[state] = event.keyCode
}

function aKShow() {
  alert("keyDown "+aK[0]+"\nkeyPress "+aK[1]+"\nkeyUp "+aK[2])
  aKClr()
}

function aKClr() {
  for (var i = 0; i < aK.length; i++) {
    aK[i] = -1
    }
}
</SCRIPT>
</HEAD>

<BODY onLoad="document.all.pcIn.focus();">
Type a key
<INPUT TYPE="text" ID=pcIn MAXLENGTH=1 SIZE=1
  onkeyDown="getKeyCode(0);" onkeyPress="getKeyCode(1);"
  onkeyUp = "getKeyCode(2);aKShow();this.value = '';">
</BODY>
</HTML>

Just make sure the textbox has the focus each time.

As you pointed out above, you'll find some keys won't work as they do special things - but you can work the code out - for example SHIFT F9 works in the script above but SHIFT F10 doesn't - however F!0 comes after F9 which makes it a code of 121 (as F9 is 120).

:o)

Ant

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pahmnAuthor Commented:
Marsh,
That is realy a good script to check out the key code but still I was getting the problem with shift + F10, but I have used onkeyDown event for the any button press and I have checked for shift key press by "window.event.shiftKey" and if it returns true I have populated alert. So Its work in this way.

if (window.event.shiftKey){
alert("shiftpass ... tested by hussain");
}

Thanks for coopration.

Pahmn
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.