You will have to write your own "keymapping".
My gui-class contains this function:
'returns true if the conversion was successful
Function ConvertKeystrokesToText:Int(value:String Var, skipEnterKey:int = False)
'remove with backspace
If KEYWRAPPER.pressedKey(KEY_BACKSPACE)
value = value[..value.length -1]
return TRUE
Endif
'abort with ESCAPE
If KEYWRAPPER.pressedKey(KEY_ESCAPE) then Return False
'read special keys (shift + altgr) to enable special key handling
Local shiftPressed:Int = KEYMANAGER.IsDown(160) Or KEYMANAGER.IsDown(161)
?not Linux
'windows and mac
Local altGrPressed:int = KEYMANAGER.IsDown(164) Or KEYMANAGER.IsDown(165)
?Linux
'linux
Local altGrPressed:int = KEYMANAGER.IsDown(3)
?
'charCode is "0" if no key is recognized
local charCode:int = int(GetChar())
'loop through all chars of the getchar-queue
While charCode <>0
'charCode is < 0 for me when umlauts are pressed
if charCode < 0
?Win32
If KEYWRAPPER.pressedKey(186) Then If shiftPressed Then value:+ "Ü" Else value :+ "ü"
If KEYWRAPPER.pressedKey(192) Then If shiftPressed Then value:+ "Ö" Else value :+ "ö"
If KEYWRAPPER.pressedKey(222) Then If shiftPressed Then value:+ "Ä" Else value :+ "ä"
?Mac
If KEYWRAPPER.pressedKey(186) Then If shiftPressed Then value:+ "Ü" Else value :+ "ü"
If KEYWRAPPER.pressedKey(192) Then If shiftPressed Then value:+ "Ö" Else value :+ "ö"
If KEYWRAPPER.pressedKey(222) Then If shiftPressed Then value:+ "Ä" Else value :+ "ä"
?Linux
If KEYWRAPPER.pressedKey(252) Then If shiftPressed Then value:+ "Ü" Else value :+ "ü"
If KEYWRAPPER.pressedKey(246) Then If shiftPressed Then value:+ "Ö" Else value :+ "ö"
If KEYWRAPPER.pressedKey(163) Then If shiftPressed Then value:+ "Ä" Else value :+ "ä"
?
'handle normal "keys" (excluding umlauts)
elseif charCode > 0
local addChar:int = True
'skip "backspace"
if chr(KEY_BACKSPACE) = chr(charCode) then addChar = False
'skip enter if whished so
if skipEnterKey and chr(KEY_ENTER) = chr(charCode) then addChar = False
if addChar then value :+ chr(charCode)
endif
charCode = int(GetChar())
Wend
'special chars - recognized on Mac, but not Linux
'euro sign
?Linux
If KEYWRAPPER.pressedKey(69) And altGrPressed Then value :+ chr(8364)
?
Return True
End Function
Of course "KeyWrapper" won't exist in your case - but "KeyHit" or "KeyDown" should do similar (albeit not "cached" then).
bye Ron
|