Key scancodes
Displaying 1-8 of 8 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Wolf

I have a function where I want to use the delete button.
So I've put:

if(key[SCAN_DEL])
{
blah();
}

inside my while loop.

It doesn't work, because I seem to have a different scancode for delete from the one verge uses.
When I use SCAN_D it works fine, since that scancode does match.

I checked it. My scancode for delete is 211, not 83.
Furthermore:
For 'Insert' it's 210, not 82
For 'Page_Up': it's 201, not 73
For 'Page_Down': 209, not 81
For 'Home': 199, not 71
For 'End': 207, not 79
(Mine are 128 units higher)

So when I use key[211] it works fine, but it may not for other keyboards.

Why's this? Is it because I have a European keyboard? (I think I do anyway).
More importantly: How do I solve this? I'd like a universal interface...

Posted on 2004-10-26 12:11:15

Omni

I'm not quite sure about this...I know the Verge scancodes aren't based on ASCII, but then I don't really know what they _are_ based on either. It could just be arbitrary.

But then, Alex and Interference22 are both in Britain. Do you guys have different keyboards too?

You said your alphanumeric characters were the same, just your function codes that are 128 units higher. Maybe your keyboard is in a certain mode? Then again, I don't know, I'm no...European Character Code Expert.

Posted on 2004-10-26 18:05:07

zonker6666

Wolf my suggestion to you would be to make a control keys setup bit for your game. That way ppl can specify which key they would like to use for up down left right jump shoot whatever ...

Then it wont matter what keyboard setup they have.

Posted on 2004-10-26 18:08:23

Zip

Nah. Tilde doesn't work for me. But the del thing is just that SCAN_DEL is the numpad one, and vec lacks defines for all the keys. Line of code in makmak:
else if (key[SCAN_DEL] || key[211] || key[SCAN_BACKSP])

Zip

Posted on 2004-10-26 19:28:45

vecna

Man, I copied those scancode #defines right out of some directx .h file. If keys are missing, I blame microsoft!

.. which seems to be the trendy thing to do anyway!

Posted on 2004-10-26 20:07:04

Wolf

Quote:Originally posted by Zip

Nah. Tilde doesn't work for me. But the del thing is just that SCAN_DEL is the numpad one, and vec lacks defines for all the keys. Line of code in makmak:
else if (key[SCAN_DEL] || key[211] || key[SCAN_BACKSP])

Zip

Dude! There's a delete on my numpad too! :) Never knew.
You're right. That one has scancode 83.
So it's not a keyboard matter at all.

I`ll just change my codeline.

Thanks.

Posted on 2004-10-26 23:12:15

Zip

Quote:Originally posted by vecna

Man, I copied those scancode #defines right out of some directx .h file.


Ooookay... That was mistake #2.

Glad it's all working Wolf, sorry, I should have put a note in the docs on that when I first noticed it... but there's so many things I'm making work-arounds for each time I program, I forget sometimes. :)

Zip

Posted on 2004-10-26 23:16:35

RageCage

so 211 is the normal delete key?

Posted on 2004-10-26 23:55:30


Displaying 1-8 of 8 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.