About ASCII to ScanCode
-
- Newcomer
- Posts: 11
- Joined: Wed Mar 12, 2014 8:43 am
About ASCII to ScanCode
as title,how to convert ascii code to scan code?
-
- Moderator
- Posts: 1583
- Joined: Mon Aug 27, 2007 11:24 pm
- Location: Otaniemi - Mikkeli -pendelöinti
Re: About ASCII to ScanCode
Unfortunately there is no built-in method to do this (which is actually pretty weird), if you need customizable keys just store the scan codes directly. If you want to query the keys from the player, you can do something like this:
Code: Select all
Repeat
a = GetKey()
For i = 0 To 255
If KeyDown(i) Then
scan = i
EndIf
Next i
DrawScreen
Until a<>0
Print ""+a+" "+ Chr(a)+" " + Str(scan)
WaitKey
-
- Newcomer
- Posts: 11
- Joined: Wed Mar 12, 2014 8:43 am
Re: About ASCII to ScanCode
nice idea!koodaaja wrote:Unfortunately there is no built-in method to do this (which is actually pretty weird), if you need customizable keys just store the scan codes directly. If you want to query the keys from the player, you can do something like this:
Code: Select all
Repeat a = GetKey() For i = 0 To 255 If KeyDown(i) Then scan = i EndIf Next i DrawScreen Until a<>0 Print ""+a+" "+ Chr(a)+" " + Str(scan) WaitKey