How to create Pressed event handler

Hi!

I need to create a “Pressed” event handler on a 2018 WebSearchField, so when i move my project to 2021, all will be up-to-dated.

(On 2018, the event is KeyPressed, and on 2021, is Pressed)

Is it possible? How?

:sweat_smile:

First of all you have to forget about a “move”, Web 1 and web 2 are way too different to think like that.

No it is not possible. It is a different platform and a different API, those events dont even have the same parameters.

You should read this thread first: https://forum.xojo.com/t/how-scary-is-moving-from-2019-r1-1-to-the-2021-r1

Why not make a copy of the Web 1.0 Project and use that to update to the Web 2.0 Project using Xojo 2021 ?

It’s not possible to create an event handler called Pressed on xojo’s 2018 websearchfield?

because the actual project is changing all the time yet. so i want to change some methods, functions, parameters, all i can on this living project, so when i decide to start on 2021R2, most of the work will be ok.

Yes it is possible, if you create a custom class. Then you can add an event definition for Pressed.

On the class, use Click to trigger Pressed.

I’m really trying to create, but the examples/documentation on 2018 isn’t helping me.

there is no click event on websearchfield

Screen Shot 2021-07-26 at 11.39.17

NO

That makes no sense at all for what he wants

You are right, there is no click event. But there is MouseUp.

Contrary to what someone else is telling you, adding an event definition is nothing outlandish.

Here is an example project:
WebSearch-Pressed

1 Like

Thank you very much.

You helped a lot!

Create it to have the control “up-to-dated” and migrate automatically to 2021, NO.

Create a random event with any name you like, even Pressed, sure, you can add events with any name not in use.

Yes, it’s possible and i already did it.

I created an event named “Pressed”, implemented on 2018. then open on 2021 and voilà!

Forum for Xojo Programming Language and IDE. Copyright © 2021 Xojo, Inc.