Si me lo permiten, propongo una pequeña variante...
Código Delphi
[-]
function TFunciones.ValidarEntrada(Key: Char; Tipo: TTipoEntrada): Char;
const
ACheckingKey:Array[TTipoEntrada] of String=('abcdefghijklmnopqrstuvwxyz'+#7+#8+#9,
'0123456789+-'#8+#13,
'0123456789.'+#8,
'0123456789abcdefghijklmnopqrstuvwxyz '+#7+#8);
begin
result:=#0;
if Pos(lowercase(key), ACheckingKey[Tipo])>0 then
result:=Key;
end;
Saludos cordiales