Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Ascii Codes are wrong

Author
Message
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 2nd Aug 2012 23:28
I am trying to get the keys for <Left Right> as <> or ,.

I use scancode()=44 and Scancode()=46

But for some reason the keys end up being Z and C.

My keyboard is English(UK)

I have checked on the internet and 44, and 46 are supposed to work.

What am I doing wrong?

Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 2nd Aug 2012 23:37 Edited at: 2nd Aug 2012 23:37
Scancodes are not the same as ascii codes, both of which are different from virtual key codes.

Make a program which displays the value of scancode() and use that to work out what numbers to use.

[b]
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 2nd Aug 2012 23:43 Edited at: 2nd Aug 2012 23:43
Oh,OK, I'll look for scancodes then. Thanks!

WLGfx
18
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 2nd Aug 2012 23:59 Edited at: 3rd Aug 2012 00:00
Try this:



Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Aug 2012 01:09
ASCII codes remain constant across languages and keyboards. Scancodes can differ between keyboards

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Aug 2012 01:57
Quote: "Try this:"


I don't use that editor, I couldn't get it to work, everything was greyed out. So I use an older one.

Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 3rd Aug 2012 02:10
Here's a scancode map

Enjoy your day.
Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 3rd Aug 2012 02:15 Edited at: 3rd Aug 2012 02:17
Quote: "Here's a scancode map"


Thanks! I had one years ago but I can't find it. It must have been so long ago that RGT was still a forum. Since then most of my games have used the mouse, and arrow keys.

Login to post a reply

Server time is: 2026-07-08 05:37:43
Your offset time is: 2026-07-08 05:37:43