About ASCII to ScanCode
Posted: Mon Apr 28, 2014 10:21 am
as title,how to convert ascii code to scan code?
Game Making Should Be Easy...
https://www.coolbasic.com/phpBB3/
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
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