@TheComet:
This is what I meant in my earlier post re: the simplifying of the code (Assuming I understood the purpose correct

). It's a moot point now, I know, but why not anyway.
Disclaimer: There are prolly loads of errors in this, but it's the gist that matters and I'm sleepy (and I ate too much pasta earlier)
`` Define crap, UNKNOWN is for characters which my character set shows as unknown
#CONSTANT KBD_MAX_TYPES 2
#CONSTANT KBD_SWISS 1
#CONSTANT KBD_ENG 2
#CONSTANT UNKNOWN 255
`` This would track the keyboard layout in use
GLOBAL kbdLayout = KBD_SWISS
`` This is ons lookup
DIM theKeyboard(KBD_MAX_TYPES, 255)
`` Hah, realised this is quicker (copy-paste & modify) than having multiple for-loops
`` Obviously the real-life situation would call for this code to be in a section and formatted neater
`` Swiss
theKeyboard(KBD_SWISS, 16) = ASC("Q"): theKeyboard(KBD_SWISS, 17) = ASC("W"): theKeyboard(KBD_SWISS, 18) = ASC("E")
theKeyboard(KBD_SWISS, 19) = ASC("R"): theKeyboard(KBD_SWISS, 20) = ASC("T"): theKeyboard(KBD_SWISS, 21) = ASC("Z")
theKeyboard(KBD_SWISS, 22) = ASC("U"): theKeyboard(KBD_SWISS, 23) = ASC("I"): theKeyboard(KBD_SWISS, 24) = ASC("O")
theKeyboard(KBD_SWISS, 25) = ASC("P"): theKeyboard(KBD_SWISS, 26) = UNKNOWN : theKeyboard(KBD_SWISS, 30) = ASC("A")
theKeyboard(KBD_SWISS, 31) = ASC("S"): theKeyboard(KBD_SWISS, 32) = ASC("D"): theKeyboard(KBD_SWISS, 33) = ASC("F")
theKeyboard(KBD_SWISS, 34) = ASC("G"): theKeyboard(KBD_SWISS, 35) = ASC("H"): theKeyboard(KBD_SWISS, 36) = ASC("J")
theKeyboard(KBD_SWISS, 37) = ASC("K"): theKeyboard(KBD_SWISS, 38) = ASC("L"): theKeyboard(KBD_SWISS, 39) = UNKNOWN
theKeyboard(KBD_SWISS, 40) = UNKNOWN : theKeyboard(KBD_SWISS, 43) = ASC("$"): theKeyboard(KBD_SWISS, 44) = ASC("Y")
theKeyboard(KBD_SWISS, 45) = ASC("X"): theKeyboard(KBD_SWISS, 46) = ASC("C"): theKeyboard(KBD_SWISS, 47) = ASC("V")
theKeyboard(KBD_SWISS, 48) = ASC("B"): theKeyboard(KBD_SWISS, 49) = ASC("N"): theKeyboard(KBD_SWISS, 50) = ASC("M")
theKeyboard(KBD_SWISS, 51) = ASC(","): theKeyboard(KBD_SWISS, 52) = ASC("."): theKeyboard(KBD_SWISS, 53) = ASC("-")
``English, western
theKeyboard(KBD_ENG, 16) = ASC("Q"): theKeyboard(KBD_ENG, 17) = ASC("W"): theKeyboard(KBD_ENG, 18) = ASC("E")
theKeyboard(KBD_ENG, 19) = ASC("R"): theKeyboard(KBD_ENG, 20) = ASC("T"): theKeyboard(KBD_ENG, 21) = ASC("Y")
theKeyboard(KBD_ENG, 22) = ASC("U"): theKeyboard(KBD_ENG, 23) = ASC("I"): theKeyboard(KBD_ENG, 24) = ASC("O")
theKeyboard(KBD_ENG, 25) = ASC("P"): theKeyboard(KBD_ENG, 26) = ASC("["): theKeyboard(KBD_ENG, 30) = ASC("A")
theKeyboard(KBD_ENG, 31) = ASC("S"): theKeyboard(KBD_ENG, 32) = ASC("D"): theKeyboard(KBD_ENG, 33) = ASC("F")
theKeyboard(KBD_ENG, 34) = ASC("G"): theKeyboard(KBD_ENG, 35) = ASC("H"): theKeyboard(KBD_ENG, 36) = ASC("J")
theKeyboard(KBD_ENG, 37) = ASC("K"): theKeyboard(KBD_ENG, 38) = ASC("L"): theKeyboard(KBD_ENG, 39) = ASC(";")
theKeyboard(KBD_ENG, 40) = 34: theKeyboard(KBD_ENG, 43) = ASC("\"): theKeyboard(KBD_ENG, 44) = ASC("Z")
theKeyboard(KBD_ENG, 45) = ASC("X"): theKeyboard(KBD_ENG, 46) = ASC("C"): theKeyboard(KBD_ENG, 47) = ASC("V")
theKeyboard(KBD_ENG, 48) = ASC("B"): theKeyboard(KBD_ENG, 49) = ASC("N"): theKeyboard(KBD_ENG, 50) = ASC("M")
theKeyboard(KBD_ENG, 51) = ASC(","): theKeyboard(KBD_ENG, 52) = ASC("."): theKeyboard(KBD_ENG, 53) = ASC("/")
`` Now just pass the scan and the current keyboard layout to the array:
myKey = theKeyboard(kbdLayout, scan)
END `` Symbolic END because we should "never forget this"
`` This function's now obselete if I'm understanding right.
Function GetCharFromScancode(kbdType, scan)
retVal = theKeyboard(kbdType, scan) `` Not sure if I can return an array value in DBP, don't recall, hence 'retVal'
EndFunction retVal
Overly verbose way of illustrating the if-removal.
@TheUniverse:
I have got to actually DO something with all these game plots, sketches and other crap lying in my WIP folder. Please, bring me something.
Silence is golden, duct tape is silver