Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Numpad Codes

This topic is 5802 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

You know how Nehe uses keys[VK_LEFT]? Well, what are the codes for the number pad. I know that home, pgup, end, and pgdwn work, but I need the other numbers as well.

Share this post


Link to post
Share on other sites
Advertisement
VK_NUMPADx where x is the number (example: VK_NUMPAD0 is number pad 0).

-Sam.


--------------------------------------
http://waltsgames.iwarp.com
http://pub90.ezboard.com/bwaltersgames

Share this post


Link to post
Share on other sites
Or just toggle num lock

/Please excuse my bad spelling - My native language is binary not english
|Visit me
\Take my advice - I don''''t use it...

Share this post


Link to post
Share on other sites
just save this code as a .html document and there you go!




<script>
document.onkeydown = keyDown;

function keyDown(){
var keycode = event.keyCode;
var realkey = String.fromCharCode(event.keyCode);
alert(realkey+" "+keycode);
}
</script>


-PmanC

[edited by - PmanC on July 1, 2002 4:10:37 PM]

Share this post


Link to post
Share on other sites
And what do we do with the numbers we get? Should we use them instead of VK_x? Nice script, but I think using VK_x makes the code easier to read, and easier to understand.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!