TextField1Filter Info
BlitzMax Forums/BlitzMax Beginners Area/TextField1Filter Info| 
 | ||
| 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. | 
| 
 | ||
| take a look at the example code for SetGadgetFilter, it intercepts the return key (13) | 
| 
 | ||
| Simply add something like : Print Chr(Event.data) | 
| 
 | ||
| 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..;-) | 
| 
 | ||
| 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... | 
| 
 | ||
| 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 | 
| 
 | ||
| http://www.blitzbasic.com/Community/posts.php?topic=53113 |