Is it possible to create a custom event with key "pressed" and "released" inputs ?

It’s just this:

image


Or EI if you need something more elaborate: