[REBOL] Re: [view] field, input filter hook! (fixed)
From: moliad::aei::ca at: 27-Aug-2006 23:35
oops! previous example, missed delete and backspace in handled keys!
fixed version follows:
;--------------------------------------------------------------------
chars: charset [#"0" - #"9" "."]
key-hook: func [
face
event
/local ignore
][
if any [
ignore: parse to-string event/key [chars]
ignore: found? find [#"^M" #"^-" up down left right home end
#"^~" #"^H"] event/key
event/key = #"^["
][
unless ignore [
unfocus face
]
]
not ignore ; (we must supply opposite, we tell view if its consumed?)
]