Recent

Author Topic: doubled keypresses register when there is a TMemo on a form  (Read 2967 times)

robert rozee

  • Full Member
  • ***
  • Posts: 197
Re: doubled keypresses register when there is a TMemo on a form
« Reply #15 on: January 11, 2025, 02:48:25 pm »
You can disable the TMemo, this will take away focus, but looks ugly, and the user cannot click on it anymore.

this is what i am doing at the moment: when the TMemo is being used i enable it with Memo1.Enabled:=true; Memo1.Visible:=true then when it is no longer required i do Memo1.Enabled:=false; Memo1.Visible:=false. but there are also two TPanel's that i have permanently visible, and thus are slightly more problematic. as it stands, they are currently never gaining focus, but if something changes in future it would be nice to have a means to either a) ensure they can never gain focus, or, b) have a solution ready, such that if either gains focus it can be immediately (and transparently to the user) undone. at the moment i'd depending on double-ups only happening if the value of Key is altered within the OnKeyDown event handler. but what if that changes with a future version of GTK2?

btw: did i mention that TPanel's display the same double-up behavior as TMemo's?


cheers,
rob   :-)

Bart

  • Hero Member
  • *****
  • Posts: 5494
    • Bart en Mariska's Webstek
Re: doubled keypresses register when there is a TMemo on a form
« Reply #16 on: January 12, 2025, 12:55:22 am »
btw: did i mention that TPanel's display the same double-up behavior as TMemo's?

The double OnKeyDown/OnKeyPress happens if any control has focus.

Bart

 

TinyPortal © 2005-2018