Return in Textfield

BlitzPlus Forums/BlitzPlus Programming/Return in Textfield

Timjo(Posted 2007) [#1]
Is there a way to determine if the user has hit the RETURN key while in a textfield? I've read elsewhere in this forum that you can check for 13 in the eventdata() for the textfield, but I can't get it to recognise 13. If I print the eventdata() to the console - it will give the chr$ for other keys, but not for RETURN? Any ideas....Thanks.


CS_TBL(Posted 2007) [#2]
uh .. are you sure?

window=CreateWindow(".",0,0,640,480)
textfield=CreateTextField(0,0,600,24,window)

Repeat
	WaitEvent()
	DebugLog EventData()
	If EventID()=$803 End
Forever


..gives me '13' when pressing Enter .. (run in debugmode) ..


Timjo(Posted 2007) [#3]
It does - until you click inside the textfield area - then it just returns zeros. It seems once you're in the textfield it won't detect return(13). ?????


CS_TBL(Posted 2007) [#4]
Dunno dude, but spooky stuff must've landed at your place. No matter where I click in that textfield, everywhere I get 13 upon Enter. Can you post your code? Or is it more or less the same thing I made?

(that said, I dunno if I've the latest B+ here, I don't really keep track of it since moving to BMax/GUI)


El Neil(Posted 2007) [#5]
ive got version 1.44 and i get zeroes.

neil

EDIT: actually, i get 13's up until i click the text box, then i get zeroes from then onwards.


CS_TBL(Posted 2007) [#6]
ok then :) 1.39 here ... ^________^ Will check..


CS_TBL(Posted 2007) [#7]
Ok, check, zeros be there. I guess it's a bug then, I'd file a bugreport or spam BRL with it directly..

I usually assume that features are added, not taken away.. so .. :P


CS_TBL(Posted 2007) [#8]
A quick idea: when you replace my debug line with 'Debuglog EventId()' then you get 1025 for ordinary keys and 260 for the Enter key. Didn't bother to find which 'named' event ID this is supposed to be.. but perhaps until things are cleared up you can use this instead?


Timjo(Posted 2007) [#9]
Just checked the blitzplus bug report posts - there is a post from about a year ago. It says that the style flag should be set to 4 to register returns. Here's the link...

http://www.blitzbasic.com/Community/posts.php?topic=56161


CS_TBL(Posted 2007) [#10]
righty.. well I guess so then.. I'm @ BMax for more than a year already, I keep on supporting these regions here on the forum, but I never use B+ anymore, let alone keeping track of updates and bugreports.. :P