Forum > LCL

OnKeyUp error sound

(1/4) > >>

dseligo:
When some key combinations are pressed, Windows emits error sound.
In OnKeyDown event one can suppress that by assigning Key := 0;.
This doesn't work in OnKeyUp.
How to prevent this error sound when I catch key combination in OnKeyUp?

Lazarus 2.2.4, Windows 11.

KodeZwerg:
That event is just too late for it.
"Prevent" you can only in OnKeyDown or OnKeyPress (KeyPreview must be True)

Thaddy:

--- Quote from: KodeZwerg on February 04, 2023, 12:53:13 pm ---That event is just too late for it.
"Prevent" you can only in OnKeyDown or OnKeyPress (KeyPreview must be True)

--- End quote ---
Wrong. Since OnKeyPress  and OnKeyDown are repeating events. OnKeyUp isn't.

KodeZwerg:
Hmmm, I do not know how you check to prevent Sound in "Up" cause there the keys already pressed and released so I ask for your way of doing please @Thaddy

dseligo:

--- Quote from: Thaddy on February 04, 2023, 12:58:44 pm ---
--- Quote from: KodeZwerg on February 04, 2023, 12:53:13 pm ---That event is just too late for it.
"Prevent" you can only in OnKeyDown or OnKeyPress (KeyPreview must be True)

--- End quote ---
Wrong. Since OnKeyPress  and OnKeyDown are repeating events. OnKeyUp isn't.

--- End quote ---

Exactly, other two are repeating and I'd like to use OnKeyUp. But not with that sound.

Navigation

[0] Message Index

[#] Next page

Go to full version