TextField1Filter Info

BlitzMax Forums/BlitzMax Beginners Area/TextField1Filter Info

Smokey(Posted 2005) [#1]
Hi

I use the TextField1Filter to detect what's is the current text of my textbox, what I want is to detect if the 'Return' Key was press


here an example.

Function TextField1Filter(Event:TEvent, Context:Object)

'Print CurrentEvent.ToString()
	Select event.id
		Case EVENT_KEYDOWN
		   'it detect the key event
                                   'but what's is the char that I Just type
			
	End Select
	Return 1
End Function


Also there's a lot of event in the doc like EventData(), EventID() , EventSource:Object ....etc. how to know what type of control can be associated with the correct event ?

if anyone could help me out I would appreciate it.


Perturbatio(Posted 2005) [#2]
take a look at the example code for SetGadgetFilter, it intercepts the return key (13)


klepto2(Posted 2005) [#3]
Simply add something like : Print Chr(Event.data)


Takuan(Posted 2005) [#4]
As for "Return":

Select event.id
Case EVENT_KEYDOWN
select event.data
Case Key_Return
blabla
End select
End Select

Symbolic constants are easier to read..;-)


Smokey(Posted 2005) [#5]
it's seem that the code work only with CreateTextArea If I wanna use CreateTextField , because I don't want multi-line , the code work for other char not the return key...


Chris C(Posted 2005) [#6]
you could use a textarea 1 line high, you will have to filter out all keys except del/backspace when you have more than a certain number of chars to avoid the scroll bars apearing, though you might be able to send the component a windows message to inhibit the scrollbars


taxlerendiosk(Posted 2005) [#7]
http://www.blitzbasic.com/Community/posts.php?topic=53113