I want to apply a mask to a TextField that only allows these characters:
<>,.-+;:_’*!#%&/()=?\[]{}$£@^|~"
Not sure if Xojo allows for this as I don’t see characters noted here or how to escape them into the mask:
http://documentation.xojo.com/index.php/TextEdit.Mask
Do I need to write a function that checks for these? Or is there a built in method.
DaveS
(DaveS)
2
create a routine in the KEYDOWN event
something along the lines of
return Instr("<>,.-+;:_'*!#%&/()=?\\[]{}$£@^|~"+chrb(8)+chrb(3)+chrb(13),key)>0
this should allow the characters you mentioned, plus [RETURN], [ENTER] and [BACKSPACE]
Turned out I needed this:
return NOT (Instr("<>,.-+;:_’*!#%&/()=?\[]{}$£@^|~"+chrb(8)+chrb(3)+chrb(13),key)>0)
Thanks for the help!
Thats great, but what about this Character “`” Accents? what is the hex code of that, I mean in Keyboard Xojo docs are not available