MouseUp event not firing

Ok, I am doing something stupid…

I have textfields on a folder tab. I have code under
the MouseUp event handlers, but it dose not seem
to run. I This is on win7. Is there and enable or
something I have missed?

Code under the KeyUp event fires and works
just fine on these text fields.


From the Docs: MouseUp event

And check the coordinates in MouseUp to figure out if the MouseClick has been released within or outside of the Control.
You probably don‘t want/expect an Action if it‘s released outside…

Like I said, I am doing something stupid…
how do I " return True in the MouseDown event." ??

Sorry for the stupid questions.

you add the line


in the MouseDown Event

I knew this one before, but must add this line into the forum field:

Xojo is full of surprises. :slight_smile:

OK, how do I get key up to work in a text box?

Add a MouseDown Event in a text box (TextField or TextArea),
Add: Return True in that Event,

Add a MouseUp Event in the same text box (TextField or TextArea),
Put code that deals with the MouseUp in the COde Editor: this is your part.

Clear ?

No ?
Read the documentation (and download the book there:

You can’t return True to MouseDown in a TextField or TextArea. It would suppress all keyboard entries.

The only solution would be to start a 100ms or so multiple timer in keydown which would monitor the keyboard down state:

In Keydown:

TimerKeyUp.Mode = Timer.ModeMultiple

In The timer Action event:

[code]Dim down as boolean
For i as Integer = 0 to 255
if Keyboard.Asynkeydown(i) then
down = True
end if
If not down then
Sender.Mode = Timer.ModeOff
//This is the keyup

end if

Why do you need KeyUp there ? What are you trying to achieve ?

Not if you have another way to set the focus to the control. True, you can’t click in it but if another control gives it the focus, or you TAB into it, keystrokes are seen and handled fine.

This statement confuses me… as to how it would be considered correct?

What does the mousedown (true or false) have to do with normal keyboard operations?

I just created a test project with two textfield, one with TRUE in MD and one with nothing. I can click between them, and edit them both just fine… So I’m not sure what you consider the issue to be???

seems to get focus just fine in my tests

[quote=453191:@Dave S]This statement confuses me… as to how it would be considered correct?

What does the mousedown (true or false) have to do with normal keyboard operations?[/quote]

Both of you are correct - Sorry. I must have read much too fast. Returning True in MouseDown does not impair keyword operation in a TextField/TextArea.

However, indeed, returning True in MouseDown will impair all normal mouse operation. Meaning, no more selecting words or paragraphs with the mouse in order to copy or to delete.

@Luigi Faustini :

Here is the solution with a timer:

In MouseDown:

TimerMouseUp.Mode = Timer.ModeMultiple

In the Action event of the TimerMouseUp Action event:

[code]If not System.MouseDown then
Sender.Mode = Timer.ModeOff
//This is the MouseUp code

end if